Lines Matching +full:0 +full:x2f
32 RV_REG_ZERO = 0, /* The constant value 0 */
109 memset(area, 0, size); in bpf_fill_ill_insns()
216 return 0; in is_12b_check()
234 from = (insn > 0) ? ctx->offset[insn - 1] : ctx->prologue_len; in rv_offset()
235 to = (insn + off > 0) ? ctx->offset[insn + off - 1] : ctx->prologue_len; in rv_offset()
256 u8 imm11_5 = imm11_0 >> 5, imm4_0 = imm11_0 & 0x1f; in rv_s_insn()
264 u8 imm12 = ((imm12_1 & 0x800) >> 5) | ((imm12_1 & 0x3f0) >> 4); in rv_b_insn()
265 u8 imm4_1 = ((imm12_1 & 0xf) << 1) | ((imm12_1 & 0x400) >> 10); in rv_b_insn()
280 imm = (imm20_1 & 0x80000) | ((imm20_1 & 0x3ff) << 9) | in rv_j_insn()
281 ((imm20_1 & 0x400) >> 2) | ((imm20_1 & 0x7f800) >> 11); in rv_j_insn()
305 imm = ((imm6 & 0x20) << 7) | ((imm6 & 0x1f) << 2); in rv_ci_insn()
316 return (funct3 << 13) | (uimm << 5) | ((rd & 0x7) << 2) | op; in rv_ciw_insn()
322 return (funct3 << 13) | (imm_hi << 10) | ((rs1 & 0x7) << 7) | in rv_cl_insn()
323 (imm_lo << 5) | ((rd & 0x7) << 2) | op; in rv_cl_insn()
329 return (funct3 << 13) | (imm_hi << 10) | ((rs1 & 0x7) << 7) | in rv_cs_insn()
330 (imm_lo << 5) | ((rs2 & 0x7) << 2) | op; in rv_cs_insn()
335 return (funct6 << 10) | ((rd & 0x7) << 7) | (funct2 << 5) | in rv_ca_insn()
336 ((rs2 & 0x7) << 2) | op; in rv_ca_insn()
343 imm = ((imm6 & 0x20) << 7) | ((imm6 & 0x1f) << 2); in rv_cb_insn()
344 return (funct3 << 13) | (funct2 << 10) | ((rd & 0x7) << 7) | op | imm; in rv_cb_insn()
351 return rv_i_insn(imm11_0, rs1, 0, rd, 0x13); in rv_addi()
356 return rv_i_insn(imm11_0, rs1, 7, rd, 0x13); in rv_andi()
361 return rv_i_insn(imm11_0, rs1, 6, rd, 0x13); in rv_ori()
366 return rv_i_insn(imm11_0, rs1, 4, rd, 0x13); in rv_xori()
371 return rv_i_insn(imm11_0, rs1, 1, rd, 0x13); in rv_slli()
376 return rv_i_insn(imm11_0, rs1, 5, rd, 0x13); in rv_srli()
381 return rv_i_insn(0x400 | imm11_0, rs1, 5, rd, 0x13); in rv_srai()
386 return rv_u_insn(imm31_12, rd, 0x37); in rv_lui()
391 return rv_u_insn(imm31_12, rd, 0x17); in rv_auipc()
396 return rv_r_insn(0, rs2, rs1, 0, rd, 0x33); in rv_add()
401 return rv_r_insn(0x20, rs2, rs1, 0, rd, 0x33); in rv_sub()
406 return rv_r_insn(0, rs2, rs1, 3, rd, 0x33); in rv_sltu()
411 return rv_r_insn(0, rs2, rs1, 7, rd, 0x33); in rv_and()
416 return rv_r_insn(0, rs2, rs1, 6, rd, 0x33); in rv_or()
421 return rv_r_insn(0, rs2, rs1, 4, rd, 0x33); in rv_xor()
426 return rv_r_insn(0, rs2, rs1, 1, rd, 0x33); in rv_sll()
431 return rv_r_insn(0, rs2, rs1, 5, rd, 0x33); in rv_srl()
436 return rv_r_insn(0x20, rs2, rs1, 5, rd, 0x33); in rv_sra()
441 return rv_r_insn(1, rs2, rs1, 0, rd, 0x33); in rv_mul()
446 return rv_r_insn(1, rs2, rs1, 3, rd, 0x33); in rv_mulhu()
451 return rv_r_insn(1, rs2, rs1, 4, rd, 0x33); in rv_div()
456 return rv_r_insn(1, rs2, rs1, 5, rd, 0x33); in rv_divu()
461 return rv_r_insn(1, rs2, rs1, 6, rd, 0x33); in rv_rem()
466 return rv_r_insn(1, rs2, rs1, 7, rd, 0x33); in rv_remu()
471 return rv_j_insn(imm20_1, rd, 0x6f); in rv_jal()
476 return rv_i_insn(imm11_0, rs1, 0, rd, 0x67); in rv_jalr()
481 return rv_b_insn(imm12_1, rs2, rs1, 0, 0x63); in rv_beq()
486 return rv_b_insn(imm12_1, rs2, rs1, 1, 0x63); in rv_bne()
491 return rv_b_insn(imm12_1, rs2, rs1, 6, 0x63); in rv_bltu()
501 return rv_b_insn(imm12_1, rs2, rs1, 7, 0x63); in rv_bgeu()
511 return rv_b_insn(imm12_1, rs2, rs1, 4, 0x63); in rv_blt()
521 return rv_b_insn(imm12_1, rs2, rs1, 5, 0x63); in rv_bge()
531 return rv_i_insn(imm11_0, rs1, 0, rd, 0x03); in rv_lb()
536 return rv_i_insn(imm11_0, rs1, 1, rd, 0x03); in rv_lh()
541 return rv_i_insn(imm11_0, rs1, 2, rd, 0x03); in rv_lw()
546 return rv_i_insn(imm11_0, rs1, 4, rd, 0x03); in rv_lbu()
551 return rv_i_insn(imm11_0, rs1, 5, rd, 0x03); in rv_lhu()
556 return rv_s_insn(imm11_0, rs2, rs1, 0, 0x23); in rv_sb()
561 return rv_s_insn(imm11_0, rs2, rs1, 1, 0x23); in rv_sh()
566 return rv_s_insn(imm11_0, rs2, rs1, 2, 0x23); in rv_sw()
571 return rv_amo_insn(0, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoadd_w()
576 return rv_amo_insn(0xc, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoand_w()
581 return rv_amo_insn(0x8, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoor_w()
586 return rv_amo_insn(0x4, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoxor_w()
591 return rv_amo_insn(0x1, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoswap_w()
596 return rv_amo_insn(0x2, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_lr_w()
601 return rv_amo_insn(0x3, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_sc_w()
608 return rv_i_insn(imm11_0, 0, 0, 0, 0xf); in rv_fence()
613 return rv_i_insn(0, 0, 0, 0, 0x13); in rv_nop()
622 imm = ((imm10 & 0x30) << 2) | ((imm10 & 0x3c0) >> 4) | in rvc_addi4spn()
623 ((imm10 & 0x4) >> 1) | ((imm10 & 0x8) >> 3); in rvc_addi4spn()
624 return rv_ciw_insn(0x0, imm, rd, 0x0); in rvc_addi4spn()
631 imm_hi = (imm7 & 0x38) >> 3; in rvc_lw()
632 imm_lo = ((imm7 & 0x4) >> 1) | ((imm7 & 0x40) >> 6); in rvc_lw()
633 return rv_cl_insn(0x2, imm_hi, rs1, imm_lo, rd, 0x0); in rvc_lw()
640 imm_hi = (imm7 & 0x38) >> 3; in rvc_sw()
641 imm_lo = ((imm7 & 0x4) >> 1) | ((imm7 & 0x40) >> 6); in rvc_sw()
642 return rv_cs_insn(0x6, imm_hi, rs1, imm_lo, rs2, 0x0); in rvc_sw()
647 return rv_ci_insn(0, imm6, rd, 0x1); in rvc_addi()
652 return rv_ci_insn(0x2, imm6, rd, 0x1); in rvc_li()
659 imm = ((imm10 & 0x200) >> 4) | (imm10 & 0x10) | ((imm10 & 0x40) >> 3) | in rvc_addi16sp()
660 ((imm10 & 0x180) >> 6) | ((imm10 & 0x20) >> 5); in rvc_addi16sp()
661 return rv_ci_insn(0x3, imm, RV_REG_SP, 0x1); in rvc_addi16sp()
666 return rv_ci_insn(0x3, imm6, rd, 0x1); in rvc_lui()
671 return rv_cb_insn(0x4, imm6, 0, rd, 0x1); in rvc_srli()
676 return rv_cb_insn(0x4, imm6, 0x1, rd, 0x1); in rvc_srai()
681 return rv_cb_insn(0x4, imm6, 0x2, rd, 0x1); in rvc_andi()
686 return rv_ca_insn(0x23, rd, 0, rs, 0x1); in rvc_sub()
691 return rv_ca_insn(0x23, rd, 0x1, rs, 0x1); in rvc_xor()
696 return rv_ca_insn(0x23, rd, 0x2, rs, 0x1); in rvc_or()
701 return rv_ca_insn(0x23, rd, 0x3, rs, 0x1); in rvc_and()
706 return rv_ci_insn(0, imm6, rd, 0x2); in rvc_slli()
713 imm = ((imm8 & 0xc0) >> 6) | (imm8 & 0x3c); in rvc_lwsp()
714 return rv_ci_insn(0x2, imm, rd, 0x2); in rvc_lwsp()
719 return rv_cr_insn(0x8, rs1, RV_REG_ZERO, 0x2); in rvc_jr()
724 return rv_cr_insn(0x8, rd, rs, 0x2); in rvc_mv()
729 return rv_cr_insn(0x9, rs1, RV_REG_ZERO, 0x2); in rvc_jalr()
734 return rv_cr_insn(0x9, rd, rs, 0x2); in rvc_add()
741 imm = (imm8 & 0x3c) | ((imm8 & 0xc0) >> 6); in rvc_swsp()
742 return rv_css_insn(0x6, imm, rs2, 0x2); in rvc_swsp()
748 return rv_r_insn(0x10, rs2, rs1, 0x4, rd, 0x33); in rvzba_sh2add()
753 return rv_r_insn(0x10, rs2, rs1, 0x6, rd, 0x33); in rvzba_sh3add()
759 return rv_i_insn(0x604, rs1, 1, rd, 0x13); in rvzbb_sextb()
764 return rv_i_insn(0x605, rs1, 1, rd, 0x13); in rvzbb_sexth()
770 return rv_i_insn(0x80, rs, 4, rd, 0x3b); in rvzbb_zexth()
772 return rv_i_insn(0x80, rs, 4, rd, 0x33); in rvzbb_zexth()
778 return rv_i_insn(0x6b8, rs, 5, rd, 0x13); in rvzbb_rev8()
780 return rv_i_insn(0x698, rs, 5, rd, 0x13); in rvzbb_rev8()
794 return rv_i_insn(imm11_0, rs1, 0, rd, 0x1b); in rv_addiw()
799 return rv_i_insn(imm11_0, rs1, 1, rd, 0x1b); in rv_slliw()
804 return rv_i_insn(imm11_0, rs1, 5, rd, 0x1b); in rv_srliw()
809 return rv_i_insn(0x400 | imm11_0, rs1, 5, rd, 0x1b); in rv_sraiw()
814 return rv_r_insn(0, rs2, rs1, 0, rd, 0x3b); in rv_addw()
819 return rv_r_insn(0x20, rs2, rs1, 0, rd, 0x3b); in rv_subw()
824 return rv_r_insn(0, rs2, rs1, 1, rd, 0x3b); in rv_sllw()
829 return rv_r_insn(0, rs2, rs1, 5, rd, 0x3b); in rv_srlw()
834 return rv_r_insn(0x20, rs2, rs1, 5, rd, 0x3b); in rv_sraw()
839 return rv_r_insn(1, rs2, rs1, 0, rd, 0x3b); in rv_mulw()
844 return rv_r_insn(1, rs2, rs1, 4, rd, 0x3b); in rv_divw()
849 return rv_r_insn(1, rs2, rs1, 5, rd, 0x3b); in rv_divuw()
854 return rv_r_insn(1, rs2, rs1, 6, rd, 0x3b); in rv_remw()
859 return rv_r_insn(1, rs2, rs1, 7, rd, 0x3b); in rv_remuw()
864 return rv_i_insn(imm11_0, rs1, 3, rd, 0x03); in rv_ld()
869 return rv_i_insn(imm11_0, rs1, 6, rd, 0x03); in rv_lwu()
874 return rv_s_insn(imm11_0, rs2, rs1, 3, 0x23); in rv_sd()
879 return rv_amo_insn(0, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoadd_d()
884 return rv_amo_insn(0xc, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoand_d()
889 return rv_amo_insn(0x8, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoor_d()
894 return rv_amo_insn(0x4, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoxor_d()
899 return rv_amo_insn(0x1, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoswap_d()
904 return rv_amo_insn(0x2, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_lr_d()
909 return rv_amo_insn(0x3, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_sc_d()
918 imm_hi = (imm8 & 0x38) >> 3; in rvc_ld()
919 imm_lo = (imm8 & 0xc0) >> 6; in rvc_ld()
920 return rv_cl_insn(0x3, imm_hi, rs1, imm_lo, rd, 0x0); in rvc_ld()
927 imm_hi = (imm8 & 0x38) >> 3; in rvc_sd()
928 imm_lo = (imm8 & 0xc0) >> 6; in rvc_sd()
929 return rv_cs_insn(0x7, imm_hi, rs1, imm_lo, rs2, 0x0); in rvc_sd()
934 return rv_ca_insn(0x27, rd, 0, rs, 0x1); in rvc_subw()
939 return rv_ci_insn(0x1, imm6, rd, 0x1); in rvc_addiw()
946 imm = ((imm9 & 0x1c0) >> 6) | (imm9 & 0x38); in rvc_ldsp()
947 return rv_ci_insn(0x3, imm, rd, 0x2); in rvc_ldsp()
954 imm = (imm9 & 0x38) | ((imm9 & 0x1c0) >> 6); in rvc_sdsp()
955 return rv_css_insn(0x7, imm, rs2, 0x2); in rvc_sdsp()
963 return rv_r_insn(0x04, RV_REG_ZERO, rs1, 0, rd, 0x3b); in rvzba_zextw()
985 emit(rv_addi(rd, rs, 0), ctx); in emit_mv()
998 if (rvc_enabled() && rd == RV_REG_SP && rd == rs && is_10b_int(imm) && imm && !(imm & 0xf)) in emit_addi()
1001 !(imm & 0x3) && imm) in emit_addi()
1091 if (rvc_enabled() && rs1 == RV_REG_SP && rd && is_8b_uint(off) && !(off & 0x3)) in emit_lw()
1093 else if (rvc_enabled() && is_creg(rd) && is_creg(rs1) && is_7b_uint(off) && !(off & 0x3)) in emit_lw()
1101 if (rvc_enabled() && rs1 == RV_REG_SP && is_8b_uint(off) && !(off & 0x3)) in emit_sw()
1103 else if (rvc_enabled() && is_creg(rs1) && is_creg(rs2) && is_7b_uint(off) && !(off & 0x3)) in emit_sw()
1144 if (rvc_enabled() && rs1 == RV_REG_SP && rd && is_9b_uint(off) && !(off & 0x7)) in emit_ld()
1146 else if (rvc_enabled() && is_creg(rd) && is_creg(rs1) && is_8b_uint(off) && !(off & 0x7)) in emit_ld()
1154 if (rvc_enabled() && rs1 == RV_REG_SP && is_9b_uint(off) && !(off & 0x7)) in emit_sd()
1156 else if (rvc_enabled() && is_creg(rs1) && is_creg(rs2) && is_8b_uint(off) && !(off & 0x7)) in emit_sd()
1194 emit_addiw(rd, rs, 0, ctx); in emit_sextw()
1230 emit_li(RV_REG_T2, 0, ctx); in emit_bswap()
1232 emit_andi(RV_REG_T1, rd, 0xff, ctx); in emit_bswap()
1239 emit_andi(RV_REG_T1, rd, 0xff, ctx); in emit_bswap()
1244 emit_andi(RV_REG_T1, rd, 0xff, ctx); in emit_bswap()
1251 emit_andi(RV_REG_T1, rd, 0xff, ctx); in emit_bswap()
1256 emit_andi(RV_REG_T1, rd, 0xff, ctx); in emit_bswap()
1261 emit_andi(RV_REG_T1, rd, 0xff, ctx); in emit_bswap()
1266 emit_andi(RV_REG_T1, rd, 0xff, ctx); in emit_bswap()
1271 emit_andi(RV_REG_T1, rd, 0xff, ctx); in emit_bswap()