Lines Matching +full:0 +full:x2f

22 	RV_REG_ZERO =	0,	/* The constant value 0 */
97 memset(area, 0, size); in bpf_fill_ill_insns()
204 return 0; in is_12b_check()
222 from = (insn > 0) ? ctx->offset[insn - 1] : ctx->prologue_len; in rv_offset()
223 to = (insn + off > 0) ? ctx->offset[insn + off - 1] : ctx->prologue_len; in rv_offset()
244 u8 imm11_5 = imm11_0 >> 5, imm4_0 = imm11_0 & 0x1f; in rv_s_insn()
252 u8 imm12 = ((imm12_1 & 0x800) >> 5) | ((imm12_1 & 0x3f0) >> 4); in rv_b_insn()
253 u8 imm4_1 = ((imm12_1 & 0xf) << 1) | ((imm12_1 & 0x400) >> 10); in rv_b_insn()
268 imm = (imm20_1 & 0x80000) | ((imm20_1 & 0x3ff) << 9) | in rv_j_insn()
269 ((imm20_1 & 0x400) >> 2) | ((imm20_1 & 0x7f800) >> 11); in rv_j_insn()
293 imm = ((imm6 & 0x20) << 7) | ((imm6 & 0x1f) << 2); in rv_ci_insn()
304 return (funct3 << 13) | (uimm << 5) | ((rd & 0x7) << 2) | op; in rv_ciw_insn()
310 return (funct3 << 13) | (imm_hi << 10) | ((rs1 & 0x7) << 7) | in rv_cl_insn()
311 (imm_lo << 5) | ((rd & 0x7) << 2) | op; in rv_cl_insn()
317 return (funct3 << 13) | (imm_hi << 10) | ((rs1 & 0x7) << 7) | in rv_cs_insn()
318 (imm_lo << 5) | ((rs2 & 0x7) << 2) | op; in rv_cs_insn()
323 return (funct6 << 10) | ((rd & 0x7) << 7) | (funct2 << 5) | in rv_ca_insn()
324 ((rs2 & 0x7) << 2) | op; in rv_ca_insn()
331 imm = ((imm6 & 0x20) << 7) | ((imm6 & 0x1f) << 2); in rv_cb_insn()
332 return (funct3 << 13) | (funct2 << 10) | ((rd & 0x7) << 7) | op | imm; in rv_cb_insn()
339 return rv_i_insn(imm11_0, rs1, 0, rd, 0x13); in rv_addi()
344 return rv_i_insn(imm11_0, rs1, 7, rd, 0x13); in rv_andi()
349 return rv_i_insn(imm11_0, rs1, 6, rd, 0x13); in rv_ori()
354 return rv_i_insn(imm11_0, rs1, 4, rd, 0x13); in rv_xori()
359 return rv_i_insn(imm11_0, rs1, 1, rd, 0x13); in rv_slli()
364 return rv_i_insn(imm11_0, rs1, 5, rd, 0x13); in rv_srli()
369 return rv_i_insn(0x400 | imm11_0, rs1, 5, rd, 0x13); in rv_srai()
374 return rv_u_insn(imm31_12, rd, 0x37); in rv_lui()
379 return rv_u_insn(imm31_12, rd, 0x17); in rv_auipc()
384 return rv_r_insn(0, rs2, rs1, 0, rd, 0x33); in rv_add()
389 return rv_r_insn(0x20, rs2, rs1, 0, rd, 0x33); in rv_sub()
394 return rv_r_insn(0, rs2, rs1, 3, rd, 0x33); in rv_sltu()
399 return rv_r_insn(0, rs2, rs1, 7, rd, 0x33); in rv_and()
404 return rv_r_insn(0, rs2, rs1, 6, rd, 0x33); in rv_or()
409 return rv_r_insn(0, rs2, rs1, 4, rd, 0x33); in rv_xor()
414 return rv_r_insn(0, rs2, rs1, 1, rd, 0x33); in rv_sll()
419 return rv_r_insn(0, rs2, rs1, 5, rd, 0x33); in rv_srl()
424 return rv_r_insn(0x20, rs2, rs1, 5, rd, 0x33); in rv_sra()
429 return rv_r_insn(1, rs2, rs1, 0, rd, 0x33); in rv_mul()
434 return rv_r_insn(1, rs2, rs1, 3, rd, 0x33); in rv_mulhu()
439 return rv_r_insn(1, rs2, rs1, 4, rd, 0x33); in rv_div()
444 return rv_r_insn(1, rs2, rs1, 5, rd, 0x33); in rv_divu()
449 return rv_r_insn(1, rs2, rs1, 6, rd, 0x33); in rv_rem()
454 return rv_r_insn(1, rs2, rs1, 7, rd, 0x33); in rv_remu()
459 return rv_j_insn(imm20_1, rd, 0x6f); in rv_jal()
464 return rv_i_insn(imm11_0, rs1, 0, rd, 0x67); in rv_jalr()
469 return rv_b_insn(imm12_1, rs2, rs1, 0, 0x63); in rv_beq()
474 return rv_b_insn(imm12_1, rs2, rs1, 1, 0x63); in rv_bne()
479 return rv_b_insn(imm12_1, rs2, rs1, 6, 0x63); in rv_bltu()
489 return rv_b_insn(imm12_1, rs2, rs1, 7, 0x63); in rv_bgeu()
499 return rv_b_insn(imm12_1, rs2, rs1, 4, 0x63); in rv_blt()
509 return rv_b_insn(imm12_1, rs2, rs1, 5, 0x63); in rv_bge()
519 return rv_i_insn(imm11_0, rs1, 0, rd, 0x03); in rv_lb()
524 return rv_i_insn(imm11_0, rs1, 1, rd, 0x03); in rv_lh()
529 return rv_i_insn(imm11_0, rs1, 2, rd, 0x03); in rv_lw()
534 return rv_i_insn(imm11_0, rs1, 4, rd, 0x03); in rv_lbu()
539 return rv_i_insn(imm11_0, rs1, 5, rd, 0x03); in rv_lhu()
544 return rv_s_insn(imm11_0, rs2, rs1, 0, 0x23); in rv_sb()
549 return rv_s_insn(imm11_0, rs2, rs1, 1, 0x23); in rv_sh()
554 return rv_s_insn(imm11_0, rs2, rs1, 2, 0x23); in rv_sw()
559 return rv_amo_insn(0, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoadd_w()
564 return rv_amo_insn(0xc, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoand_w()
569 return rv_amo_insn(0x8, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoor_w()
574 return rv_amo_insn(0x4, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoxor_w()
579 return rv_amo_insn(0x1, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_amoswap_w()
584 return rv_amo_insn(0x2, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_lr_w()
589 return rv_amo_insn(0x3, aq, rl, rs2, rs1, 2, rd, 0x2f); in rv_sc_w()
596 return rv_i_insn(imm11_0, 0, 0, 0, 0xf); in rv_fence()
601 return rv_i_insn(0, 0, 0, 0, 0x13); in rv_nop()
610 imm = ((imm10 & 0x30) << 2) | ((imm10 & 0x3c0) >> 4) | in rvc_addi4spn()
611 ((imm10 & 0x4) >> 1) | ((imm10 & 0x8) >> 3); in rvc_addi4spn()
612 return rv_ciw_insn(0x0, imm, rd, 0x0); in rvc_addi4spn()
619 imm_hi = (imm7 & 0x38) >> 3; in rvc_lw()
620 imm_lo = ((imm7 & 0x4) >> 1) | ((imm7 & 0x40) >> 6); in rvc_lw()
621 return rv_cl_insn(0x2, imm_hi, rs1, imm_lo, rd, 0x0); in rvc_lw()
628 imm_hi = (imm7 & 0x38) >> 3; in rvc_sw()
629 imm_lo = ((imm7 & 0x4) >> 1) | ((imm7 & 0x40) >> 6); in rvc_sw()
630 return rv_cs_insn(0x6, imm_hi, rs1, imm_lo, rs2, 0x0); in rvc_sw()
635 return rv_ci_insn(0, imm6, rd, 0x1); in rvc_addi()
640 return rv_ci_insn(0x2, imm6, rd, 0x1); in rvc_li()
647 imm = ((imm10 & 0x200) >> 4) | (imm10 & 0x10) | ((imm10 & 0x40) >> 3) | in rvc_addi16sp()
648 ((imm10 & 0x180) >> 6) | ((imm10 & 0x20) >> 5); in rvc_addi16sp()
649 return rv_ci_insn(0x3, imm, RV_REG_SP, 0x1); in rvc_addi16sp()
654 return rv_ci_insn(0x3, imm6, rd, 0x1); in rvc_lui()
659 return rv_cb_insn(0x4, imm6, 0, rd, 0x1); in rvc_srli()
664 return rv_cb_insn(0x4, imm6, 0x1, rd, 0x1); in rvc_srai()
669 return rv_cb_insn(0x4, imm6, 0x2, rd, 0x1); in rvc_andi()
674 return rv_ca_insn(0x23, rd, 0, rs, 0x1); in rvc_sub()
679 return rv_ca_insn(0x23, rd, 0x1, rs, 0x1); in rvc_xor()
684 return rv_ca_insn(0x23, rd, 0x2, rs, 0x1); in rvc_or()
689 return rv_ca_insn(0x23, rd, 0x3, rs, 0x1); in rvc_and()
694 return rv_ci_insn(0, imm6, rd, 0x2); in rvc_slli()
701 imm = ((imm8 & 0xc0) >> 6) | (imm8 & 0x3c); in rvc_lwsp()
702 return rv_ci_insn(0x2, imm, rd, 0x2); in rvc_lwsp()
707 return rv_cr_insn(0x8, rs1, RV_REG_ZERO, 0x2); in rvc_jr()
712 return rv_cr_insn(0x8, rd, rs, 0x2); in rvc_mv()
717 return rv_cr_insn(0x9, rs1, RV_REG_ZERO, 0x2); in rvc_jalr()
722 return rv_cr_insn(0x9, rd, rs, 0x2); in rvc_add()
729 imm = (imm8 & 0x3c) | ((imm8 & 0xc0) >> 6); in rvc_swsp()
730 return rv_css_insn(0x6, imm, rs2, 0x2); in rvc_swsp()
744 return rv_i_insn(imm11_0, rs1, 0, rd, 0x1b); in rv_addiw()
749 return rv_i_insn(imm11_0, rs1, 1, rd, 0x1b); in rv_slliw()
754 return rv_i_insn(imm11_0, rs1, 5, rd, 0x1b); in rv_srliw()
759 return rv_i_insn(0x400 | imm11_0, rs1, 5, rd, 0x1b); in rv_sraiw()
764 return rv_r_insn(0, rs2, rs1, 0, rd, 0x3b); in rv_addw()
769 return rv_r_insn(0x20, rs2, rs1, 0, rd, 0x3b); in rv_subw()
774 return rv_r_insn(0, rs2, rs1, 1, rd, 0x3b); in rv_sllw()
779 return rv_r_insn(0, rs2, rs1, 5, rd, 0x3b); in rv_srlw()
784 return rv_r_insn(0x20, rs2, rs1, 5, rd, 0x3b); in rv_sraw()
789 return rv_r_insn(1, rs2, rs1, 0, rd, 0x3b); in rv_mulw()
794 return rv_r_insn(1, rs2, rs1, 4, rd, 0x3b); in rv_divw()
799 return rv_r_insn(1, rs2, rs1, 5, rd, 0x3b); in rv_divuw()
804 return rv_r_insn(1, rs2, rs1, 6, rd, 0x3b); in rv_remw()
809 return rv_r_insn(1, rs2, rs1, 7, rd, 0x3b); in rv_remuw()
814 return rv_i_insn(imm11_0, rs1, 3, rd, 0x03); in rv_ld()
819 return rv_i_insn(imm11_0, rs1, 6, rd, 0x03); in rv_lwu()
824 return rv_s_insn(imm11_0, rs2, rs1, 3, 0x23); in rv_sd()
829 return rv_amo_insn(0, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoadd_d()
834 return rv_amo_insn(0xc, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoand_d()
839 return rv_amo_insn(0x8, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoor_d()
844 return rv_amo_insn(0x4, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoxor_d()
849 return rv_amo_insn(0x1, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_amoswap_d()
854 return rv_amo_insn(0x2, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_lr_d()
859 return rv_amo_insn(0x3, aq, rl, rs2, rs1, 3, rd, 0x2f); in rv_sc_d()
868 imm_hi = (imm8 & 0x38) >> 3; in rvc_ld()
869 imm_lo = (imm8 & 0xc0) >> 6; in rvc_ld()
870 return rv_cl_insn(0x3, imm_hi, rs1, imm_lo, rd, 0x0); in rvc_ld()
877 imm_hi = (imm8 & 0x38) >> 3; in rvc_sd()
878 imm_lo = (imm8 & 0xc0) >> 6; in rvc_sd()
879 return rv_cs_insn(0x7, imm_hi, rs1, imm_lo, rs2, 0x0); in rvc_sd()
884 return rv_ca_insn(0x27, rd, 0, rs, 0x1); in rvc_subw()
889 return rv_ci_insn(0x1, imm6, rd, 0x1); in rvc_addiw()
896 imm = ((imm9 & 0x1c0) >> 6) | (imm9 & 0x38); in rvc_ldsp()
897 return rv_ci_insn(0x3, imm, rd, 0x2); in rvc_ldsp()
904 imm = (imm9 & 0x38) | ((imm9 & 0x1c0) >> 6); in rvc_sdsp()
905 return rv_css_insn(0x7, imm, rs2, 0x2); in rvc_sdsp()
927 emit(rv_addi(rd, rs, 0), ctx); in emit_mv()
940 if (rvc_enabled() && rd == RV_REG_SP && rd == rs && is_10b_int(imm) && imm && !(imm & 0xf)) in emit_addi()
943 !(imm & 0x3) && imm) in emit_addi()
1033 if (rvc_enabled() && rs1 == RV_REG_SP && rd && is_8b_uint(off) && !(off & 0x3)) in emit_lw()
1035 else if (rvc_enabled() && is_creg(rd) && is_creg(rs1) && is_7b_uint(off) && !(off & 0x3)) in emit_lw()
1043 if (rvc_enabled() && rs1 == RV_REG_SP && is_8b_uint(off) && !(off & 0x3)) in emit_sw()
1045 else if (rvc_enabled() && is_creg(rs1) && is_creg(rs2) && is_7b_uint(off) && !(off & 0x3)) in emit_sw()
1064 if (rvc_enabled() && rs1 == RV_REG_SP && rd && is_9b_uint(off) && !(off & 0x7)) in emit_ld()
1066 else if (rvc_enabled() && is_creg(rd) && is_creg(rs1) && is_8b_uint(off) && !(off & 0x7)) in emit_ld()
1074 if (rvc_enabled() && rs1 == RV_REG_SP && is_9b_uint(off) && !(off & 0x7)) in emit_sd()
1076 else if (rvc_enabled() && is_creg(rs1) && is_creg(rs2) && is_8b_uint(off) && !(off & 0x7)) in emit_sd()