#undef require_fp
#define require_fp
+#include "cvt16.h"
+
+#define HFRS1 cvt_hs(FRS1)
+#define HFRS2 cvt_hs(FRS2)
+#define HFRS3 cvt_hs(FRS3)
+
+#define WRITE_HFRD(value) write_frd(h, insn, UTIDX, cvt_sh(value, RM))
+
+#define sext16(x) ((sreg_t)(int16_t)(x))
+
#endif
+++ /dev/null
-#ifndef _DECODE_HWACHA_UT_HALF_H
-#define _DECODE_HWACHA_UT_HALF_H
-
-#include "decode_hwacha_ut.h"
-#include "cvt16.h"
-
-#define HFRS1 cvt_hs(FRS1)
-#define HFRS2 cvt_hs(FRS2)
-#define HFRS3 cvt_hs(FRS3)
-
-#define WRITE_HFRD(value) write_frd(h, insn, UTIDX, cvt_sh(value, RM))
-
-#define sext16(x) ((sreg_t)(int16_t)(x))
-
-#endif
--- /dev/null
+#ifndef ENCODINGS_HWACHA
+#define ENCODINGS_HWACHA
+
+#define MATCH_FCVT_H_LU 0x6c000053
+#define MASK_FCVT_H_LU 0xfff0007f
+#define MATCH_FMIN_H 0xc4000053
+#define MASK_FMIN_H 0xfe00707f
+#define MATCH_FCVT_WU_H 0x5c000053
+#define MASK_FCVT_WU_H 0xfff0007f
+#define MATCH_FDIV_H 0x1c000053
+#define MASK_FDIV_H 0xfe00007f
+#define MATCH_FCVT_H_WU 0x7c000053
+#define MASK_FCVT_H_WU 0xfff0007f
+#define MATCH_FSGNJ_H 0x2c000053
+#define MASK_FSGNJ_H 0xfe00707f
+#define MATCH_FNMSUB_H 0x400004b
+#define MASK_FNMSUB_H 0x600007f
+#define MATCH_FLE_H 0xbc000053
+#define MASK_FLE_H 0xfe00707f
+#define MATCH_FCVT_L_H 0x44000053
+#define MASK_FCVT_L_H 0xfff0007f
+#define MATCH_FNMADD_H 0x400004f
+#define MASK_FNMADD_H 0x600007f
+#define MATCH_FCVT_H_S 0x90000053
+#define MASK_FCVT_H_S 0xfff0007f
+#define MATCH_FCVT_H_W 0x74000053
+#define MASK_FCVT_H_W 0xfff0007f
+#define MATCH_FCVT_D_H 0x8c000053
+#define MASK_FCVT_D_H 0xfff0007f
+#define MATCH_FMAX_H 0xcc000053
+#define MASK_FMAX_H 0xfe00707f
+#define MATCH_FCVT_LU_H 0x4c000053
+#define MASK_FCVT_LU_H 0xfff0007f
+#define MATCH_FCVT_H_L 0x64000053
+#define MASK_FCVT_H_L 0xfff0007f
+#define MATCH_FMV_X_H 0xe4000053
+#define MASK_FMV_X_H 0xfff0707f
+#define MATCH_FCVT_H_D 0x92000053
+#define MASK_FCVT_H_D 0xfff0007f
+#define MATCH_FLT_H 0xb4000053
+#define MASK_FLT_H 0xfe00707f
+#define MATCH_FADD_H 0x4000053
+#define MASK_FADD_H 0xfe00007f
+#define MATCH_FCVT_S_H 0x84000053
+#define MASK_FCVT_S_H 0xfff0007f
+#define MATCH_FCVT_W_H 0x54000053
+#define MASK_FCVT_W_H 0xfff0007f
+#define MATCH_FMUL_H 0x14000053
+#define MASK_FMUL_H 0xfe00007f
+#define MATCH_FMADD_H 0x4000043
+#define MASK_FMADD_H 0x600007f
+#define MATCH_FSQRT_H 0x24000053
+#define MASK_FSQRT_H 0xfff0007f
+#define MATCH_FSGNJN_H 0x34000053
+#define MASK_FSGNJN_H 0xfe00707f
+#define MATCH_FSUB_H 0xc000053
+#define MASK_FSUB_H 0xfe00007f
+#define MATCH_FSH 0x1027
+#define MASK_FSH 0x707f
+#define MATCH_FSGNJX_H 0x3c000053
+#define MASK_FSGNJX_H 0xfe00707f
+#define MATCH_FLH 0x1007
+#define MASK_FLH 0x707f
+#define MATCH_FMSUB_H 0x4000047
+#define MASK_FMSUB_H 0x600007f
+#define MATCH_FEQ_H 0xac000053
+#define MASK_FEQ_H 0xfe00707f
+#define MATCH_FMV_H_X 0xf4000053
+#define MASK_FMV_H_X 0xfff0707f
+
+#define MASK_VF 0x1f0707f
+#define MASK_VFLSEGD 0x1ff0707f
+#define MASK_VFLSEGSTD 0x1e00707f
+#define MASK_VFLSEGSTW 0x1e00707f
+#define MASK_VFLSEGW 0x1ff0707f
+#define MASK_VFMSV 0xfff0707f
+#define MASK_VFMVV 0xfff0707f
+#define MASK_VFSSEGD 0x1ff0707f
+#define MASK_VFSSEGSTD 0x1e00707f
+#define MASK_VFSSEGSTW 0x1e00707f
+#define MASK_VFSSEGW 0x1ff0707f
+#define MASK_VGETCFG 0xfffff07f
+#define MASK_VGETVL 0xfffff07f
+#define MASK_VLSEGB 0x1ff0707f
+#define MASK_VLSEGBU 0x1ff0707f
+#define MASK_VLSEGD 0x1ff0707f
+#define MASK_VLSEGH 0x1ff0707f
+#define MASK_VLSEGHU 0x1ff0707f
+#define MASK_VLSEGSTB 0x1e00707f
+#define MASK_VLSEGSTBU 0x1e00707f
+#define MASK_VLSEGSTD 0x1e00707f
+#define MASK_VLSEGSTH 0x1e00707f
+#define MASK_VLSEGSTHU 0x1e00707f
+#define MASK_VLSEGSTW 0x1e00707f
+#define MASK_VLSEGSTWU 0x1e00707f
+#define MASK_VLSEGW 0x1ff0707f
+#define MASK_VLSEGWU 0x1ff0707f
+#define MASK_VMSV 0xfff0707f
+#define MASK_VMVV 0xfff0707f
+#define MASK_VSETCFG 0x7fff
+#define MASK_VSETVL 0xfff0707f
+#define MASK_VSSEGB 0x1ff0707f
+#define MASK_VSSEGD 0x1ff0707f
+#define MASK_VSSEGH 0x1ff0707f
+#define MASK_VSSEGSTB 0x1e00707f
+#define MASK_VSSEGSTD 0x1e00707f
+#define MASK_VSSEGSTH 0x1e00707f
+#define MASK_VSSEGSTW 0x1e00707f
+#define MASK_VSSEGW 0x1ff0707f
+#define MASK_VXCPTAUX 0xfffff07f
+#define MASK_VXCPTCAUSE 0xfffff07f
+#define MASK_VXCPTEVAC 0xfff07fff
+#define MASK_VXCPTHOLD 0xffffffff
+#define MASK_VXCPTKILL 0xffffffff
+#define MASK_VXCPTRESTORE 0xfff07fff
+#define MASK_VXCPTSAVE 0xfff07fff
+
+#define MATCH_VF 0x10202b
+#define MATCH_VFLSEGD 0x1600205b
+#define MATCH_VFLSEGSTD 0x1600305b
+#define MATCH_VFLSEGSTW 0x1400305b
+#define MATCH_VFLSEGW 0x1400205b
+#define MATCH_VFMSV 0x1200202b
+#define MATCH_VFMVV 0x1200002b
+#define MATCH_VFSSEGD 0x1600207b
+#define MATCH_VFSSEGSTD 0x1600307b
+#define MATCH_VFSSEGSTW 0x1400307b
+#define MATCH_VFSSEGW 0x1400207b
+#define MATCH_VGETCFG 0x400b
+#define MATCH_VGETVL 0x200400b
+#define MATCH_VLSEGB 0x205b
+#define MATCH_VLSEGBU 0x800205b
+#define MATCH_VLSEGD 0x600205b
+#define MATCH_VLSEGH 0x200205b
+#define MATCH_VLSEGHU 0xa00205b
+#define MATCH_VLSEGSTB 0x305b
+#define MATCH_VLSEGSTBU 0x800305b
+#define MATCH_VLSEGSTD 0x600305b
+#define MATCH_VLSEGSTH 0x200305b
+#define MATCH_VLSEGSTHU 0xa00305b
+#define MATCH_VLSEGSTW 0x400305b
+#define MATCH_VLSEGSTWU 0xc00305b
+#define MATCH_VLSEGW 0x400205b
+#define MATCH_VLSEGWU 0xc00205b
+#define MATCH_VMSV 0x200202b
+#define MATCH_VMVV 0x200002b
+#define MATCH_VSETCFG 0x200b
+#define MATCH_VSETVL 0x600b
+#define MATCH_VSSEGB 0x207b
+#define MATCH_VSSEGD 0x600207b
+#define MATCH_VSSEGH 0x200207b
+#define MATCH_VSSEGSTB 0x307b
+#define MATCH_VSSEGSTD 0x600307b
+#define MATCH_VSSEGSTH 0x200307b
+#define MATCH_VSSEGSTW 0x400307b
+#define MATCH_VSSEGW 0x400207b
+#define MATCH_VXCPTAUX 0x200402b
+#define MATCH_VXCPTCAUSE 0x402b
+#define MATCH_VXCPTEVAC 0x600302b
+#define MATCH_VXCPTHOLD 0x800302b
+#define MATCH_VXCPTKILL 0x400302b
+#define MATCH_VXCPTRESTORE 0x200302b
+#define MATCH_VXCPTSAVE 0x302b
+
+#endif /* ENCODINGS_HWACHA */
hwacha_xcpt.h \
decode_hwacha.h \
decode_hwacha_ut.h \
- decode_hwacha_ut_half.h \
opcodes_hwacha.h \
opcodes_hwacha_ut.h \
- opcodes_hwacha_ut_half.h \
hwacha_srcs = \
hwacha.cc \
cvt16.cc \
$(hwacha_gen_srcs) \
$(hwacha_ut_gen_srcs) \
- $(hwacha_ut_half_gen_srcs) \
hwacha_test_srcs =
$(hwacha_ut_gen_srcs): %.cc: insns_ut/%.h insn_template_hwacha_ut.cc
sed 's/NAME/$(subst .cc,,$@)/' $(src_dir)/hwacha/insn_template_hwacha_ut.cc | sed 's/OPCODE/$(call get_opcode,$(src_dir)/hwacha/opcodes_hwacha_ut.h,$(subst .cc,,$@))/' > $@
-hwacha_ut_half_gen_srcs = \
- $(addsuffix .cc, $(call get_insn_list,$(src_dir)/hwacha/opcodes_hwacha_ut_half.h))
-
-$(hwacha_ut_half_gen_srcs): %.cc: insns_ut_half/%.h insn_template_hwacha_ut_half.cc
- sed 's/NAME/$(subst .cc,,$@)/' $(src_dir)/hwacha/insn_template_hwacha_ut_half.cc | sed 's/OPCODE/$(call get_opcode,$(src_dir)/hwacha/opcodes_hwacha_ut_half.h,$(subst .cc,,$@))/' > $@
DISASM_INSN("vmvv", vmvv, 0, {&vxrd, &vxrs1});
DISASM_INSN("vmsv", vmsv, 0, {&vxrd, &xrs1});
+ DISASM_INSN("vfmvv", vfmvv, 0, {&vfrd, &vfrs1});
+ DISASM_INSN("vfmsv", vfmsv, 0, {&vfrd, &xrs1});
DISASM_INSN("vf", vf, 0, {&vf_addr});
DISASM_INSN("vxcptcause", vxcptcause, 0, {&xrd});
#include "mmu.h"
#include "hwacha.h"
#include "decode_hwacha.h"
+#include "encodings_hwacha.h"
#include "rocc.h"
#include <assert.h>
+++ /dev/null
-// See LICENSE for license details.
-
-#include "config.h"
-#include "processor.h"
-#include "mmu.h"
-#include "softfloat.h"
-#include "platform.h" // softfloat isNaNF32UI, etc.
-#include "internals.h" // ditto
-#include "hwacha.h"
-#include "decode_hwacha_ut_half.h"
-#include "cvt16.h"
-#include <assert.h>
-
-reg_t hwacha_NAME(processor_t* p, insn_t insn, reg_t pc)
-{
- int xprlen = 64;
- reg_t npc = sext_xprlen(pc + insn_length(OPCODE));
- hwacha_t* h = static_cast<hwacha_t*>(p->get_extension());
- do {
- #include "insns_ut_half/NAME.h"
- WRITE_UTIDX(UTIDX+1);
- } while (UTIDX < VL);
- WRITE_UTIDX(0);
- return npc;
-}
matched = true; \
}
#include "opcodes_hwacha_ut.h"
- #include "opcodes_hwacha_ut_half.h"
#undef DECLARE_INSN
if (!matched)
--- /dev/null
+for (uint32_t i=0; i<VL; i++) {
+ UT_WRITE_FRD(i, XS1);
+}
--- /dev/null
+for (uint32_t i=0; i<VL; i++) {
+ UT_WRITE_FRD(i, UT_FRS1(i));
+}
+++ /dev/null
-uint32_t prec = u.r.funct;
-switch (prec) {
- case 16:
- case 32:
- case 64:
- WRITE_PREC(prec);
- break;
-
- default:
- h->take_exception(HWACHA_CAUSE_ILLEGAL_CFG, 2);
- break;
-}
--- /dev/null
+WRITE_RD(insn.u_imm());
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f32_mulAdd(HFRS1, 0x3f800000, HFRS2));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_FRD(f32_to_f64(HFRS1));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f64_to_f32(FRS1));
+set_fp_exceptions;
--- /dev/null
+require_xpr64;
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(i64_to_f32(RS1));
+set_fp_exceptions;
--- /dev/null
+require_xpr64;
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(ui64_to_f32(RS1));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+WRITE_FRD(cvt_sh(FRS1, RM));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(i32_to_f32((int32_t)RS1));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(ui32_to_f32((uint32_t)RS1));
+set_fp_exceptions;
--- /dev/null
+require_xpr64;
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_RD(f32_to_i64(HFRS1, RM, true));
+set_fp_exceptions;
--- /dev/null
+require_xpr64;
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_RD(f32_to_ui64(HFRS1, RM, true));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+WRITE_FRD(HFRS1);
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_RD(sext32(f32_to_i32(HFRS1, RM, true)));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_RD(sext32(f32_to_ui32(HFRS1, RM, true)));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f32_div(HFRS1, HFRS2));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+WRITE_RD(f32_eq(HFRS1, HFRS2));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+WRITE_RD(f32_le(HFRS1, HFRS2));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+WRITE_FRD(MMU.load_int16(RS1 + insn.i_imm()));
--- /dev/null
+require_fp;
+WRITE_RD(f32_lt(HFRS1, HFRS2));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f32_mulAdd(HFRS1, HFRS2, HFRS3));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+WRITE_HFRD(isNaNF32UI(HFRS2) || f32_le_quiet(HFRS2,HFRS1) /* && FRS1 not NaN */
+ ? HFRS1 : HFRS2);
+set_fp_exceptions;
--- /dev/null
+require_fp;
+WRITE_HFRD(isNaNF32UI(HFRS2) || f32_lt_quiet(HFRS1,HFRS2) /* && FRS1 not NaN */
+ ? HFRS1 : HFRS2);
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f32_mulAdd(HFRS1, HFRS2, HFRS3 ^ (uint32_t)INT32_MIN));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f32_mulAdd(HFRS1, HFRS2, (HFRS1 ^ HFRS2) & (uint32_t)INT32_MIN));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+WRITE_FRD(RS1);
--- /dev/null
+require_fp;
+WRITE_RD(sext16(FRS1));
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f32_mulAdd(HFRS1 ^ (uint32_t)INT32_MIN, HFRS2, HFRS3 ^ (uint32_t)INT32_MIN));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f32_mulAdd(HFRS1 ^ (uint32_t)INT32_MIN, HFRS2, HFRS3));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+WRITE_FRD((FRS1 &~ (uint16_t)INT16_MIN) | (FRS2 & (uint16_t)INT16_MIN));
--- /dev/null
+require_fp;
+WRITE_FRD((FRS1 &~ (uint32_t)INT32_MIN) | ((~FRS2) & (uint32_t)INT32_MIN));
--- /dev/null
+require_fp;
+WRITE_FRD(FRS1 ^ (FRS2 & (uint16_t)INT16_MIN));
--- /dev/null
+require_fp;
+MMU.store_uint16(RS1 + insn.s_imm(), FRS2);
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f32_sqrt(HFRS1));
+set_fp_exceptions;
--- /dev/null
+require_fp;
+softfloat_roundingMode = RM;
+WRITE_HFRD(f32_mulAdd(HFRS1, 0x3f800000, HFRS2 ^ (uint32_t)INT32_MIN));
+set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f32_mulAdd(HFRS1, 0x3f800000, HFRS2));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_FRD(f32_to_f64(HFRS1));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f64_to_f32(FRS1));
-set_fp_exceptions;
+++ /dev/null
-require_xpr64;
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(i64_to_f32(RS1));
-set_fp_exceptions;
+++ /dev/null
-require_xpr64;
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(ui64_to_f32(RS1));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-WRITE_FRD(cvt_sh(FRS1, RM));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(i32_to_f32((int32_t)RS1));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(ui32_to_f32((uint32_t)RS1));
-set_fp_exceptions;
+++ /dev/null
-require_xpr64;
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_RD(f32_to_i64(HFRS1, RM, true));
-set_fp_exceptions;
+++ /dev/null
-require_xpr64;
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_RD(f32_to_ui64(HFRS1, RM, true));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-WRITE_FRD(HFRS1);
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_RD(sext32(f32_to_i32(HFRS1, RM, true)));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_RD(sext32(f32_to_ui32(HFRS1, RM, true)));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f32_div(HFRS1, HFRS2));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-WRITE_RD(f32_eq(HFRS1, HFRS2));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-WRITE_RD(f32_le(HFRS1, HFRS2));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-WRITE_FRD(MMU.load_int16(RS1 + insn.i_imm()));
+++ /dev/null
-require_fp;
-WRITE_RD(f32_lt(HFRS1, HFRS2));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f32_mulAdd(HFRS1, HFRS2, HFRS3));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-WRITE_HFRD(isNaNF32UI(HFRS2) || f32_le_quiet(HFRS2,HFRS1) /* && FRS1 not NaN */
- ? HFRS1 : HFRS2);
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-WRITE_HFRD(isNaNF32UI(HFRS2) || f32_lt_quiet(HFRS1,HFRS2) /* && FRS1 not NaN */
- ? HFRS1 : HFRS2);
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f32_mulAdd(HFRS1, HFRS2, HFRS3 ^ (uint32_t)INT32_MIN));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f32_mulAdd(HFRS1, HFRS2, (HFRS1 ^ HFRS2) & (uint32_t)INT32_MIN));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-WRITE_FRD(RS1);
+++ /dev/null
-require_fp;
-WRITE_RD(sext16(FRS1));
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f32_mulAdd(HFRS1 ^ (uint32_t)INT32_MIN, HFRS2, HFRS3 ^ (uint32_t)INT32_MIN));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f32_mulAdd(HFRS1 ^ (uint32_t)INT32_MIN, HFRS2, HFRS3));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-WRITE_FRD((FRS1 &~ (uint16_t)INT16_MIN) | (FRS2 & (uint16_t)INT16_MIN));
+++ /dev/null
-require_fp;
-WRITE_FRD((FRS1 &~ (uint32_t)INT32_MIN) | ((~FRS2) & (uint32_t)INT32_MIN));
+++ /dev/null
-require_fp;
-WRITE_FRD(FRS1 ^ (FRS2 & (uint16_t)INT16_MIN));
+++ /dev/null
-require_fp;
-MMU.store_uint16(RS1 + insn.s_imm(), FRS2);
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f32_sqrt(HFRS1));
-set_fp_exceptions;
+++ /dev/null
-require_fp;
-softfloat_roundingMode = RM;
-WRITE_HFRD(f32_mulAdd(HFRS1, 0x3f800000, HFRS2 ^ (uint32_t)INT32_MIN));
-set_fp_exceptions;
-DECLARE_INSN(vf, 0x10202b, 0x1f0707f)
-DECLARE_INSN(vflsegd, 0x1600205b, 0x1ff0707f)
-DECLARE_INSN(vflsegstd, 0x1600305b, 0x1e00707f)
-DECLARE_INSN(vflsegstw, 0x1400305b, 0x1e00707f)
-DECLARE_INSN(vflsegw, 0x1400205b, 0x1ff0707f)
-DECLARE_INSN(vfssegd, 0x1600207b, 0x1ff0707f)
-DECLARE_INSN(vfssegstd, 0x1600307b, 0x1e00707f)
-DECLARE_INSN(vfssegstw, 0x1400307b, 0x1e00707f)
-DECLARE_INSN(vfssegw, 0x1400207b, 0x1ff0707f)
-DECLARE_INSN(vgetcfg, 0x400b, 0xfffff07f)
-DECLARE_INSN(vgetvl, 0x200400b, 0xfffff07f)
-DECLARE_INSN(vlsegb, 0x205b, 0x1ff0707f)
-DECLARE_INSN(vlsegbu, 0x800205b, 0x1ff0707f)
-DECLARE_INSN(vlsegd, 0x600205b, 0x1ff0707f)
-DECLARE_INSN(vlsegh, 0x200205b, 0x1ff0707f)
-DECLARE_INSN(vlseghu, 0xa00205b, 0x1ff0707f)
-DECLARE_INSN(vlsegstb, 0x305b, 0x1e00707f)
-DECLARE_INSN(vlsegstbu, 0x800305b, 0x1e00707f)
-DECLARE_INSN(vlsegstd, 0x600305b, 0x1e00707f)
-DECLARE_INSN(vlsegsth, 0x200305b, 0x1e00707f)
-DECLARE_INSN(vlsegsthu, 0xa00305b, 0x1e00707f)
-DECLARE_INSN(vlsegstw, 0x400305b, 0x1e00707f)
-DECLARE_INSN(vlsegstwu, 0xc00305b, 0x1e00707f)
-DECLARE_INSN(vlsegw, 0x400205b, 0x1ff0707f)
-DECLARE_INSN(vlsegwu, 0xc00205b, 0x1ff0707f)
-DECLARE_INSN(vmsv, 0x200202b, 0xfff0707f)
-DECLARE_INSN(vmvv, 0x200002b, 0xfff0707f)
-DECLARE_INSN(vsetcfg, 0x200b, 0x7fff)
-DECLARE_INSN(vsetprec, 0x805b, 0xfffff)
-DECLARE_INSN(vsetvl, 0x600b, 0xfff0707f)
-DECLARE_INSN(vssegb, 0x207b, 0x1ff0707f)
-DECLARE_INSN(vssegd, 0x600207b, 0x1ff0707f)
-DECLARE_INSN(vssegh, 0x200207b, 0x1ff0707f)
-DECLARE_INSN(vssegstb, 0x307b, 0x1e00707f)
-DECLARE_INSN(vssegstd, 0x600307b, 0x1e00707f)
-DECLARE_INSN(vssegsth, 0x200307b, 0x1e00707f)
-DECLARE_INSN(vssegstw, 0x400307b, 0x1e00707f)
-DECLARE_INSN(vssegw, 0x400207b, 0x1ff0707f)
-DECLARE_INSN(vxcptaux, 0x200402b, 0xfffff07f)
-DECLARE_INSN(vxcptcause, 0x402b, 0xfffff07f)
-DECLARE_INSN(vxcptkill, 0x400302b, 0xffffffff)
-DECLARE_INSN(vxcptrestore, 0x200302b, 0xfff07fff)
-DECLARE_INSN(vxcptsave, 0x302b, 0xfff07fff)
+#include "encodings_hwacha.h"
+
+DECLARE_INSN(vf, MATCH_VF, MASK_VF)
+DECLARE_INSN(vflsegd, MATCH_VFLSEGD, MASK_VFLSEGD)
+DECLARE_INSN(vflsegstd, MATCH_VFLSEGSTD, MASK_VFLSEGSTD)
+DECLARE_INSN(vflsegstw, MATCH_VFLSEGSTW, MASK_VFLSEGSTW)
+DECLARE_INSN(vflsegw, MATCH_VFLSEGW, MASK_VFLSEGW)
+DECLARE_INSN(vfmsv, MATCH_VFMSV, MASK_VFMSV)
+DECLARE_INSN(vfmvv, MATCH_VFMVV, MASK_VFMVV)
+DECLARE_INSN(vfssegd, MATCH_VFSSEGD, MASK_VFSSEGD)
+DECLARE_INSN(vfssegstd, MATCH_VFSSEGSTD, MASK_VFSSEGSTD)
+DECLARE_INSN(vfssegstw, MATCH_VFSSEGSTW, MASK_VFSSEGSTW)
+DECLARE_INSN(vfssegw, MATCH_VFSSEGW, MASK_VFSSEGW)
+DECLARE_INSN(vgetcfg, MATCH_VGETCFG, MASK_VGETCFG)
+DECLARE_INSN(vgetvl, MATCH_VGETVL, MASK_VGETVL)
+DECLARE_INSN(vlsegb, MATCH_VLSEGB, MASK_VLSEGB)
+DECLARE_INSN(vlsegbu, MATCH_VLSEGBU, MASK_VLSEGBU)
+DECLARE_INSN(vlsegd, MATCH_VLSEGD, MASK_VLSEGD)
+DECLARE_INSN(vlsegh, MATCH_VLSEGH, MASK_VLSEGH)
+DECLARE_INSN(vlseghu, MATCH_VLSEGHU, MASK_VLSEGHU)
+DECLARE_INSN(vlsegstb, MATCH_VLSEGSTB, MASK_VLSEGSTB)
+DECLARE_INSN(vlsegstbu, MATCH_VLSEGSTBU, MASK_VLSEGSTBU)
+DECLARE_INSN(vlsegstd, MATCH_VLSEGSTD, MASK_VLSEGSTD)
+DECLARE_INSN(vlsegsth, MATCH_VLSEGSTH, MASK_VLSEGSTH)
+DECLARE_INSN(vlsegsthu, MATCH_VLSEGSTHU, MASK_VLSEGSTHU)
+DECLARE_INSN(vlsegstw, MATCH_VLSEGSTW, MASK_VLSEGSTW)
+DECLARE_INSN(vlsegstwu, MATCH_VLSEGSTWU, MASK_VLSEGSTWU)
+DECLARE_INSN(vlsegw, MATCH_VLSEGW, MASK_VLSEGW)
+DECLARE_INSN(vlsegwu, MATCH_VLSEGWU, MASK_VLSEGWU)
+DECLARE_INSN(vmsv, MATCH_VMSV, MASK_VMSV)
+DECLARE_INSN(vmvv, MATCH_VMVV, MASK_VMVV)
+DECLARE_INSN(vsetcfg, MATCH_VSETCFG, MASK_VSETCFG)
+DECLARE_INSN(vsetvl, MATCH_VSETVL, MASK_VSETVL)
+DECLARE_INSN(vssegb, MATCH_VSSEGB, MASK_VSSEGB)
+DECLARE_INSN(vssegd, MATCH_VSSEGD, MASK_VSSEGD)
+DECLARE_INSN(vssegh, MATCH_VSSEGH, MASK_VSSEGH)
+DECLARE_INSN(vssegstb, MATCH_VSSEGSTB, MASK_VSSEGSTB)
+DECLARE_INSN(vssegstd, MATCH_VSSEGSTD, MASK_VSSEGSTD)
+DECLARE_INSN(vssegsth, MATCH_VSSEGSTH, MASK_VSSEGSTH)
+DECLARE_INSN(vssegstw, MATCH_VSSEGSTW, MASK_VSSEGSTW)
+DECLARE_INSN(vssegw, MATCH_VSSEGW, MASK_VSSEGW)
+DECLARE_INSN(vxcptaux, MATCH_VXCPTAUX, MASK_VXCPTAUX)
+DECLARE_INSN(vxcptcause, MATCH_VXCPTCAUSE, MASK_VXCPTCAUSE)
+DECLARE_INSN(vxcptkill, MATCH_VXCPTKILL, MASK_VXCPTKILL)
+DECLARE_INSN(vxcptrestore, MATCH_VXCPTRESTORE, MASK_VXCPTRESTORE)
+DECLARE_INSN(vxcptsave, MATCH_VXCPTSAVE, MASK_VXCPTSAVE)
DECLARE_INSN(ut_sb, 0x23, 0x707f)
DECLARE_INSN(ut_fmsub_d, 0x2000047, 0x600007f)
DECLARE_INSN(ut_sd, 0x3023, 0x707f)
+
+DECLARE_INSN(ut_fcvt_h_lu, 0x6c000053, 0xfff0007f)
+DECLARE_INSN(ut_fmin_h, 0xc4000053, 0xfe00707f)
+DECLARE_INSN(ut_fcvt_wu_h, 0x5c000053, 0xfff0007f)
+DECLARE_INSN(ut_fdiv_h, 0x1c000053, 0xfe00007f)
+DECLARE_INSN(ut_fcvt_h_wu, 0x7c000053, 0xfff0007f)
+DECLARE_INSN(ut_fsgnj_h, 0x2c000053, 0xfe00707f)
+DECLARE_INSN(ut_fnmsub_h, 0x400004b, 0x600007f)
+DECLARE_INSN(ut_fle_h, 0xbc000053, 0xfe00707f)
+DECLARE_INSN(ut_fcvt_l_h, 0x44000053, 0xfff0007f)
+DECLARE_INSN(ut_fnmadd_h, 0x400004f, 0x600007f)
+DECLARE_INSN(ut_fcvt_h_s, 0x90000053, 0xfff0007f)
+DECLARE_INSN(ut_fcvt_h_w, 0x74000053, 0xfff0007f)
+DECLARE_INSN(ut_fcvt_d_h, 0x8c000053, 0xfff0007f)
+DECLARE_INSN(ut_fmax_h, 0xcc000053, 0xfe00707f)
+DECLARE_INSN(ut_fcvt_lu_h, 0x4c000053, 0xfff0007f)
+DECLARE_INSN(ut_fcvt_h_l, 0x64000053, 0xfff0007f)
+DECLARE_INSN(ut_fmv_x_h, 0xe4000053, 0xfff0707f)
+DECLARE_INSN(ut_fcvt_h_d, 0x92000053, 0xfff0007f)
+DECLARE_INSN(ut_flt_h, 0xb4000053, 0xfe00707f)
+DECLARE_INSN(ut_fadd_h, 0x4000053, 0xfe00007f)
+DECLARE_INSN(ut_fcvt_s_h, 0x84000053, 0xfff0007f)
+DECLARE_INSN(ut_fcvt_w_h, 0x54000053, 0xfff0007f)
+DECLARE_INSN(ut_fmul_h, 0x14000053, 0xfe00007f)
+DECLARE_INSN(ut_fmadd_h, 0x4000043, 0x600007f)
+DECLARE_INSN(ut_fsqrt_h, 0x24000053, 0xfff0007f)
+DECLARE_INSN(ut_fsgnjn_h, 0x34000053, 0xfe00707f)
+DECLARE_INSN(ut_fsub_h, 0xc000053, 0xfe00007f)
+DECLARE_INSN(ut_fsh, 0x1027, 0x707f)
+DECLARE_INSN(ut_fsgnjx_h, 0x3c000053, 0xfe00707f)
+DECLARE_INSN(ut_flh, 0x1007, 0x707f)
+DECLARE_INSN(ut_fmsub_h, 0x4000047, 0x600007f)
+DECLARE_INSN(ut_feq_h, 0xac000053, 0xfe00707f)
+DECLARE_INSN(ut_fmv_h_x, 0xf4000053, 0xfff0707f)
+++ /dev/null
-DECLARE_INSN(ut_fcvt_h_lu, 0x6c000053, 0xfff0007f)
-DECLARE_INSN(ut_fmin_h, 0xc4000053, 0xfe00707f)
-DECLARE_INSN(ut_fcvt_wu_h, 0x5c000053, 0xfff0007f)
-DECLARE_INSN(ut_fdiv_h, 0x1c000053, 0xfe00007f)
-DECLARE_INSN(ut_fcvt_h_wu, 0x7c000053, 0xfff0007f)
-DECLARE_INSN(ut_fsgnj_h, 0x2c000053, 0xfe00707f)
-DECLARE_INSN(ut_fnmsub_h, 0x400004b, 0x600007f)
-DECLARE_INSN(ut_fle_h, 0xbc000053, 0xfe00707f)
-DECLARE_INSN(ut_fcvt_l_h, 0x44000053, 0xfff0007f)
-DECLARE_INSN(ut_fnmadd_h, 0x400004f, 0x600007f)
-DECLARE_INSN(ut_fcvt_h_s, 0x90000053, 0xfff0007f)
-DECLARE_INSN(ut_fcvt_h_w, 0x74000053, 0xfff0007f)
-DECLARE_INSN(ut_fcvt_d_h, 0x8c000053, 0xfff0007f)
-DECLARE_INSN(ut_fmax_h, 0xcc000053, 0xfe00707f)
-DECLARE_INSN(ut_fcvt_lu_h, 0x4c000053, 0xfff0007f)
-DECLARE_INSN(ut_fcvt_h_l, 0x64000053, 0xfff0007f)
-DECLARE_INSN(ut_fmv_x_h, 0xe4000053, 0xfff0707f)
-DECLARE_INSN(ut_fcvt_h_d, 0x92000053, 0xfff0007f)
-DECLARE_INSN(ut_flt_h, 0xb4000053, 0xfe00707f)
-DECLARE_INSN(ut_fadd_h, 0x4000053, 0xfe00007f)
-DECLARE_INSN(ut_fcvt_s_h, 0x84000053, 0xfff0007f)
-DECLARE_INSN(ut_fcvt_w_h, 0x54000053, 0xfff0007f)
-DECLARE_INSN(ut_fmul_h, 0x14000053, 0xfe00007f)
-DECLARE_INSN(ut_fmadd_h, 0x4000043, 0x600007f)
-DECLARE_INSN(ut_fsqrt_h, 0x24000053, 0xfff0007f)
-DECLARE_INSN(ut_fsgnjn_h, 0x34000053, 0xfe00707f)
-DECLARE_INSN(ut_fsub_h, 0xc000053, 0xfe00007f)
-DECLARE_INSN(ut_fsh, 0x1027, 0x707f)
-DECLARE_INSN(ut_fsgnjx_h, 0x3c000053, 0xfe00707f)
-DECLARE_INSN(ut_flh, 0x1007, 0x707f)
-DECLARE_INSN(ut_fmsub_h, 0x4000047, 0x600007f)
-DECLARE_INSN(ut_feq_h, 0xac000053, 0xfe00707f)
-DECLARE_INSN(ut_fmv_h_x, 0xf4000053, 0xfff0707f)