li x1, SV_REG_CSR( type, regkey, elwidth, regidx, isvec, packed ); \
csrrw x0, 0x4c0, x1
+#define SET_SV_PRED_CSR( type, regkey, zero, inv, regidx, active ) \
+ li x1, SV_PRED_CSR( type, regkey, zero, inv, regidx, active ); \
+ csrrw x0, 0x4c8, x1
+
+#define SET_SV_2CSRS( c1, c2 ) \
+ li x1, c1 | ((c2)<<16); \
+ csrrw x0, 0x4c0, x1
+
#define CLR_SV_CSRS( ) csrrw x0, 0x4c0, 0
+#define CLR_SV_PRED_CSRS( ) csrrw x0, 0x4c8, 0
#define SET_SV_MVL( val ) csrrwi x0, 0x4f2, val
#define SET_SV_VL( val ) csrrwi x0, 0x4f0, val
la x1, from; \
lw reg, offs(x1)
+#define SV_FLD_DATA( reg, from, offs ) \
+ la x1, from; \
+ fld reg, offs(x1)
+
#define TEST_SV_IMM( reg, imm ) \
li x1, imm; \
bne reg, x1, fail
+
+#define TEST_SV_FD( flags, freg, from, offs ) \
+ fsflags x2, x0; \
+ li x1, flags; \
+ bne x2, x1, fail; \
+ la x1, from; \
+ ld x1, offs(x1); \
+ fmv.x.d x2, freg; \
+ bne x2, x1, fail