Lines Matching refs:imm

198 				  u32 insn, u64 imm)  in aarch64_insn_encode_immediate()  argument
209 immlo = (imm & ADR_IMM_LOMASK) << ADR_IMM_LOSHIFT; in aarch64_insn_encode_immediate()
210 imm >>= ADR_IMM_HILOSPLIT; in aarch64_insn_encode_immediate()
211 immhi = (imm & ADR_IMM_HIMASK) << ADR_IMM_HISHIFT; in aarch64_insn_encode_immediate()
212 imm = immlo | immhi; in aarch64_insn_encode_immediate()
226 insn |= (imm & mask) << shift; in aarch64_insn_encode_immediate()
718 int imm, enum aarch64_insn_variant variant, in aarch64_insn_gen_add_sub_imm() argument
753 if (imm & ~(BIT(24) - 1)) in aarch64_insn_gen_add_sub_imm()
757 if (imm & ~(SZ_4K - 1)) { in aarch64_insn_gen_add_sub_imm()
759 if (imm & (SZ_4K - 1)) in aarch64_insn_gen_add_sub_imm()
762 imm >>= 12; in aarch64_insn_gen_add_sub_imm()
770 return aarch64_insn_encode_immediate(AARCH64_INSN_IMM_12, insn, imm); in aarch64_insn_gen_add_sub_imm()
773 pr_err("%s: invalid immediate encoding %d\n", __func__, imm); in aarch64_insn_gen_add_sub_imm()
833 int imm, int shift, in aarch64_insn_gen_movewide() argument
854 if (imm & ~(SZ_64K - 1)) { in aarch64_insn_gen_movewide()
855 pr_err("%s: invalid immediate encoding %d\n", __func__, imm); in aarch64_insn_gen_movewide()
884 return aarch64_insn_encode_immediate(AARCH64_INSN_IMM_16, insn, imm); in aarch64_insn_gen_movewide()
1200 s32 imm; in aarch64_get_branch_offset() local
1203 imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_26, insn); in aarch64_get_branch_offset()
1204 return (imm << 6) >> 4; in aarch64_get_branch_offset()
1209 imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_19, insn); in aarch64_get_branch_offset()
1210 return (imm << 13) >> 11; in aarch64_get_branch_offset()
1214 imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_14, insn); in aarch64_get_branch_offset()
1215 return (imm << 18) >> 16; in aarch64_get_branch_offset()
1301 static u32 aarch64_encode_immediate(u64 imm, in aarch64_encode_immediate() argument
1324 if (!imm || imm == mask || imm & ~mask) in aarch64_encode_immediate()
1334 if ((imm & emask) != ((imm >> tmp) & emask)) in aarch64_encode_immediate()
1345 imm &= mask; in aarch64_encode_immediate()
1348 ones = hweight64(imm); in aarch64_encode_immediate()
1359 if (range_of_ones(imm)) { in aarch64_encode_immediate()
1365 ror = __ffs64(imm); in aarch64_encode_immediate()
1374 imm |= ~mask; in aarch64_encode_immediate()
1375 if (!range_of_ones(~imm)) in aarch64_encode_immediate()
1382 ror = fls(~imm); in aarch64_encode_immediate()
1401 u64 imm) in aarch64_insn_gen_logical_immediate() argument
1425 return aarch64_encode_immediate(imm, variant, insn); in aarch64_insn_gen_logical_immediate()