diff options
Diffstat (limited to 'riscv')
334 files changed, 24 insertions, 3013 deletions
diff --git a/riscv/csrs.cc b/riscv/csrs.cc index b4c6b6a..95638d3 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -1452,8 +1452,6 @@ vxsat_csr_t::vxsat_csr_t(processor_t* const proc, const reg_t addr): void vxsat_csr_t::verify_permissions(insn_t insn, bool write) const { require_vector_vs; - if (!proc->extension_enabled('V') && !proc->extension_enabled(EXT_ZPN)) - throw trap_illegal_instruction(insn.bits()); masked_csr_t::verify_permissions(insn, write); } diff --git a/riscv/decode_macros.h b/riscv/decode_macros.h index 4050000..bd871fa 100644 --- a/riscv/decode_macros.h +++ b/riscv/decode_macros.h @@ -60,6 +60,23 @@ #define SP READ_REG(X_SP) #define RA READ_REG(X_RA) +// Zdinx macros +#define READ_REG_PAIR(reg) ({ \ + require((reg) % 2 == 0); \ + (reg) == 0 ? reg_t(0) : \ + (READ_REG((reg) + 1) << 32) + zext32(READ_REG(reg)); }) + +#define RS1_PAIR READ_REG_PAIR(insn.rs1()) +#define RS2_PAIR READ_REG_PAIR(insn.rs2()) +#define RD_PAIR READ_REG_PAIR(insn.rd()) + +#define WRITE_RD_PAIR(value) \ + if (insn.rd() != 0) { \ + require(insn.rd() % 2 == 0); \ + WRITE_REG(insn.rd(), sext32(value)); \ + WRITE_REG(insn.rd() + 1, (sreg_t(value)) >> 32); \ + } + // FPU macros #define READ_ZDINX_REG(reg) (xlen == 32 ? f64(READ_REG_PAIR(reg)) : f64(STATE.XPR[reg] & (uint64_t)-1)) #define READ_FREG_H(reg) (p->extension_enabled(EXT_ZFINX) ? f16(STATE.XPR[reg] & (uint16_t)-1) : f16(READ_FREG(reg))) diff --git a/riscv/insn_template.h b/riscv/insn_template.h index cead6d7..88a41c2 100644 --- a/riscv/insn_template.h +++ b/riscv/insn_template.h @@ -7,6 +7,5 @@ #include "internals.h" #include "specialize.h" #include "tracer.h" -#include "p_ext_macros.h" #include "v_ext_macros.h" #include <assert.h> diff --git a/riscv/insns/add16.h b/riscv/insns/add16.h deleted file mode 100644 index fae4316..0000000 --- a/riscv/insns/add16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(16, { - pd = ps1 + ps2; -}) diff --git a/riscv/insns/add32.h b/riscv/insns/add32.h deleted file mode 100644 index ca544ce..0000000 --- a/riscv/insns/add32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_LOOP(32, { - pd = ps1 + ps2; -}) diff --git a/riscv/insns/add64.h b/riscv/insns/add64.h deleted file mode 100644 index 0968656..0000000 --- a/riscv/insns/add64.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_PROFILE({ - rd = rs1 + rs2; -}) diff --git a/riscv/insns/add8.h b/riscv/insns/add8.h deleted file mode 100644 index bb54a7b..0000000 --- a/riscv/insns/add8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(8, { - pd = ps1 + ps2; -}) diff --git a/riscv/insns/ave.h b/riscv/insns/ave.h deleted file mode 100644 index 5997900..0000000 --- a/riscv/insns/ave.h +++ /dev/null @@ -1,5 +0,0 @@ -require_extension(EXT_ZPN); -sreg_t rs1 = RS1; -sreg_t rs2 = RS2; -sreg_t carry = (rs1 & 1) | (rs2 & 1); -WRITE_RD(sext_xlen((rs1 >> 1) + (rs2 >> 1) + carry)); diff --git a/riscv/insns/clo16.h b/riscv/insns/clo16.h deleted file mode 100644 index 9da6599..0000000 --- a/riscv/insns/clo16.h +++ /dev/null @@ -1,11 +0,0 @@ -P_ONE_LOOP(16, { - pd = 0; - ps1 = ~ps1; - if (!ps1) pd = 16; - else { - if ((ps1 & 0xFF00) == 0) { pd += 8; ps1 <<= 8; } - if ((ps1 & 0xF000) == 0) { pd += 4; ps1 <<= 4; } - if ((ps1 & 0xC000) == 0) { pd += 2; ps1 <<= 2; } - if ((ps1 & 0x8000) == 0) { pd += 1; } - } -}) diff --git a/riscv/insns/clo32.h b/riscv/insns/clo32.h deleted file mode 100644 index 431bb0e..0000000 --- a/riscv/insns/clo32.h +++ /dev/null @@ -1,12 +0,0 @@ -P_ONE_LOOP(32, { - pd = 0; - ps1 = ~ps1; - if (!ps1) pd = 32; - else { - if ((ps1 & 0xFFFF0000) == 0) { pd += 16; ps1 <<= 16; } - if ((ps1 & 0xFF000000) == 0) { pd += 8; ps1 <<= 8; } - if ((ps1 & 0xF0000000) == 0) { pd += 4; ps1 <<= 4; } - if ((ps1 & 0xC0000000) == 0) { pd += 2; ps1 <<= 2; } - if ((ps1 & 0x80000000) == 0) { pd += 1; } - } -}) diff --git a/riscv/insns/clo8.h b/riscv/insns/clo8.h deleted file mode 100644 index 2581ade..0000000 --- a/riscv/insns/clo8.h +++ /dev/null @@ -1,10 +0,0 @@ -P_ONE_LOOP(8, { - pd = 0; - ps1 = ~ps1; - if (!ps1) pd = 8; - else { - if ((ps1 & 0xF0) == 0) { pd += 4; ps1 <<= 4; } - if ((ps1 & 0xC0) == 0) { pd += 2; ps1 <<= 2; } - if ((ps1 & 0x80) == 0) { pd += 1; } - } -}) diff --git a/riscv/insns/clrs16.h b/riscv/insns/clrs16.h deleted file mode 100644 index 6541262..0000000 --- a/riscv/insns/clrs16.h +++ /dev/null @@ -1,12 +0,0 @@ -P_ONE_LOOP(16, { - pd = 0; - if (ps1 < 0) ps1 = ~ps1; - if (!ps1) pd = 16; - else { - if ((ps1 & 0xFF00) == 0) { pd += 8; ps1 <<= 8; } - if ((ps1 & 0xF000) == 0) { pd += 4; ps1 <<= 4; } - if ((ps1 & 0xC000) == 0) { pd += 2; ps1 <<= 2; } - if ((ps1 & 0x8000) == 0) { pd += 1; } - } - pd -= 1; -}) diff --git a/riscv/insns/clrs32.h b/riscv/insns/clrs32.h deleted file mode 100644 index c75db18..0000000 --- a/riscv/insns/clrs32.h +++ /dev/null @@ -1,13 +0,0 @@ -P_ONE_LOOP(32, { - pd = 0; - if (ps1 < 0) ps1 = ~ps1; - if (!ps1) pd = 32; - else { - if ((ps1 & 0xFFFF0000) == 0) { pd += 16; ps1 <<= 16; } - if ((ps1 & 0xFF000000) == 0) { pd += 8; ps1 <<= 8; } - if ((ps1 & 0xF0000000) == 0) { pd += 4; ps1 <<= 4; } - if ((ps1 & 0xC0000000) == 0) { pd += 2; ps1 <<= 2; } - if ((ps1 & 0x80000000) == 0) { pd += 1; } - } - pd -= 1; -}) diff --git a/riscv/insns/clrs8.h b/riscv/insns/clrs8.h deleted file mode 100644 index f6f8298..0000000 --- a/riscv/insns/clrs8.h +++ /dev/null @@ -1,11 +0,0 @@ -P_ONE_LOOP(8, { - pd = 0; - if (ps1 < 0) ps1 = ~ps1; - if (!ps1) pd = 8; - else { - if ((ps1 & 0xF0) == 0) { pd += 4; ps1 <<= 4; } - if ((ps1 & 0xC0) == 0) { pd += 2; ps1 <<= 2; } - if ((ps1 & 0x80) == 0) { pd += 1; } - } - pd -= 1; -}) diff --git a/riscv/insns/clz.h b/riscv/insns/clz.h index e10e4d2..d334e40 100644 --- a/riscv/insns/clz.h +++ b/riscv/insns/clz.h @@ -1,4 +1,4 @@ -require_either_extension(xlen == 32 ? EXT_ZBPBO : EXT_ZBB, EXT_ZBB); +require_extension(EXT_ZBB); reg_t x = xlen; for (int i = 0; i < xlen; i++) if (1 & (RS1 >> (xlen-i-1))) { x = i; break; } diff --git a/riscv/insns/clz16.h b/riscv/insns/clz16.h deleted file mode 100644 index a129d59..0000000 --- a/riscv/insns/clz16.h +++ /dev/null @@ -1,10 +0,0 @@ -P_ONE_LOOP(16, { - pd = 0; - if (ps1 == 0) pd = 16; - else { - if ((ps1 & 0xFF00) == 0) { pd += 8; ps1 <<= 8; } - if ((ps1 & 0xF000) == 0) { pd += 4; ps1 <<= 4; } - if ((ps1 & 0xC000) == 0) { pd += 2; ps1 <<= 2; } - if ((ps1 & 0x8000) == 0) { pd += 1; } - } -}) diff --git a/riscv/insns/clz32.h b/riscv/insns/clz32.h deleted file mode 100644 index a38dda7..0000000 --- a/riscv/insns/clz32.h +++ /dev/null @@ -1,12 +0,0 @@ -require_rv64; -P_ONE_LOOP(32, { - pd = 0; - if (ps1 == 0) pd = 32; - else { - if ((ps1 & 0xFFFF0000) == 0) { pd += 16; ps1 <<= 16; } - if ((ps1 & 0xFF000000) == 0) { pd += 8; ps1 <<= 8; } - if ((ps1 & 0xF0000000) == 0) { pd += 4; ps1 <<= 4; } - if ((ps1 & 0xC0000000) == 0) { pd += 2; ps1 <<= 2; } - if ((ps1 & 0x80000000) == 0) { pd += 1; } - } -}) diff --git a/riscv/insns/clz8.h b/riscv/insns/clz8.h deleted file mode 100644 index 78ff6b7..0000000 --- a/riscv/insns/clz8.h +++ /dev/null @@ -1,9 +0,0 @@ -P_ONE_LOOP(8, { - pd = 0; - if (ps1 == 0) pd = 8; - else { - if ((ps1 & 0xF0) == 0) { pd += 4; ps1 <<= 4; } - if ((ps1 & 0xC0) == 0) { pd += 2; ps1 <<= 2; } - if ((ps1 & 0x80) == 0) { pd += 1; } - } -}) diff --git a/riscv/insns/cmix.h b/riscv/insns/cmix.h deleted file mode 100644 index f3b7977..0000000 --- a/riscv/insns/cmix.h +++ /dev/null @@ -1,2 +0,0 @@ -require_extension(EXT_ZBPBO); -WRITE_RD((RS1 & RS2) | (RS3 & ~RS2)); diff --git a/riscv/insns/cmpeq16.h b/riscv/insns/cmpeq16.h deleted file mode 100644 index 4fb6faa..0000000 --- a/riscv/insns/cmpeq16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(16, { - pd = (ps1 == ps2) ? -1 : 0; -}) diff --git a/riscv/insns/cmpeq8.h b/riscv/insns/cmpeq8.h deleted file mode 100644 index fba1bf6..0000000 --- a/riscv/insns/cmpeq8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(8, { - pd = (ps1 == ps2) ? -1 : 0; -}) diff --git a/riscv/insns/cras16.h b/riscv/insns/cras16.h deleted file mode 100644 index 6717e09..0000000 --- a/riscv/insns/cras16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_CROSS_LOOP(16, { - pd = ps1 + ps2; -}, { - pd = ps1 - ps2; -}) diff --git a/riscv/insns/cras32.h b/riscv/insns/cras32.h deleted file mode 100644 index 8f53e98..0000000 --- a/riscv/insns/cras32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_CROSS_LOOP(32, { - pd = ps1 + ps2; -}, { - pd = ps1 - ps2; -}) diff --git a/riscv/insns/crsa16.h b/riscv/insns/crsa16.h deleted file mode 100644 index 2c1997a..0000000 --- a/riscv/insns/crsa16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_CROSS_LOOP(16, { - pd = ps1 - ps2; -}, { - pd = ps1 + ps2; -}) diff --git a/riscv/insns/crsa32.h b/riscv/insns/crsa32.h deleted file mode 100644 index 4290e9e..0000000 --- a/riscv/insns/crsa32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_CROSS_LOOP(32, { - pd = (int64_t)ps1 - ps2; -}, { - pd = (int64_t)ps1 + ps2; -}) diff --git a/riscv/insns/fsr.h b/riscv/insns/fsr.h deleted file mode 100644 index d94f922..0000000 --- a/riscv/insns/fsr.h +++ /dev/null @@ -1,10 +0,0 @@ -require_rv32; -require_extension(EXT_ZBPBO); -int shamt = RS2 & (2*xlen-1); -reg_t a = RS1, b = RS3; -if (shamt >= xlen) { - a = RS3, b = RS1; - shamt -= xlen; -} -int rshamt = -shamt & (xlen-1); -WRITE_RD(sext_xlen(shamt ? (b << rshamt) | (zext_xlen(a) >> shamt) : a)); diff --git a/riscv/insns/fsri.h b/riscv/insns/fsri.h deleted file mode 100644 index ced2364..0000000 --- a/riscv/insns/fsri.h +++ /dev/null @@ -1,10 +0,0 @@ -require_rv32; -require_extension(EXT_ZBPBO); -int shamt = SHAMT & (2*xlen-1); -reg_t a = RS1, b = RS3; -if (shamt >= xlen) { - a = RS3, b = RS1; - shamt -= xlen; -} -int rshamt = -shamt & (xlen-1); -WRITE_RD(sext_xlen(shamt ? (b << rshamt) | (zext_xlen(a) >> shamt) : a)); diff --git a/riscv/insns/fsrw.h b/riscv/insns/fsrw.h deleted file mode 100644 index 9471e36..0000000 --- a/riscv/insns/fsrw.h +++ /dev/null @@ -1,10 +0,0 @@ -require_rv64; -require_extension(EXT_ZBPBO); -int shamt = RS2 & 63; -reg_t a = RS1, b = RS3; -if (shamt >= 32) { - a = RS3, b = RS1; - shamt -= 32; -} -int rshamt = -shamt & 31; -WRITE_RD(sext32(shamt ? (b << rshamt) | (zext32(a) >> shamt) : a)); diff --git a/riscv/insns/grevi.h b/riscv/insns/grevi.h index c37f59b..a274cdd 100644 --- a/riscv/insns/grevi.h +++ b/riscv/insns/grevi.h @@ -2,9 +2,7 @@ // Zbkb contains rev8 and brev8 (a.k.a. rev.b) but not general grevi int shamt = SHAMT; require(((shamt == xlen - 8) && (p->extension_enabled(EXT_ZBB) || p->extension_enabled(EXT_ZBKB))) //rev8 - || ((shamt == 7) && p->extension_enabled(EXT_ZBKB)) // rev8.b - || ((shamt == 8) && p->extension_enabled(EXT_ZPN)) // rev8.h - || ((shamt == xlen - 1) && p->extension_enabled(EXT_ZPN))); + || ((shamt == 7) && p->extension_enabled(EXT_ZBKB))); // rev8.b require(shamt < xlen); reg_t x = RS1; if (shamt & 1) x = ((x & 0x5555555555555555LL) << 1) | ((x & 0xAAAAAAAAAAAAAAAALL) >> 1); diff --git a/riscv/insns/insb.h b/riscv/insns/insb.h deleted file mode 100644 index 020e905..0000000 --- a/riscv/insns/insb.h +++ /dev/null @@ -1,4 +0,0 @@ -require_extension(EXT_ZPN); -reg_t bpos = insn.p_imm3(); -require(bpos < (unsigned long)xlen/8); // imm[2] == 1 is illegal on rv32 -WRITE_RD(sext_xlen(set_field(RD, make_mask64(bpos * 8, 8), P_B(RS1, 0)))); diff --git a/riscv/insns/kabs16.h b/riscv/insns/kabs16.h deleted file mode 100644 index 8d1d9b8..0000000 --- a/riscv/insns/kabs16.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_ONE_LOOP(16, { - pd = ps1; - if (ps1 == INT16_MIN) { - pd = INT16_MAX; - P_SET_OV(1); - } else if (ps1 < 0) { - pd = - ps1; - } -}) diff --git a/riscv/insns/kabs32.h b/riscv/insns/kabs32.h deleted file mode 100644 index 0536aac..0000000 --- a/riscv/insns/kabs32.h +++ /dev/null @@ -1,11 +0,0 @@ -require_vector_vs; -require_rv64; -P_ONE_LOOP(32, { - pd = ps1; - if (ps1 == INT32_MIN) { - pd = INT32_MAX; - P_SET_OV(1); - } else if (ps1 < 0) { - pd = - ps1; - } -}) diff --git a/riscv/insns/kabs8.h b/riscv/insns/kabs8.h deleted file mode 100644 index 2e6e1f1..0000000 --- a/riscv/insns/kabs8.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_ONE_LOOP(8, { - pd = ps1; - if (ps1 == INT8_MIN) { - pd = INT8_MAX; - P_SET_OV(1); - } else if (ps1 < 0) { - pd = - ps1; - } -}) diff --git a/riscv/insns/kabsw.h b/riscv/insns/kabsw.h deleted file mode 100644 index 5e83b75..0000000 --- a/riscv/insns/kabsw.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -int32_t rs1 = P_W(RS1, 0); - -if (rs1 == INT32_MIN) { - rs1 = INT32_MAX; - P_SET_OV(1); -} - -WRITE_RD(sext_xlen(rs1 >= 0 ? rs1 : -rs1)); diff --git a/riscv/insns/kadd16.h b/riscv/insns/kadd16.h deleted file mode 100644 index b6defe1..0000000 --- a/riscv/insns/kadd16.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_LOOP(16, { - bool sat = false; - pd = (sat_add<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kadd32.h b/riscv/insns/kadd32.h deleted file mode 100644 index 1728847..0000000 --- a/riscv/insns/kadd32.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kadd64.h b/riscv/insns/kadd64.h deleted file mode 100644 index c58fff0..0000000 --- a/riscv/insns/kadd64.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_64_PROFILE({ - bool sat = false; - rd = (sat_add<int64_t, uint64_t>(rs1, rs2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kadd8.h b/riscv/insns/kadd8.h deleted file mode 100644 index 98864c7..0000000 --- a/riscv/insns/kadd8.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_LOOP(8, { - bool sat = false; - pd = (sat_add<int8_t, uint8_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kaddh.h b/riscv/insns/kaddh.h deleted file mode 100644 index 43aedb2..0000000 --- a/riscv/insns/kaddh.h +++ /dev/null @@ -1,5 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_SH(RS1, 0) + (sreg_t)P_SH(RS2, 0); -P_SAT(res, 16); -WRITE_RD(sext_xlen((int16_t)res)); diff --git a/riscv/insns/kaddw.h b/riscv/insns/kaddw.h deleted file mode 100644 index 3298d57..0000000 --- a/riscv/insns/kaddw.h +++ /dev/null @@ -1,5 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_SW(RS1, 0) + (sreg_t)P_SW(RS2, 0); -P_SAT(res, 32); -WRITE_RD(sext32(res)); diff --git a/riscv/insns/kcras16.h b/riscv/insns/kcras16.h deleted file mode 100644 index d746425..0000000 --- a/riscv/insns/kcras16.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_CROSS_ULOOP(16, { - bool sat = false; - pd = (sat_add<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_sub<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kcras32.h b/riscv/insns/kcras32.h deleted file mode 100644 index ead31f8..0000000 --- a/riscv/insns/kcras32.h +++ /dev/null @@ -1,11 +0,0 @@ -require_vector_vs; -require_rv64; -P_CROSS_ULOOP(32, { - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_sub<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kcrsa16.h b/riscv/insns/kcrsa16.h deleted file mode 100644 index 2a7ca4d..0000000 --- a/riscv/insns/kcrsa16.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_CROSS_ULOOP(16, { - bool sat = false; - pd = (sat_sub<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_add<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kcrsa32.h b/riscv/insns/kcrsa32.h deleted file mode 100644 index b688fd3..0000000 --- a/riscv/insns/kcrsa32.h +++ /dev/null @@ -1,11 +0,0 @@ -require_vector_vs; -require_rv64; -P_CROSS_ULOOP(32, { - bool sat = false; - pd = (sat_sub<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kdmabb.h b/riscv/insns/kdmabb.h deleted file mode 100644 index 7ca0563..0000000 --- a/riscv/insns/kdmabb.h +++ /dev/null @@ -1,17 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res; -sreg_t aop = P_SH(RS1, 0); -sreg_t bop = P_SH(RS2, 0); - -if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - res = aop * bop; - res <<= 1; -} else { - res = INT32_MAX; - P_SET_OV(1); -} - -res += sext32(RD); -P_SAT(res, 32); -WRITE_RD(sext32(res)); diff --git a/riscv/insns/kdmabb16.h b/riscv/insns/kdmabb16.h deleted file mode 100644 index 2ccd40b..0000000 --- a/riscv/insns/kdmabb16.h +++ /dev/null @@ -1,18 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - int32_t aop = P_SH(ps1, 0); - int32_t bop = P_SH(ps2, 0); - int32_t mres; - bool sat; - - if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - mres = aop * bop; - mres <<= 1; - } else { - mres = INT32_MAX; - P_SET_OV(1); - } - pd = (sat_add<int32_t, uint32_t>(pd, mres, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kdmabt.h b/riscv/insns/kdmabt.h deleted file mode 100644 index d50a6df..0000000 --- a/riscv/insns/kdmabt.h +++ /dev/null @@ -1,17 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res; -sreg_t aop = P_SH(RS1, 0); -sreg_t bop = P_SH(RS2, 1); - -if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - res = aop * bop; - res <<= 1; -} else { - res = INT32_MAX; - P_SET_OV(1); -} - -res += sext32(RD); -P_SAT(res, 32); -WRITE_RD(sext32(res)); diff --git a/riscv/insns/kdmabt16.h b/riscv/insns/kdmabt16.h deleted file mode 100644 index 49538b3..0000000 --- a/riscv/insns/kdmabt16.h +++ /dev/null @@ -1,18 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - int32_t aop = P_SH(ps1, 0); - int32_t bop = P_SH(ps2, 1); - int32_t mres; - bool sat; - - if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - mres = aop * bop; - mres <<= 1; - } else { - mres = INT32_MAX; - P_SET_OV(1); - } - pd = (sat_add<int32_t, uint32_t>(pd, mres, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kdmatt.h b/riscv/insns/kdmatt.h deleted file mode 100644 index e917d41..0000000 --- a/riscv/insns/kdmatt.h +++ /dev/null @@ -1,17 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res; -sreg_t aop = P_SH(RS1, 1); -sreg_t bop = P_SH(RS2, 1); - -if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - res = aop * bop; - res <<= 1; -} else { - res = INT32_MAX; - P_SET_OV(1); -} - -res += sext32(RD); -P_SAT(res, 32); -WRITE_RD(sext32(res)); diff --git a/riscv/insns/kdmatt16.h b/riscv/insns/kdmatt16.h deleted file mode 100644 index ebce13f..0000000 --- a/riscv/insns/kdmatt16.h +++ /dev/null @@ -1,18 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - int32_t aop = P_SH(ps1, 1); - int32_t bop = P_SH(ps2, 1); - int32_t mres; - bool sat; - - if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - mres = aop * bop; - mres <<= 1; - } else { - mres = INT32_MAX; - P_SET_OV(1); - } - pd = (sat_add<int32_t, uint32_t>(pd, mres, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kdmbb.h b/riscv/insns/kdmbb.h deleted file mode 100644 index 2f7a3f9..0000000 --- a/riscv/insns/kdmbb.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res; -sreg_t aop = P_SH(RS1, 0); -sreg_t bop = P_SH(RS2, 0); -if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - res = aop * bop; - res <<= 1; -} else { - res = INT32_MAX; - P_SET_OV(1); -} -WRITE_RD(sext32(res)); diff --git a/riscv/insns/kdmbb16.h b/riscv/insns/kdmbb16.h deleted file mode 100644 index a84877d..0000000 --- a/riscv/insns/kdmbb16.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - int32_t aop = P_SH(ps1, 0); - int32_t bop = P_SH(ps2, 0); - if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - pd = aop * bop; - pd <<= 1; - } else { - pd = INT32_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/kdmbt.h b/riscv/insns/kdmbt.h deleted file mode 100644 index 7f093e3..0000000 --- a/riscv/insns/kdmbt.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res; -sreg_t aop = P_SH(RS1, 0); -sreg_t bop = P_SH(RS2, 1); -if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - res = aop * bop; - res <<= 1; -} else { - res = INT32_MAX; - P_SET_OV(1); -} -WRITE_RD(sext32(res)); diff --git a/riscv/insns/kdmbt16.h b/riscv/insns/kdmbt16.h deleted file mode 100644 index 85e9d0e..0000000 --- a/riscv/insns/kdmbt16.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - int32_t aop = P_SH(ps1, 0); - int32_t bop = P_SH(ps2, 1); - if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - pd = aop * bop; - pd <<= 1; - } else { - pd = INT32_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/kdmtt.h b/riscv/insns/kdmtt.h deleted file mode 100644 index 05a4c8c..0000000 --- a/riscv/insns/kdmtt.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res; -sreg_t aop = P_SH(RS1, 1); -sreg_t bop = P_SH(RS2, 1); -if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - res = aop * bop; - res <<= 1; -} else { - res = INT32_MAX; - P_SET_OV(1); -} -WRITE_RD(sext32(res)); diff --git a/riscv/insns/kdmtt16.h b/riscv/insns/kdmtt16.h deleted file mode 100644 index 2190710..0000000 --- a/riscv/insns/kdmtt16.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - int32_t aop = P_SH(ps1, 1); - int32_t bop = P_SH(ps2, 1); - if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - pd = aop * bop; - pd <<= 1; - } else { - pd = INT32_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/khm16.h b/riscv/insns/khm16.h deleted file mode 100644 index 9c2e28c..0000000 --- a/riscv/insns/khm16.h +++ /dev/null @@ -1,9 +0,0 @@ -require_vector_vs; -P_LOOP(16, { - if ((ps1 != INT16_MIN) | (ps2 != INT16_MIN)) { - pd = (ps1 * ps2) >> 15; - } else { - pd = INT16_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/khm8.h b/riscv/insns/khm8.h deleted file mode 100644 index ac21d68..0000000 --- a/riscv/insns/khm8.h +++ /dev/null @@ -1,9 +0,0 @@ -require_vector_vs; -P_LOOP(8, { - if ((ps1 != INT8_MIN) | (ps2 != INT8_MIN)) { - pd = (ps1 * ps2) >> 7; - } else { - pd = INT8_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/khmbb.h b/riscv/insns/khmbb.h deleted file mode 100644 index e08eddc..0000000 --- a/riscv/insns/khmbb.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res; -sreg_t aop = P_SH(RS1, 0); -sreg_t bop = P_SH(RS2, 0); -if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - res = aop * bop; - res >>= 15; -} else { - res = INT16_MAX; - P_SET_OV(1); -} -WRITE_RD(sext_xlen((int16_t)res)); diff --git a/riscv/insns/khmbb16.h b/riscv/insns/khmbb16.h deleted file mode 100644 index efbd7eb..0000000 --- a/riscv/insns/khmbb16.h +++ /dev/null @@ -1,14 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - int32_t aop = P_SH(ps1, 0); - int32_t bop = P_SH(ps2, 0); - if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - pd = aop * bop; - pd >>= 15; - } else { - pd = INT16_MAX; - P_SET_OV(1); - } - pd = (int16_t)pd; -}) diff --git a/riscv/insns/khmbt.h b/riscv/insns/khmbt.h deleted file mode 100644 index 0c19cd1..0000000 --- a/riscv/insns/khmbt.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res; -sreg_t aop = P_SH(RS1, 0); -sreg_t bop = P_SH(RS2, 1); -if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - res = aop * bop; - res >>= 15; -} else { - res = INT16_MAX; - P_SET_OV(1); -} -WRITE_RD(sext_xlen((int16_t)res)); diff --git a/riscv/insns/khmbt16.h b/riscv/insns/khmbt16.h deleted file mode 100644 index 4bb1f48..0000000 --- a/riscv/insns/khmbt16.h +++ /dev/null @@ -1,14 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - int32_t aop = P_SH(ps1, 0); - int32_t bop = P_SH(ps2, 1); - if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - pd = aop * bop; - pd >>= 15; - } else { - pd = INT16_MAX; - P_SET_OV(1); - } - pd = (int16_t)pd; -}) diff --git a/riscv/insns/khmtt.h b/riscv/insns/khmtt.h deleted file mode 100644 index dcd4503..0000000 --- a/riscv/insns/khmtt.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res; -sreg_t aop = P_SH(RS1, 1); -sreg_t bop = P_SH(RS2, 1); -if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - res = aop * bop; - res >>= 15; -} else { - res = INT16_MAX; - P_SET_OV(1); -} -WRITE_RD(sext_xlen((int16_t)res)); diff --git a/riscv/insns/khmtt16.h b/riscv/insns/khmtt16.h deleted file mode 100644 index d3c0b4c..0000000 --- a/riscv/insns/khmtt16.h +++ /dev/null @@ -1,14 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - int32_t aop = P_SH(ps1, 1); - int32_t bop = P_SH(ps2, 1); - if ((INT16_MIN != aop) | (INT16_MIN != bop)) { - pd = aop * bop; - pd >>= 15; - } else { - pd = INT16_MAX; - P_SET_OV(1); - } - pd = (int16_t)pd; -}) diff --git a/riscv/insns/khmx16.h b/riscv/insns/khmx16.h deleted file mode 100644 index bf93462..0000000 --- a/riscv/insns/khmx16.h +++ /dev/null @@ -1,9 +0,0 @@ -require_vector_vs; -P_CROSS_LOOP(16, { - if ((ps1 != INT16_MIN) | (ps2 != INT16_MIN)) { - pd = (ps1 * ps2) >> 15; - } else { - pd = INT16_MAX; - P_SET_OV(1); - } -},) diff --git a/riscv/insns/khmx8.h b/riscv/insns/khmx8.h deleted file mode 100644 index 0d6a5d5..0000000 --- a/riscv/insns/khmx8.h +++ /dev/null @@ -1,9 +0,0 @@ -require_vector_vs; -P_CROSS_LOOP(8, { - if ((ps1 != INT8_MIN) | (ps2 != INT8_MIN)) { - pd = (ps1 * ps2) >> 7; - } else { - pd = INT8_MAX; - P_SET_OV(1); - } -},) diff --git a/riscv/insns/kmabb.h b/riscv/insns/kmabb.h deleted file mode 100644 index f2d7715..0000000 --- a/riscv/insns/kmabb.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int32_t mres = P_SH(ps1, 0) * P_SH(ps2, 0); - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(pd, mres, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmabb32.h b/riscv/insns/kmabb32.h deleted file mode 100644 index 752bf8b..0000000 --- a/riscv/insns/kmabb32.h +++ /dev/null @@ -1,8 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat = false; -sreg_t mres = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 0); -WRITE_RD((sat_add<int64_t, uint64_t>(RD, mres, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmabt.h b/riscv/insns/kmabt.h deleted file mode 100644 index 4ead23b..0000000 --- a/riscv/insns/kmabt.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int32_t mres = P_SH(ps1, 0) * P_SH(ps2, 1); - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(pd, mres, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmabt32.h b/riscv/insns/kmabt32.h deleted file mode 100644 index ee7511b..0000000 --- a/riscv/insns/kmabt32.h +++ /dev/null @@ -1,8 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat = false; -sreg_t mres = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 1); -WRITE_RD((sat_add<int64_t, uint64_t>(RD, mres, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmada.h b/riscv/insns/kmada.h deleted file mode 100644 index 3c082c7..0000000 --- a/riscv/insns/kmada.h +++ /dev/null @@ -1,4 +0,0 @@ -require_vector_vs; -P_REDUCTION_LOOP(32, 16, true, true, { - pd_res += ps1 * ps2; -}) diff --git a/riscv/insns/kmadrs.h b/riscv/insns/kmadrs.h deleted file mode 100644 index a450351..0000000 --- a/riscv/insns/kmadrs.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_REDUCTION_LOOP(32, 16, true, true, { - if (j & 1) - pd_res -= ps1 * ps2; - else - pd_res += ps1 * ps2; -}) diff --git a/riscv/insns/kmadrs32.h b/riscv/insns/kmadrs32.h deleted file mode 100644 index 0f71e90..0000000 --- a/riscv/insns/kmadrs32.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat; -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 0); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 1); - -WRITE_RD((sat_add<sreg_t, reg_t>(RD, mres0, -mres1, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmads.h b/riscv/insns/kmads.h deleted file mode 100644 index 89aabe0..0000000 --- a/riscv/insns/kmads.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_REDUCTION_LOOP(32, 16, true, true, { - if (j & 1) - pd_res += ps1 * ps2; - else - pd_res -= ps1 * ps2; -}) diff --git a/riscv/insns/kmads32.h b/riscv/insns/kmads32.h deleted file mode 100644 index 0a3b590..0000000 --- a/riscv/insns/kmads32.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat; -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 0); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 1); - -WRITE_RD((sat_add<sreg_t, reg_t>(RD, -mres0, mres1, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmar64.h b/riscv/insns/kmar64.h deleted file mode 100644 index a4d332b..0000000 --- a/riscv/insns/kmar64.h +++ /dev/null @@ -1,15 +0,0 @@ -require_vector_vs; -P_64_PROFILE_BASE() -P_64_PROFILE_PARAM(true, false) - -bool sat = false; -sreg_t mres0 = (sreg_t)P_SW(rs1, 0) * P_SW(rs2, 0); -sreg_t mres1 = (sreg_t)P_SW(rs1, 1) * P_SW(rs2, 1); - -if (xlen == 32) { - rd = (sat_add<int64_t, uint64_t>(rd, mres0, sat)); -} else { - rd = (sat_add<int64_t, uint64_t>(rd, mres0, mres1, sat)); -} -P_SET_OV(sat); -P_64_PROFILE_END() diff --git a/riscv/insns/kmatt.h b/riscv/insns/kmatt.h deleted file mode 100644 index 4be2f3d..0000000 --- a/riscv/insns/kmatt.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int32_t mres = P_SH(ps1, 1) * P_SH(ps2, 1); - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(pd, mres, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmatt32.h b/riscv/insns/kmatt32.h deleted file mode 100644 index 4fe9ed2..0000000 --- a/riscv/insns/kmatt32.h +++ /dev/null @@ -1,8 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat = false; -sreg_t mres = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 1); -WRITE_RD((sat_add<int64_t, uint64_t>(RD, mres, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmaxda.h b/riscv/insns/kmaxda.h deleted file mode 100644 index 393f047..0000000 --- a/riscv/insns/kmaxda.h +++ /dev/null @@ -1,4 +0,0 @@ -require_vector_vs; -P_REDUCTION_CROSS_LOOP(32, 16, true, true, { - pd_res += ps1 * ps2; -}) diff --git a/riscv/insns/kmaxda32.h b/riscv/insns/kmaxda32.h deleted file mode 100644 index b9346b9..0000000 --- a/riscv/insns/kmaxda32.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat; -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 1); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 0); - -WRITE_RD((sat_add<sreg_t, reg_t>(RD, mres0, mres1, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmaxds.h b/riscv/insns/kmaxds.h deleted file mode 100644 index c2f0e59..0000000 --- a/riscv/insns/kmaxds.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_REDUCTION_CROSS_LOOP(32, 16, true, true, { - if (j & 1) - pd_res += ps1 * ps2; - else - pd_res -= ps1 * ps2; -}) diff --git a/riscv/insns/kmaxds32.h b/riscv/insns/kmaxds32.h deleted file mode 100644 index 6a7d64e..0000000 --- a/riscv/insns/kmaxds32.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat; -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 1); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 0); - -WRITE_RD((sat_add<sreg_t, reg_t>(RD, -mres0, mres1, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmda.h b/riscv/insns/kmda.h deleted file mode 100644 index 68b6c9a..0000000 --- a/riscv/insns/kmda.h +++ /dev/null @@ -1,4 +0,0 @@ -require_vector_vs; -P_REDUCTION_LOOP(32, 16, false, true, { - pd_res += ps1 * ps2; -}) diff --git a/riscv/insns/kmda32.h b/riscv/insns/kmda32.h deleted file mode 100644 index 646021f..0000000 --- a/riscv/insns/kmda32.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat; -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 0); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 1); - -WRITE_RD((sat_add<sreg_t, reg_t>(mres0, mres1, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmmac.h b/riscv/insns/kmmac.h deleted file mode 100644 index 946f0fe..0000000 --- a/riscv/insns/kmmac.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int64_t) ps2; - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(pd, (mres >> 32), sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmac_u.h b/riscv/insns/kmmac_u.h deleted file mode 100644 index 5a06a4d..0000000 --- a/riscv/insns/kmmac_u.h +++ /dev/null @@ -1,8 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int64_t) ps2; - int32_t round = (((mres >> 31) + 1) >> 1); - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(pd, round, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmawb.h b/riscv/insns/kmmawb.h deleted file mode 100644 index 0e3a694..0000000 --- a/riscv/insns/kmmawb.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t mres = (int64_t)ps1 * P_SH(ps2, 0); - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(pd, (mres >> 16), sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmawb2.h b/riscv/insns/kmmawb2.h deleted file mode 100644 index 274f9dd..0000000 --- a/riscv/insns/kmmawb2.h +++ /dev/null @@ -1,15 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t addop = 0; - int64_t mres = 0; - bool sat = false; - if ((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 0))) { - mres = ((int64_t) ps1 * P_SH(ps2, 0)) << 1; - addop = mres >> 16; - } else { - addop = INT32_MAX; - P_SET_OV(1); - } - pd = (sat_add<int32_t, uint32_t>(pd, addop, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmawb2_u.h b/riscv/insns/kmmawb2_u.h deleted file mode 100644 index 447a3f4..0000000 --- a/riscv/insns/kmmawb2_u.h +++ /dev/null @@ -1,15 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t addop = 0; - int64_t mres = 0; - bool sat = false; - if ((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 0))) { - mres = ((int64_t) ps1 * P_SH(ps2, 0)) << 1; - addop = ((mres >> 15) + 1) >> 1; - } else { - addop = INT32_MAX; - P_SET_OV(1); - } - pd = (sat_add<int32_t, uint32_t>(pd, addop, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmawb_u.h b/riscv/insns/kmmawb_u.h deleted file mode 100644 index 766dd71..0000000 --- a/riscv/insns/kmmawb_u.h +++ /dev/null @@ -1,8 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t mres = (int64_t)ps1 * P_SH(ps2, 0); - int32_t round = (((mres >> 15) + 1) >> 1); - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(pd, round, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmawt.h b/riscv/insns/kmmawt.h deleted file mode 100644 index 514ee48..0000000 --- a/riscv/insns/kmmawt.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t mres = (int64_t)ps1 * P_SH(ps2, 1); - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(pd, (mres >> 16), sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmawt2.h b/riscv/insns/kmmawt2.h deleted file mode 100644 index 6eb22ac..0000000 --- a/riscv/insns/kmmawt2.h +++ /dev/null @@ -1,15 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t addop = 0; - int64_t mres = 0; - bool sat = false; - if ((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 1))) { - mres = ((int64_t) ps1 * P_SH(ps2, 1)) << 1; - addop = mres >> 16; - } else { - addop = INT32_MAX; - P_SET_OV(1); - } - pd = (sat_add<int32_t, uint32_t>(pd, addop, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmawt2_u.h b/riscv/insns/kmmawt2_u.h deleted file mode 100644 index b82e090..0000000 --- a/riscv/insns/kmmawt2_u.h +++ /dev/null @@ -1,15 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t addop = 0; - int64_t mres = 0; - bool sat = false; - if ((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 1))) { - mres = ((int64_t) ps1 * P_SH(ps2, 1)) << 1; - addop = ((mres >> 15) + 1) >> 1; - } else { - addop = INT32_MAX; - P_SET_OV(1); - } - pd = (sat_add<int32_t, uint32_t>(pd, addop, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmawt_u.h b/riscv/insns/kmmawt_u.h deleted file mode 100644 index 74d8fd0..0000000 --- a/riscv/insns/kmmawt_u.h +++ /dev/null @@ -1,8 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t mres = (int64_t)ps1 * P_SH(ps2, 1); - int32_t round = (((mres >> 15) + 1) >> 1); - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(pd, round, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmsb.h b/riscv/insns/kmmsb.h deleted file mode 100644 index 29ad1bf..0000000 --- a/riscv/insns/kmmsb.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int64_t) ps2; - bool sat = false; - pd = (sat_sub<int32_t, uint32_t>(pd, (mres >> 32), sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmsb_u.h b/riscv/insns/kmmsb_u.h deleted file mode 100644 index c7b283e..0000000 --- a/riscv/insns/kmmsb_u.h +++ /dev/null @@ -1,8 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int64_t) ps2; - int32_t round = (((mres >> 31) + 1) >> 1); - bool sat = false; - pd = (sat_sub<int32_t, uint32_t>(pd, round, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kmmwb2.h b/riscv/insns/kmmwb2.h deleted file mode 100644 index d08b0ef..0000000 --- a/riscv/insns/kmmwb2.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - if ((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 0))) { - int64_t mres = ((int64_t) ps1 * P_SH(ps2, 0)) << 1; - pd = mres >> 16; - } else { - pd = INT32_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/kmmwb2_u.h b/riscv/insns/kmmwb2_u.h deleted file mode 100644 index d308bf3..0000000 --- a/riscv/insns/kmmwb2_u.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - if ((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 0))) { - int64_t mres = ((int64_t) ps1 * P_SH(ps2, 0)) << 1; - pd = ((mres >> 15) + 1) >> 1; - } else { - pd = INT32_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/kmmwt2.h b/riscv/insns/kmmwt2.h deleted file mode 100644 index 38ba9b1..0000000 --- a/riscv/insns/kmmwt2.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - if ((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 1))) { - int64_t mres = ((int64_t) ps1 * P_SH(ps2, 1)) << 1; - pd = mres >> 16; - } else { - pd = INT32_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/kmmwt2_u.h b/riscv/insns/kmmwt2_u.h deleted file mode 100644 index e855786..0000000 --- a/riscv/insns/kmmwt2_u.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - if ((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 1))) { - int64_t mres = ((int64_t) ps1 * P_SH(ps2, 1)) << 1; - pd = ((mres >> 15) + 1) >> 1; - } else { - pd = INT32_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/kmsda.h b/riscv/insns/kmsda.h deleted file mode 100644 index 94b118a..0000000 --- a/riscv/insns/kmsda.h +++ /dev/null @@ -1,4 +0,0 @@ -require_vector_vs; -P_REDUCTION_LOOP(32, 16, true, true, { - pd_res -= ps1 * ps2; -}) diff --git a/riscv/insns/kmsda32.h b/riscv/insns/kmsda32.h deleted file mode 100644 index d54d42c..0000000 --- a/riscv/insns/kmsda32.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat; -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 0); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 1); - -WRITE_RD((sat_add<sreg_t, reg_t>(RD, -mres0, -mres1, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmsr64.h b/riscv/insns/kmsr64.h deleted file mode 100644 index bfef503..0000000 --- a/riscv/insns/kmsr64.h +++ /dev/null @@ -1,26 +0,0 @@ -require_vector_vs; -P_64_PROFILE_BASE() -P_64_PROFILE_PARAM(true, false) - -bool sat = false; -sreg_t mres0 = -(sreg_t)P_SW(rs1, 0) * P_SW(rs2, 0); -sreg_t mres1 = -(sreg_t)P_SW(rs1, 1) * P_SW(rs2, 1); -sreg_t res; - -if (xlen == 32) { - rd = (sat_add<int64_t, uint64_t>(rd, mres0, sat)); -} else { - if ((rd ^ mres0) < 0) { - res = rd + mres0; - rd = (sat_add<int64_t, uint64_t>(res, mres1, sat)); - } else if ((rd ^ mres1) < 0) { - res = rd + mres1; - rd = (sat_add<int64_t, uint64_t>(res, mres0, sat)); - } else { - rd = (sat_add<int64_t, uint64_t>(rd, mres0, sat)); - P_SET_OV(sat); - rd = (sat_add<int64_t, uint64_t>(rd, mres1, sat)); - } -} -P_SET_OV(sat); -P_64_PROFILE_END() diff --git a/riscv/insns/kmsxda.h b/riscv/insns/kmsxda.h deleted file mode 100644 index 2d0faa3..0000000 --- a/riscv/insns/kmsxda.h +++ /dev/null @@ -1,4 +0,0 @@ -require_vector_vs; -P_REDUCTION_CROSS_LOOP(32, 16, true, true, { - pd_res -= ps1 * ps2; -}) diff --git a/riscv/insns/kmsxda32.h b/riscv/insns/kmsxda32.h deleted file mode 100644 index 3006b54..0000000 --- a/riscv/insns/kmsxda32.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat; -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 1); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 0); - -WRITE_RD((sat_add<sreg_t, reg_t>(RD, -mres0, -mres1, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/kmxda.h b/riscv/insns/kmxda.h deleted file mode 100644 index 4addd8a..0000000 --- a/riscv/insns/kmxda.h +++ /dev/null @@ -1,4 +0,0 @@ -require_vector_vs; -P_REDUCTION_CROSS_LOOP(32, 16, false, true, { - pd_res += ps1 * ps2; -}) diff --git a/riscv/insns/kmxda32.h b/riscv/insns/kmxda32.h deleted file mode 100644 index 99a8204..0000000 --- a/riscv/insns/kmxda32.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -require_rv64; -require_extension(EXT_ZPN); - -bool sat; -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 1); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 0); - -WRITE_RD((sat_add<sreg_t, reg_t>(mres0, mres1, sat))); -P_SET_OV(sat); diff --git a/riscv/insns/ksll16.h b/riscv/insns/ksll16.h deleted file mode 100644 index 9e03b34..0000000 --- a/riscv/insns/ksll16.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_X_LOOP(16, 4, { - auto res = (sreg_t)ps1 << sa; - P_SAT(res, 16); - pd = res; -}) diff --git a/riscv/insns/ksll32.h b/riscv/insns/ksll32.h deleted file mode 100644 index 3588898..0000000 --- a/riscv/insns/ksll32.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -require_rv64; -P_X_LOOP(32, 5, { - auto res = (sreg_t)ps1 << sa; - P_SAT(res, 32); - pd = res; -}) diff --git a/riscv/insns/ksll8.h b/riscv/insns/ksll8.h deleted file mode 100644 index 930ea03..0000000 --- a/riscv/insns/ksll8.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_X_LOOP(8, 3, { - auto res = (sreg_t)ps1 << sa; - P_SAT(res, 8); - pd = res; -}) diff --git a/riscv/insns/kslli16.h b/riscv/insns/kslli16.h deleted file mode 100644 index edc7c67..0000000 --- a/riscv/insns/kslli16.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_I_LOOP(16, 4, { - auto res = (sreg_t)ps1 << imm4u; - P_SAT(res, 16); - pd = res; -}) diff --git a/riscv/insns/kslli32.h b/riscv/insns/kslli32.h deleted file mode 100644 index 4fd506b..0000000 --- a/riscv/insns/kslli32.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -require_rv64; -P_I_LOOP(32, 5, { - auto res = (sreg_t)ps1 << imm5u; - P_SAT(res, 32); - pd = res; -}) diff --git a/riscv/insns/kslli8.h b/riscv/insns/kslli8.h deleted file mode 100644 index 18d714f..0000000 --- a/riscv/insns/kslli8.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_I_LOOP(8, 3, { - auto res = (sreg_t)ps1 << imm3u; - P_SAT(res, 8); - pd = res; -}) diff --git a/riscv/insns/kslliw.h b/riscv/insns/kslliw.h deleted file mode 100644 index 8902d3a..0000000 --- a/riscv/insns/kslliw.h +++ /dev/null @@ -1,8 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t rs1 = sext32(RS1); -sreg_t sa = insn.p_imm5(); -sreg_t res = rs1 << sa; - -P_SAT(res, 32); -WRITE_RD(sext32(res)); diff --git a/riscv/insns/ksllw.h b/riscv/insns/ksllw.h deleted file mode 100644 index 7e8452f..0000000 --- a/riscv/insns/ksllw.h +++ /dev/null @@ -1,8 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t rs1 = sext32(RS1); -sreg_t sa = get_field(RS2, make_mask64(0, 5)); -sreg_t res = rs1 << sa; - -P_SAT(res, 32); -WRITE_RD(sext32(res)); diff --git a/riscv/insns/kslra16.h b/riscv/insns/kslra16.h deleted file mode 100644 index ad1443a..0000000 --- a/riscv/insns/kslra16.h +++ /dev/null @@ -1,12 +0,0 @@ -require_vector_vs; -P_X_LOOP(16, 5, { - if (ssa < 0) { - sa = -ssa; - sa = (sa == 16) ? 15 : sa; - pd = ps1 >> sa; - } else { - auto res = (sreg_t)ps1 << ssa; - P_SAT(res, 16); - pd = res; - } -}) diff --git a/riscv/insns/kslra16_u.h b/riscv/insns/kslra16_u.h deleted file mode 100644 index 27bb77c..0000000 --- a/riscv/insns/kslra16_u.h +++ /dev/null @@ -1,15 +0,0 @@ -require_vector_vs; -P_X_LOOP(16, 5, { - if (ssa < 0) { - sa = -ssa; - sa = (sa == 16) ? 15 : sa; - if (sa != 0) - pd = ((ps1 >> (sa - 1)) + 1) >> 1; - else - pd = ps1; - } else { - auto res = (sreg_t)ps1 << ssa; - P_SAT(res, 16); - pd = res; - } -}) diff --git a/riscv/insns/kslra32.h b/riscv/insns/kslra32.h deleted file mode 100644 index 871d601..0000000 --- a/riscv/insns/kslra32.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -require_rv64; -P_X_LOOP(32, 6, { - if (ssa < 0) { - sa = -ssa; - sa = (sa == 32) ? 31 : sa; - pd = ps1 >> sa; - } else { - auto res = (sreg_t)ps1 << ssa; - P_SAT(res, 32); - pd = res; - } -}) diff --git a/riscv/insns/kslra32_u.h b/riscv/insns/kslra32_u.h deleted file mode 100644 index b9c06cf..0000000 --- a/riscv/insns/kslra32_u.h +++ /dev/null @@ -1,16 +0,0 @@ -require_vector_vs; -require_rv64; -P_X_LOOP(32, 6, { - if (ssa < 0) { - sa = -ssa; - sa = (sa == 32) ? 31 : sa; - if (sa != 0) - pd = ((ps1 >> (sa - 1)) + 1) >> 1; - else - pd = ps1; - } else { - auto res = (sreg_t)ps1 << ssa; - P_SAT(res, 32); - pd = res; - } -}) diff --git a/riscv/insns/kslra8.h b/riscv/insns/kslra8.h deleted file mode 100644 index b3f3e6b..0000000 --- a/riscv/insns/kslra8.h +++ /dev/null @@ -1,12 +0,0 @@ -require_vector_vs; -P_X_LOOP(8, 4, { - if (ssa < 0) { - sa = -ssa; - sa = (sa == 8) ? 7 : sa; - pd = ps1 >> sa; - } else { - auto res = (sreg_t)ps1 << ssa; - P_SAT(res, 8); - pd = res; - } -}) diff --git a/riscv/insns/kslra8_u.h b/riscv/insns/kslra8_u.h deleted file mode 100644 index 340283f..0000000 --- a/riscv/insns/kslra8_u.h +++ /dev/null @@ -1,15 +0,0 @@ -require_vector_vs; -P_X_LOOP(8, 4, { - if (ssa < 0) { - sa = -ssa; - sa = (sa == 8) ? 7 : sa; - if (sa != 0) - pd = ((ps1 >> (sa - 1)) + 1) >> 1; - else - pd = ps1; - } else { - auto res = (sreg_t)ps1 << ssa; - P_SAT(res, 8); - pd = res; - } -}) diff --git a/riscv/insns/kslraw.h b/riscv/insns/kslraw.h deleted file mode 100644 index fa4c844..0000000 --- a/riscv/insns/kslraw.h +++ /dev/null @@ -1,14 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t rs1 = sext32(RS1); -sreg_t sa = int64_t(RS2) << (64 - 6) >> (64 - 6); - -if (sa < 0) { - sa = -sa; - sa = (sa == 32) ? 31 : sa; - WRITE_RD(sext32(rs1 >> sa)); -} else { - auto res = rs1 << sa; - P_SAT(res, 32); - WRITE_RD(sext32(res)); -} diff --git a/riscv/insns/kslraw_u.h b/riscv/insns/kslraw_u.h deleted file mode 100644 index ebecb61..0000000 --- a/riscv/insns/kslraw_u.h +++ /dev/null @@ -1,14 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t rs1 = sext32(RS1); -sreg_t sa = int64_t(RS2) << (64 - 6) >> (64 - 6); - -if (sa < 0) { - sa = -sa; - sa = (sa == 32) ? 31 : sa; - WRITE_RD(sext32(((rs1 >> (sa - 1)) + 1)) >> 1); -} else { - auto res = rs1 << sa; - P_SAT(res, 32); - WRITE_RD(sext32(res)); -} diff --git a/riscv/insns/kstas16.h b/riscv/insns/kstas16.h deleted file mode 100644 index ad18013..0000000 --- a/riscv/insns/kstas16.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_STRAIGHT_ULOOP(16, { - bool sat = false; - pd = (sat_add<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_sub<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kstas32.h b/riscv/insns/kstas32.h deleted file mode 100644 index 35f23e0..0000000 --- a/riscv/insns/kstas32.h +++ /dev/null @@ -1,11 +0,0 @@ -require_vector_vs; -require_rv64; -P_STRAIGHT_ULOOP(32, { - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_sub<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kstsa16.h b/riscv/insns/kstsa16.h deleted file mode 100644 index 47a8918..0000000 --- a/riscv/insns/kstsa16.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_STRAIGHT_ULOOP(16, { - bool sat = false; - pd = (sat_sub<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_add<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/kstsa32.h b/riscv/insns/kstsa32.h deleted file mode 100644 index aa9c372..0000000 --- a/riscv/insns/kstsa32.h +++ /dev/null @@ -1,11 +0,0 @@ -require_vector_vs; -require_rv64; -P_STRAIGHT_ULOOP(32, { - bool sat = false; - pd = (sat_sub<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_add<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ksub16.h b/riscv/insns/ksub16.h deleted file mode 100644 index 57562b5..0000000 --- a/riscv/insns/ksub16.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_LOOP(16, { - bool sat = false; - pd = (sat_sub<int16_t, uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ksub32.h b/riscv/insns/ksub32.h deleted file mode 100644 index 3ef32e8..0000000 --- a/riscv/insns/ksub32.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -require_rv64; -P_LOOP(32, { - bool sat = false; - pd = (sat_sub<int32_t, uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ksub64.h b/riscv/insns/ksub64.h deleted file mode 100644 index c6f0994..0000000 --- a/riscv/insns/ksub64.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_64_PROFILE({ - bool sat = false; - rd = (sat_sub<int64_t, uint64_t>(rs1, rs2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ksub8.h b/riscv/insns/ksub8.h deleted file mode 100644 index 705f632..0000000 --- a/riscv/insns/ksub8.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_LOOP(8, { - bool sat = false; - pd = (sat_sub<int8_t, uint8_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ksubh.h b/riscv/insns/ksubh.h deleted file mode 100644 index 2455c16..0000000 --- a/riscv/insns/ksubh.h +++ /dev/null @@ -1,5 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_SH(RS1, 0) - (sreg_t)P_SH(RS2, 0); -P_SAT(res, 16); -WRITE_RD(sext_xlen((int16_t)res)); diff --git a/riscv/insns/ksubw.h b/riscv/insns/ksubw.h deleted file mode 100644 index 3a3d780..0000000 --- a/riscv/insns/ksubw.h +++ /dev/null @@ -1,5 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_SW(RS1, 0) - (sreg_t)P_SW(RS2, 0); -P_SAT(res, 32); -WRITE_RD(sext32(res)); diff --git a/riscv/insns/kwmmul.h b/riscv/insns/kwmmul.h deleted file mode 100644 index ca654f2..0000000 --- a/riscv/insns/kwmmul.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - if ((INT32_MIN != ps1) | (INT32_MIN != ps2)) { - int64_t mres = ((int64_t) ps1 * (int64_t) ps2) << 1; - pd = mres >> 32; - } else { - pd = INT32_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/kwmmul_u.h b/riscv/insns/kwmmul_u.h deleted file mode 100644 index b435561..0000000 --- a/riscv/insns/kwmmul_u.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_LOOP(32, { - if ((INT32_MIN != ps1) | (INT32_MIN != ps2)) { - int64_t mres = ((int64_t) ps1 * (int64_t) ps2) << 1; - pd = ((mres >> 31) + 1) >> 1; - } else { - pd = INT32_MAX; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/maddr32.h b/riscv/insns/maddr32.h deleted file mode 100644 index 943aeac..0000000 --- a/riscv/insns/maddr32.h +++ /dev/null @@ -1,5 +0,0 @@ -require_extension(EXT_ZPN); -reg_t mres = (reg_t)P_W(RS1, 0) * P_W(RS2, 0); -reg_t rd = P_W(RD, 0); -rd += mres; -WRITE_RD(sext_xlen((int32_t)rd)); diff --git a/riscv/insns/max.h b/riscv/insns/max.h index 073b8df..09f29f5 100644 --- a/riscv/insns/max.h +++ b/riscv/insns/max.h @@ -1,2 +1,2 @@ -require_either_extension(EXT_ZBPBO, EXT_ZBB); +require_extension(EXT_ZBB); WRITE_RD(sext_xlen(sreg_t(RS1) > sreg_t(RS2) ? RS1 : RS2)); diff --git a/riscv/insns/min.h b/riscv/insns/min.h index 47bc993..174e312 100644 --- a/riscv/insns/min.h +++ b/riscv/insns/min.h @@ -1,2 +1,2 @@ -require_either_extension(EXT_ZBPBO, EXT_ZBB); +require_extension(EXT_ZBB); WRITE_RD(sext_xlen(sreg_t(RS1) < sreg_t(RS2) ? RS1 : RS2)); diff --git a/riscv/insns/msubr32.h b/riscv/insns/msubr32.h deleted file mode 100644 index 2086bd1..0000000 --- a/riscv/insns/msubr32.h +++ /dev/null @@ -1,5 +0,0 @@ -require_extension(EXT_ZPN); -reg_t mres = (reg_t)P_W(RS1, 0) * P_W(RS2, 0); -reg_t rd = P_W(RD, 0); -rd -= mres; -WRITE_RD(sext_xlen((int32_t)rd)); diff --git a/riscv/insns/mulr64.h b/riscv/insns/mulr64.h deleted file mode 100644 index 4e2aad7..0000000 --- a/riscv/insns/mulr64.h +++ /dev/null @@ -1,3 +0,0 @@ -require_extension(EXT_ZPSFOPERAND); -reg_t rd = (reg_t)P_W(RS1, 0) * P_W(RS2, 0); -P_64_PROFILE_END(); diff --git a/riscv/insns/mulsr64.h b/riscv/insns/mulsr64.h deleted file mode 100644 index a2a5115..0000000 --- a/riscv/insns/mulsr64.h +++ /dev/null @@ -1,3 +0,0 @@ -require_extension(EXT_ZPSFOPERAND); -sreg_t rd = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 0); -P_64_PROFILE_END(); diff --git a/riscv/insns/pack.h b/riscv/insns/pack.h index 0622b92..acc4987 100644 --- a/riscv/insns/pack.h +++ b/riscv/insns/pack.h @@ -1,6 +1,5 @@ // RV32Zbb contains zext.h but not general pack require(((xlen == 32) && (insn.rs2() == 0) && p->extension_enabled(EXT_ZBB)) - || p->extension_enabled(EXT_ZPN) || p->extension_enabled(EXT_ZBKB)); reg_t lo = zext_xlen(RS1 << (xlen/2)) >> (xlen/2); reg_t hi = zext_xlen(RS2 << (xlen/2)); diff --git a/riscv/insns/packu.h b/riscv/insns/packu.h deleted file mode 100644 index 0676429..0000000 --- a/riscv/insns/packu.h +++ /dev/null @@ -1,4 +0,0 @@ -require_extension(EXT_ZPN); -reg_t lo = zext_xlen(RS1) >> (xlen/2); -reg_t hi = zext_xlen(RS2) >> (xlen/2) << (xlen/2); -WRITE_RD(sext_xlen(lo | hi)); diff --git a/riscv/insns/pbsad.h b/riscv/insns/pbsad.h deleted file mode 100644 index 32789ef..0000000 --- a/riscv/insns/pbsad.h +++ /dev/null @@ -1,3 +0,0 @@ -P_REDUCTION_ULOOP(64, 8, false, false, { - pd_res += (ps1 > ps2 ? ps1 - ps2 : ps2 - ps1); -}) diff --git a/riscv/insns/pbsada.h b/riscv/insns/pbsada.h deleted file mode 100644 index cab988e..0000000 --- a/riscv/insns/pbsada.h +++ /dev/null @@ -1,3 +0,0 @@ -P_REDUCTION_ULOOP(64, 8, true, false, { - pd_res += (ps1 > ps2 ? ps1 - ps2 : ps2 - ps1); -}) diff --git a/riscv/insns/pkbb16.h b/riscv/insns/pkbb16.h deleted file mode 100644 index 20dcde6..0000000 --- a/riscv/insns/pkbb16.h +++ /dev/null @@ -1,2 +0,0 @@ -require_rv64; -P_PK(16, 0, 0); diff --git a/riscv/insns/pkbt16.h b/riscv/insns/pkbt16.h deleted file mode 100644 index 8c51ab7..0000000 --- a/riscv/insns/pkbt16.h +++ /dev/null @@ -1 +0,0 @@ -P_PK(16, 0, 1); diff --git a/riscv/insns/pkbt32.h b/riscv/insns/pkbt32.h deleted file mode 100644 index 2783d98..0000000 --- a/riscv/insns/pkbt32.h +++ /dev/null @@ -1,2 +0,0 @@ -require_rv64; -P_PK(32, 0, 1); diff --git a/riscv/insns/pktb16.h b/riscv/insns/pktb16.h deleted file mode 100644 index c49c1ed..0000000 --- a/riscv/insns/pktb16.h +++ /dev/null @@ -1 +0,0 @@ -P_PK(16, 1, 0); diff --git a/riscv/insns/pktb32.h b/riscv/insns/pktb32.h deleted file mode 100644 index 0a7e17f..0000000 --- a/riscv/insns/pktb32.h +++ /dev/null @@ -1,2 +0,0 @@ -require_rv64; -P_PK(32, 1, 0); diff --git a/riscv/insns/pktt16.h b/riscv/insns/pktt16.h deleted file mode 100644 index b263ed4..0000000 --- a/riscv/insns/pktt16.h +++ /dev/null @@ -1,2 +0,0 @@ -require_rv64; -P_PK(16, 1, 1); diff --git a/riscv/insns/radd16.h b/riscv/insns/radd16.h deleted file mode 100644 index 8f80050..0000000 --- a/riscv/insns/radd16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(16, { - pd = (ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/radd32.h b/riscv/insns/radd32.h deleted file mode 100644 index df50dd1..0000000 --- a/riscv/insns/radd32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_LOOP(32, { - pd = ((int64_t)ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/radd64.h b/riscv/insns/radd64.h deleted file mode 100644 index 110c472..0000000 --- a/riscv/insns/radd64.h +++ /dev/null @@ -1,8 +0,0 @@ -P_64_PROFILE({ - rd = (rs1 + rs2) >> 1; - if (rs1 > 0 && rs2 > 0) { - rd &= ~((reg_t)1 << 63); - } else if (rs1 < 0 && rs2 < 0) { - rd |= ((reg_t)1 << 63); - } -}) diff --git a/riscv/insns/radd8.h b/riscv/insns/radd8.h deleted file mode 100644 index ad0b6ec..0000000 --- a/riscv/insns/radd8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(8, { - pd = (ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/raddw.h b/riscv/insns/raddw.h deleted file mode 100644 index ec04bb6..0000000 --- a/riscv/insns/raddw.h +++ /dev/null @@ -1,4 +0,0 @@ -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_SW(RS1, 0) + (sreg_t)P_SW(RS2, 0); -res >>= 1; -WRITE_RD(sext_xlen(res)); diff --git a/riscv/insns/rcras16.h b/riscv/insns/rcras16.h deleted file mode 100644 index 529c27f..0000000 --- a/riscv/insns/rcras16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_CROSS_LOOP(16, { - pd = (ps1 + ps2) >> 1; -}, { - pd = (ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/rcras32.h b/riscv/insns/rcras32.h deleted file mode 100644 index 86a3f65..0000000 --- a/riscv/insns/rcras32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_CROSS_LOOP(32, { - pd = ((int64_t)ps1 + ps2) >> 1; -}, { - pd = ((int64_t)ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/rcrsa16.h b/riscv/insns/rcrsa16.h deleted file mode 100644 index 156e32c..0000000 --- a/riscv/insns/rcrsa16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_CROSS_LOOP(16, { - pd = (ps1 - ps2) >> 1; -}, { - pd = (ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/rcrsa32.h b/riscv/insns/rcrsa32.h deleted file mode 100644 index b45f31f..0000000 --- a/riscv/insns/rcrsa32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_CROSS_LOOP(32, { - pd = ((uint64_t)ps1 - ps2) >> 1; -}, { - pd = ((uint64_t)ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/rstas16.h b/riscv/insns/rstas16.h deleted file mode 100644 index 298b591..0000000 --- a/riscv/insns/rstas16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_STRAIGHT_LOOP(16, { - pd = (ps1 + ps2) >> 1; -}, { - pd = (ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/rstas32.h b/riscv/insns/rstas32.h deleted file mode 100644 index 9c8995a..0000000 --- a/riscv/insns/rstas32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_STRAIGHT_LOOP(32, { - pd = ((int64_t)ps1 + ps2) >> 1; -}, { - pd = ((int64_t)ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/rstsa16.h b/riscv/insns/rstsa16.h deleted file mode 100644 index 443e4ce..0000000 --- a/riscv/insns/rstsa16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_STRAIGHT_LOOP(16, { - pd = (ps1 - ps2) >> 1; -}, { - pd = (ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/rstsa32.h b/riscv/insns/rstsa32.h deleted file mode 100644 index a89fc6e..0000000 --- a/riscv/insns/rstsa32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_STRAIGHT_LOOP(32, { - pd = ((int64_t)ps1 - ps2) >> 1; -}, { - pd = ((int64_t)ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/rsub16.h b/riscv/insns/rsub16.h deleted file mode 100644 index 768e067..0000000 --- a/riscv/insns/rsub16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(16, { - pd = (ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/rsub32.h b/riscv/insns/rsub32.h deleted file mode 100644 index 22c3119..0000000 --- a/riscv/insns/rsub32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_LOOP(32, { - pd = ((int64_t)ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/rsub64.h b/riscv/insns/rsub64.h deleted file mode 100644 index 2a58485..0000000 --- a/riscv/insns/rsub64.h +++ /dev/null @@ -1,8 +0,0 @@ -P_64_PROFILE({ - rd = (rs1 - rs2) >> 1; - if (rs1 > 0 && rs2 < 0) { - rd &= ~((reg_t)1 << 63); - } else if (rs1 < 0 && rs2 > 0) { - rd |= ((reg_t)1 << 63); - } -}) diff --git a/riscv/insns/rsub8.h b/riscv/insns/rsub8.h deleted file mode 100644 index 9cf9c1a..0000000 --- a/riscv/insns/rsub8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(8, { - pd = (ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/rsubw.h b/riscv/insns/rsubw.h deleted file mode 100644 index 01dec51..0000000 --- a/riscv/insns/rsubw.h +++ /dev/null @@ -1,4 +0,0 @@ -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_SW(RS1, 0) - (sreg_t)P_SW(RS2, 0); -res >>= 1; -WRITE_RD(sext_xlen(res)); diff --git a/riscv/insns/sclip16.h b/riscv/insns/sclip16.h deleted file mode 100644 index d90ce19..0000000 --- a/riscv/insns/sclip16.h +++ /dev/null @@ -1,14 +0,0 @@ -require_vector_vs; -P_I_LOOP(16, 4, { - int64_t int_max = INT64_MAX >> (64 - (imm4u + 1)); - int64_t int_min = INT64_MIN >> (64 - (imm4u + 1)); - pd = ps1; - - if (ps1 > int_max) { - pd = int_max; - P_SET_OV(1); - } else if (ps1 < int_min) { - pd = int_min; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/sclip32.h b/riscv/insns/sclip32.h deleted file mode 100644 index ff1ba28..0000000 --- a/riscv/insns/sclip32.h +++ /dev/null @@ -1,14 +0,0 @@ -require_vector_vs; -P_I_LOOP(32, 5, { - int64_t int_max = INT64_MAX >> (64 - (imm5u + 1)); - int64_t int_min = INT64_MIN >> (64 - (imm5u + 1)); - pd = ps1; - - if (ps1 > int_max) { - pd = int_max; - P_SET_OV(1); - } else if (ps1 < int_min) { - pd = int_min; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/sclip8.h b/riscv/insns/sclip8.h deleted file mode 100644 index afd9c69..0000000 --- a/riscv/insns/sclip8.h +++ /dev/null @@ -1,14 +0,0 @@ -require_vector_vs; -P_I_LOOP(8, 3, { - int64_t int_max = INT64_MAX >> (64 - (imm3u + 1)); - int64_t int_min = INT64_MIN >> (64 - (imm3u + 1)); - pd = ps1; - - if (ps1 > int_max) { - pd = int_max; - P_SET_OV(1); - } else if (ps1 < int_min) { - pd = int_min; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/scmple16.h b/riscv/insns/scmple16.h deleted file mode 100644 index 060c04c..0000000 --- a/riscv/insns/scmple16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(16, { - pd = (ps1 <= ps2) ? -1 : 0; -}) diff --git a/riscv/insns/scmple8.h b/riscv/insns/scmple8.h deleted file mode 100644 index 8920c1f..0000000 --- a/riscv/insns/scmple8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(8, { - pd = (ps1 <= ps2) ? -1 : 0; -}) diff --git a/riscv/insns/scmplt16.h b/riscv/insns/scmplt16.h deleted file mode 100644 index db62f6f..0000000 --- a/riscv/insns/scmplt16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(16, { - pd = (ps1 < ps2) ? -1 : 0; -}) diff --git a/riscv/insns/scmplt8.h b/riscv/insns/scmplt8.h deleted file mode 100644 index 7d07209..0000000 --- a/riscv/insns/scmplt8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(8, { - pd = (ps1 < ps2) ? -1 : 0; -}) diff --git a/riscv/insns/sll16.h b/riscv/insns/sll16.h deleted file mode 100644 index 9659f53..0000000 --- a/riscv/insns/sll16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_X_ULOOP(16, 4, { - pd = ps1 << sa; -}) diff --git a/riscv/insns/sll32.h b/riscv/insns/sll32.h deleted file mode 100644 index 8a05b39..0000000 --- a/riscv/insns/sll32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_X_ULOOP(32, 5, { - pd = ps1 << sa; -}) diff --git a/riscv/insns/sll8.h b/riscv/insns/sll8.h deleted file mode 100644 index b7f069a..0000000 --- a/riscv/insns/sll8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_X_ULOOP(8, 3, { - pd = ps1 << sa; -}) diff --git a/riscv/insns/slli16.h b/riscv/insns/slli16.h deleted file mode 100644 index 8d89a61..0000000 --- a/riscv/insns/slli16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_I_ULOOP(16, 4, { - pd = ps1 << imm4u; -}) diff --git a/riscv/insns/slli32.h b/riscv/insns/slli32.h deleted file mode 100644 index 71d880a..0000000 --- a/riscv/insns/slli32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_I_ULOOP(32, 5, { - pd = ps1 << imm5u; -}) diff --git a/riscv/insns/slli8.h b/riscv/insns/slli8.h deleted file mode 100644 index c997496..0000000 --- a/riscv/insns/slli8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_I_ULOOP(8, 3, { - pd = ps1 << imm3u; -}) diff --git a/riscv/insns/smal.h b/riscv/insns/smal.h deleted file mode 100644 index 09b818d..0000000 --- a/riscv/insns/smal.h +++ /dev/null @@ -1,11 +0,0 @@ -require_extension(EXT_ZPSFOPERAND); -sreg_t res = 0; -if (xlen == 32) { - res = RS1_PAIR; - res += sext_xlen(P_SH(RS2, 0) * P_SH(RS2, 1)); - WRITE_RD_PAIR(res); -} else { - res = sext_xlen(P_SH(RS2, 0) * P_SH(RS2, 1)) + - sext_xlen(P_SH(RS2, 2) * P_SH(RS2, 3)) + RS1; - WRITE_RD(res); -} diff --git a/riscv/insns/smalbb.h b/riscv/insns/smalbb.h deleted file mode 100644 index 9a2e799..0000000 --- a/riscv/insns/smalbb.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_PROFILE_REDUCTION(32, { - rd += (sreg_t)P_SH(ps1, 0) * (sreg_t)P_SH(ps2, 0); -}) diff --git a/riscv/insns/smalbt.h b/riscv/insns/smalbt.h deleted file mode 100644 index 42cf71c..0000000 --- a/riscv/insns/smalbt.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_PROFILE_REDUCTION(32, { - rd += (sreg_t)P_SH(ps1, 0) * (sreg_t)P_SH(ps2, 1); -}) diff --git a/riscv/insns/smalda.h b/riscv/insns/smalda.h deleted file mode 100644 index 8c06793..0000000 --- a/riscv/insns/smalda.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_PROFILE_REDUCTION(16, { - rd += ps1 * ps2; -}) diff --git a/riscv/insns/smaldrs.h b/riscv/insns/smaldrs.h deleted file mode 100644 index 84e1769..0000000 --- a/riscv/insns/smaldrs.h +++ /dev/null @@ -1,7 +0,0 @@ -P_64_PROFILE_REDUCTION(16, { - if (i & 1) { - rd -= ps1 * ps2; - } else { - rd += ps1 * ps2; - } -}) diff --git a/riscv/insns/smalds.h b/riscv/insns/smalds.h deleted file mode 100644 index e3cfbd7..0000000 --- a/riscv/insns/smalds.h +++ /dev/null @@ -1,7 +0,0 @@ -P_64_PROFILE_REDUCTION(16, { - if (i & 1) { - rd += ps1 * ps2; - } else { - rd -= ps1 * ps2; - } -}) diff --git a/riscv/insns/smaltt.h b/riscv/insns/smaltt.h deleted file mode 100644 index 1e654a0..0000000 --- a/riscv/insns/smaltt.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_PROFILE_REDUCTION(32, { - rd += P_SH(ps1, 1) * P_SH(ps2, 1); -}) diff --git a/riscv/insns/smalxda.h b/riscv/insns/smalxda.h deleted file mode 100644 index 77675ee..0000000 --- a/riscv/insns/smalxda.h +++ /dev/null @@ -1,4 +0,0 @@ -P_64_PROFILE_REDUCTION(32, { - rd += (sreg_t)P_SH(ps1, 0) * (sreg_t)P_SH(ps2, 1); - rd += (sreg_t)P_SH(ps1, 1) * (sreg_t)P_SH(ps2, 0); -}) diff --git a/riscv/insns/smalxds.h b/riscv/insns/smalxds.h deleted file mode 100644 index 2ae7eb5..0000000 --- a/riscv/insns/smalxds.h +++ /dev/null @@ -1,4 +0,0 @@ -P_64_PROFILE_REDUCTION(32, { - rd += (sreg_t)P_SH(ps1, 1) * (sreg_t)P_SH(ps2, 0); - rd -= (sreg_t)P_SH(ps1, 0) * (sreg_t)P_SH(ps2, 1); -}) diff --git a/riscv/insns/smaqa.h b/riscv/insns/smaqa.h deleted file mode 100644 index 83dda84..0000000 --- a/riscv/insns/smaqa.h +++ /dev/null @@ -1,3 +0,0 @@ -P_REDUCTION_LOOP(32, 8, true, false, { - pd_res += ps1 * ps2; -}) diff --git a/riscv/insns/smaqa_su.h b/riscv/insns/smaqa_su.h deleted file mode 100644 index 4ee0eb7..0000000 --- a/riscv/insns/smaqa_su.h +++ /dev/null @@ -1,3 +0,0 @@ -P_REDUCTION_SULOOP(32, 8, true, false, { - pd_res += ps1 * ps2; -}) diff --git a/riscv/insns/smar64.h b/riscv/insns/smar64.h deleted file mode 100644 index 5c5da77..0000000 --- a/riscv/insns/smar64.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_PROFILE_REDUCTION(32, { - rd += ps1 * ps2; -}) diff --git a/riscv/insns/smax16.h b/riscv/insns/smax16.h deleted file mode 100644 index 083d63c..0000000 --- a/riscv/insns/smax16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(16, { - pd = (ps1 > ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/smax32.h b/riscv/insns/smax32.h deleted file mode 100644 index 6563cfc..0000000 --- a/riscv/insns/smax32.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(32, { - pd = (ps1 > ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/smax8.h b/riscv/insns/smax8.h deleted file mode 100644 index 773039e..0000000 --- a/riscv/insns/smax8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(8, { - pd = (ps1 > ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/smbb16.h b/riscv/insns/smbb16.h deleted file mode 100644 index 0813bfb..0000000 --- a/riscv/insns/smbb16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(32, { - pd = P_SH(ps1, 0) * P_SH(ps2, 0); -}) diff --git a/riscv/insns/smbt16.h b/riscv/insns/smbt16.h deleted file mode 100644 index 953b3a6..0000000 --- a/riscv/insns/smbt16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(32, { - pd = P_SH(ps1, 0) * P_SH(ps2, 1); -}) diff --git a/riscv/insns/smbt32.h b/riscv/insns/smbt32.h deleted file mode 100644 index 35059ad..0000000 --- a/riscv/insns/smbt32.h +++ /dev/null @@ -1,3 +0,0 @@ -require_rv64; -require_extension(EXT_ZPN); -WRITE_RD((sreg_t)P_SW(RS1, 0) * P_SW(RS2, 1)); diff --git a/riscv/insns/smdrs.h b/riscv/insns/smdrs.h deleted file mode 100644 index 8f47f7d..0000000 --- a/riscv/insns/smdrs.h +++ /dev/null @@ -1,6 +0,0 @@ -P_REDUCTION_LOOP(32, 16, false, false, { - if (j & 1) - pd_res -= ps1 * ps2; - else - pd_res += ps1 * ps2; -}) diff --git a/riscv/insns/smdrs32.h b/riscv/insns/smdrs32.h deleted file mode 100644 index c397013..0000000 --- a/riscv/insns/smdrs32.h +++ /dev/null @@ -1,7 +0,0 @@ -require_rv64; -require_extension(EXT_ZPN); - -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 0); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 1); - -WRITE_RD(mres0 - mres1); diff --git a/riscv/insns/smds.h b/riscv/insns/smds.h deleted file mode 100644 index 248679a..0000000 --- a/riscv/insns/smds.h +++ /dev/null @@ -1,6 +0,0 @@ -P_REDUCTION_LOOP(32, 16, false, false, { - if (j & 1) - pd_res += ps1 * ps2; - else - pd_res -= ps1 * ps2; -}) diff --git a/riscv/insns/smds32.h b/riscv/insns/smds32.h deleted file mode 100644 index e7fdeed..0000000 --- a/riscv/insns/smds32.h +++ /dev/null @@ -1,7 +0,0 @@ -require_rv64; -require_extension(EXT_ZPN); - -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 0); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 1); - -WRITE_RD(mres1 - mres0); diff --git a/riscv/insns/smin16.h b/riscv/insns/smin16.h deleted file mode 100644 index afb1bb3..0000000 --- a/riscv/insns/smin16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(16, { - pd = (ps1 < ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/smin32.h b/riscv/insns/smin32.h deleted file mode 100644 index 22847cb..0000000 --- a/riscv/insns/smin32.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(32, { - pd = (ps1 < ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/smin8.h b/riscv/insns/smin8.h deleted file mode 100644 index 084e0e6..0000000 --- a/riscv/insns/smin8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(8, { - pd = (ps1 < ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/smmul.h b/riscv/insns/smmul.h deleted file mode 100644 index df0dd23..0000000 --- a/riscv/insns/smmul.h +++ /dev/null @@ -1,4 +0,0 @@ -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int64_t) ps2; - pd = mres >> 32; -}) diff --git a/riscv/insns/smmul_u.h b/riscv/insns/smmul_u.h deleted file mode 100644 index 55fa617..0000000 --- a/riscv/insns/smmul_u.h +++ /dev/null @@ -1,4 +0,0 @@ -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int64_t) ps2; - pd = ((mres >> 31) + 1) >> 1; -}) diff --git a/riscv/insns/smmwb.h b/riscv/insns/smmwb.h deleted file mode 100644 index f94aa9c..0000000 --- a/riscv/insns/smmwb.h +++ /dev/null @@ -1,4 +0,0 @@ -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int16_t) P_H(ps2, 0); - pd = mres >> 16; -}) diff --git a/riscv/insns/smmwb_u.h b/riscv/insns/smmwb_u.h deleted file mode 100644 index 47c6e36..0000000 --- a/riscv/insns/smmwb_u.h +++ /dev/null @@ -1,4 +0,0 @@ -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int16_t) P_H(ps2, 0); - pd = ((mres >> 15) + 1) >> 1; -}) diff --git a/riscv/insns/smmwt.h b/riscv/insns/smmwt.h deleted file mode 100644 index d8cf439..0000000 --- a/riscv/insns/smmwt.h +++ /dev/null @@ -1,4 +0,0 @@ -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int16_t) P_H(ps2, 1); - pd = mres >> 16; -}) diff --git a/riscv/insns/smmwt_u.h b/riscv/insns/smmwt_u.h deleted file mode 100644 index 5c5a671..0000000 --- a/riscv/insns/smmwt_u.h +++ /dev/null @@ -1,4 +0,0 @@ -P_LOOP(32, { - int64_t mres = (int64_t) ps1 * (int16_t) P_H(ps2, 1); - pd = ((mres >> 15) + 1) >> 1; -}) diff --git a/riscv/insns/smslda.h b/riscv/insns/smslda.h deleted file mode 100644 index f838960..0000000 --- a/riscv/insns/smslda.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_PROFILE_REDUCTION(16, { - rd -= ps1 * ps2; -}) diff --git a/riscv/insns/smslxda.h b/riscv/insns/smslxda.h deleted file mode 100644 index 7e25f9b..0000000 --- a/riscv/insns/smslxda.h +++ /dev/null @@ -1,4 +0,0 @@ -P_64_PROFILE_REDUCTION(32, { - rd -= (sreg_t)P_SH(ps1, 1) * (sreg_t)P_SH(ps2, 0); - rd -= (sreg_t)P_SH(ps1, 0) * (sreg_t)P_SH(ps2, 1); -}) diff --git a/riscv/insns/smsr64.h b/riscv/insns/smsr64.h deleted file mode 100644 index a43559f..0000000 --- a/riscv/insns/smsr64.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_PROFILE_REDUCTION(32, { - rd -= ps1 * ps2; -}) diff --git a/riscv/insns/smtt16.h b/riscv/insns/smtt16.h deleted file mode 100644 index e19c50a..0000000 --- a/riscv/insns/smtt16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(32, { - pd = P_SH(ps1, 1) * P_SH(ps2, 1); -}) diff --git a/riscv/insns/smtt32.h b/riscv/insns/smtt32.h deleted file mode 100644 index c7fd9e7..0000000 --- a/riscv/insns/smtt32.h +++ /dev/null @@ -1,3 +0,0 @@ -require_rv64; -require_extension(EXT_ZPN); -WRITE_RD((sreg_t)P_SW(RS1, 1) * P_SW(RS2, 1)); diff --git a/riscv/insns/smul16.h b/riscv/insns/smul16.h deleted file mode 100644 index 7e0f08a..0000000 --- a/riscv/insns/smul16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_MUL_LOOP(16, { - pd = (int32_t)ps1 * (int32_t)ps2; -}) diff --git a/riscv/insns/smul8.h b/riscv/insns/smul8.h deleted file mode 100644 index a4a3ed9..0000000 --- a/riscv/insns/smul8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_MUL_LOOP(8, { - pd = (int16_t)ps1 * (int16_t)ps2; -}) diff --git a/riscv/insns/smulx16.h b/riscv/insns/smulx16.h deleted file mode 100644 index 58e9a08..0000000 --- a/riscv/insns/smulx16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_MUL_CROSS_LOOP(16, { - pd = (int32_t)ps1 * (int32_t)ps2; -}) diff --git a/riscv/insns/smulx8.h b/riscv/insns/smulx8.h deleted file mode 100644 index 9270ce3..0000000 --- a/riscv/insns/smulx8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_MUL_CROSS_LOOP(8, { - pd = (int16_t)ps1 * (int16_t)ps2; -}) diff --git a/riscv/insns/smxds.h b/riscv/insns/smxds.h deleted file mode 100644 index 845d01f..0000000 --- a/riscv/insns/smxds.h +++ /dev/null @@ -1,6 +0,0 @@ -P_REDUCTION_CROSS_LOOP(32, 16, false, false, { - if (j & 1) - pd_res += ps1 * ps2; - else - pd_res -= ps1 * ps2; -}) diff --git a/riscv/insns/smxds32.h b/riscv/insns/smxds32.h deleted file mode 100644 index 8eeedcf..0000000 --- a/riscv/insns/smxds32.h +++ /dev/null @@ -1,7 +0,0 @@ -require_rv64; -require_extension(EXT_ZPN); - -sreg_t mres0 = (sreg_t)P_SW(RS1, 0) * P_SW(RS2, 1); -sreg_t mres1 = (sreg_t)P_SW(RS1, 1) * P_SW(RS2, 0); - -WRITE_RD(mres1 - mres0); diff --git a/riscv/insns/sra16.h b/riscv/insns/sra16.h deleted file mode 100644 index 84a40fb..0000000 --- a/riscv/insns/sra16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_X_LOOP(16, 4, { - pd = ps1 >> sa; -}) diff --git a/riscv/insns/sra16_u.h b/riscv/insns/sra16_u.h deleted file mode 100644 index 6fcc398..0000000 --- a/riscv/insns/sra16_u.h +++ /dev/null @@ -1,6 +0,0 @@ -P_X_LOOP(16, 4, { - if (sa > 0) - pd = ((ps1 >> (sa - 1)) + 1) >> 1; - else - pd = ps1; -}) diff --git a/riscv/insns/sra32.h b/riscv/insns/sra32.h deleted file mode 100644 index 8b192e0..0000000 --- a/riscv/insns/sra32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_X_LOOP(32, 5, { - pd = ps1 >> sa; -}) diff --git a/riscv/insns/sra32_u.h b/riscv/insns/sra32_u.h deleted file mode 100644 index 1a4488c..0000000 --- a/riscv/insns/sra32_u.h +++ /dev/null @@ -1,7 +0,0 @@ -require_rv64; -P_X_LOOP(32, 5, { - if (sa > 0) - pd = (((uint64_t)(ps1 >> (sa - 1))) + 1) >> 1; - else - pd = ps1; -}) diff --git a/riscv/insns/sra8.h b/riscv/insns/sra8.h deleted file mode 100644 index de1bd64..0000000 --- a/riscv/insns/sra8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_X_LOOP(8, 3, { - pd = ps1 >> sa; -}) diff --git a/riscv/insns/sra8_u.h b/riscv/insns/sra8_u.h deleted file mode 100644 index 1f47623..0000000 --- a/riscv/insns/sra8_u.h +++ /dev/null @@ -1,6 +0,0 @@ -P_X_LOOP(8, 3, { - if (sa > 0) - pd = ((ps1 >> (sa - 1)) + 1) >> 1; - else - pd = ps1; -}) diff --git a/riscv/insns/sra_u.h b/riscv/insns/sra_u.h deleted file mode 100644 index d7c395b..0000000 --- a/riscv/insns/sra_u.h +++ /dev/null @@ -1,9 +0,0 @@ -require_extension(EXT_ZPN); -sreg_t rs1 = sext_xlen(RS1); -reg_t sa = get_field(RS2, make_mask64(0, xlen == 32 ? 5 : 6)); - -if (sa > 0) { - WRITE_RD(sext_xlen(((rs1 >> (sa - 1)) + 1) >> 1)); -} else { - WRITE_RD(sext_xlen(rs1)); -} diff --git a/riscv/insns/srai16.h b/riscv/insns/srai16.h deleted file mode 100644 index 63f9807..0000000 --- a/riscv/insns/srai16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_I_LOOP(16, 4, { - pd = ps1 >> imm4u; -}) diff --git a/riscv/insns/srai16_u.h b/riscv/insns/srai16_u.h deleted file mode 100644 index d783581..0000000 --- a/riscv/insns/srai16_u.h +++ /dev/null @@ -1,6 +0,0 @@ -P_I_LOOP(16, 4, { - if (imm4u > 0) - pd = ((ps1 >> (imm4u - 1)) + 1) >> 1; - else - pd = ps1; -}) diff --git a/riscv/insns/srai32.h b/riscv/insns/srai32.h deleted file mode 100644 index 9058ba9..0000000 --- a/riscv/insns/srai32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_I_LOOP(32, 5, { - pd = ps1 >> imm5u; -}) diff --git a/riscv/insns/srai32_u.h b/riscv/insns/srai32_u.h deleted file mode 100644 index a5fe4d3..0000000 --- a/riscv/insns/srai32_u.h +++ /dev/null @@ -1,7 +0,0 @@ -require_rv64; -P_I_LOOP(32, 5, { - if (imm5u > 0) - pd = (((uint64_t)(ps1 >> (imm5u - 1))) + 1) >> 1; - else - pd = ps1; -}) diff --git a/riscv/insns/srai8.h b/riscv/insns/srai8.h deleted file mode 100644 index 0141933..0000000 --- a/riscv/insns/srai8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_I_LOOP(8, 3, { - pd = ps1 >> imm3u; -}) diff --git a/riscv/insns/srai8_u.h b/riscv/insns/srai8_u.h deleted file mode 100644 index be7bfaf..0000000 --- a/riscv/insns/srai8_u.h +++ /dev/null @@ -1,6 +0,0 @@ -P_I_LOOP(8, 3, { - if (imm3u > 0) - pd = ((ps1 >> (imm3u - 1)) + 1) >> 1; - else - pd = ps1; -}) diff --git a/riscv/insns/srai_u.h b/riscv/insns/srai_u.h deleted file mode 100644 index f170083..0000000 --- a/riscv/insns/srai_u.h +++ /dev/null @@ -1,10 +0,0 @@ -require_extension(EXT_ZPN); -sreg_t rs1 = sext_xlen(RS1); -reg_t sa = insn.p_imm6(); -require(sa < (unsigned long)xlen); // imm[5] == 1 is illegal on rv32 - -if (sa > 0) { - WRITE_RD(sext_xlen(((rs1 >> (sa - 1)) + 1) >> 1)); -} else { - WRITE_RD(sext_xlen(rs1)); -} diff --git a/riscv/insns/sraiw_u.h b/riscv/insns/sraiw_u.h deleted file mode 100644 index 3559d7f..0000000 --- a/riscv/insns/sraiw_u.h +++ /dev/null @@ -1,9 +0,0 @@ -require_rv64; -require_extension(EXT_ZPN); - -reg_t sa = insn.p_imm5(); -if (sa != 0) { - WRITE_RD(sext32(((P_SW(RS1, 0) >> (sa - 1)) + 1) >> 1)); -} else { - WRITE_RD(sext32(P_SW(RS1, 0))); -} diff --git a/riscv/insns/srl16.h b/riscv/insns/srl16.h deleted file mode 100644 index 35f9cec..0000000 --- a/riscv/insns/srl16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_X_ULOOP(16, 4, { - pd = ps1 >> sa; -}) diff --git a/riscv/insns/srl16_u.h b/riscv/insns/srl16_u.h deleted file mode 100644 index 17d1bc0..0000000 --- a/riscv/insns/srl16_u.h +++ /dev/null @@ -1,7 +0,0 @@ -P_X_ULOOP(16, 4, { - if (sa > 0) { - pd = ((ps1 >> (sa - 1)) + 1) >> 1; - } else { - pd = ps1; - } -}) diff --git a/riscv/insns/srl32.h b/riscv/insns/srl32.h deleted file mode 100644 index 2ad116c..0000000 --- a/riscv/insns/srl32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_X_ULOOP(32, 5, { - pd = ps1 >> sa; -}) diff --git a/riscv/insns/srl32_u.h b/riscv/insns/srl32_u.h deleted file mode 100644 index d637546..0000000 --- a/riscv/insns/srl32_u.h +++ /dev/null @@ -1,8 +0,0 @@ -require_rv64; -P_X_ULOOP(32, 5, { - if (sa > 0) { - pd = (((uint64_t)(ps1 >> (sa - 1))) + 1) >> 1; - } else { - pd = ps1; - } -}) diff --git a/riscv/insns/srl8.h b/riscv/insns/srl8.h deleted file mode 100644 index f7d74a9..0000000 --- a/riscv/insns/srl8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_X_ULOOP(8, 3, { - pd = ps1 >> sa; -}) diff --git a/riscv/insns/srl8_u.h b/riscv/insns/srl8_u.h deleted file mode 100644 index 26415a5..0000000 --- a/riscv/insns/srl8_u.h +++ /dev/null @@ -1,7 +0,0 @@ -P_X_ULOOP(8, 3, { - if (sa > 0) { - pd = ((ps1 >> (sa - 1)) + 1) >> 1; - } else { - pd = ps1; - } -}) diff --git a/riscv/insns/srli16.h b/riscv/insns/srli16.h deleted file mode 100644 index cbd685f..0000000 --- a/riscv/insns/srli16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_I_ULOOP(16, 4, { - pd = ps1 >> imm4u; -}) diff --git a/riscv/insns/srli16_u.h b/riscv/insns/srli16_u.h deleted file mode 100644 index 2ba533a..0000000 --- a/riscv/insns/srli16_u.h +++ /dev/null @@ -1,7 +0,0 @@ -P_I_ULOOP(16, 4, { - if (imm4u > 0) { - pd = ((ps1 >> (imm4u - 1)) + 1) >> 1; - } else { - pd = ps1; - } -}) diff --git a/riscv/insns/srli32.h b/riscv/insns/srli32.h deleted file mode 100644 index f3d53af..0000000 --- a/riscv/insns/srli32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_I_ULOOP(32, 5, { - pd = ps1 >> imm5u; -}) diff --git a/riscv/insns/srli32_u.h b/riscv/insns/srli32_u.h deleted file mode 100644 index 6d2327f..0000000 --- a/riscv/insns/srli32_u.h +++ /dev/null @@ -1,8 +0,0 @@ -require_rv64; -P_I_ULOOP(32, 5, { - if (imm5u > 0) { - pd = (((uint64_t)(ps1 >> (imm5u - 1))) + 1) >> 1; - } else { - pd = ps1; - } -}) diff --git a/riscv/insns/srli8.h b/riscv/insns/srli8.h deleted file mode 100644 index 103f0ed..0000000 --- a/riscv/insns/srli8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_I_ULOOP(8, 3, { - pd = ps1 >> imm3u; -}) diff --git a/riscv/insns/srli8_u.h b/riscv/insns/srli8_u.h deleted file mode 100644 index 9fa7f8c..0000000 --- a/riscv/insns/srli8_u.h +++ /dev/null @@ -1,7 +0,0 @@ -P_I_ULOOP(8, 3, { - if (imm3u > 0) { - pd = ((ps1 >> (imm3u - 1)) + 1) >> 1; - } else { - pd = ps1; - } -}) diff --git a/riscv/insns/stas16.h b/riscv/insns/stas16.h deleted file mode 100644 index 949e5c8..0000000 --- a/riscv/insns/stas16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_STRAIGHT_LOOP(16, { - pd = ps1 + ps2; -}, { - pd = ps1 - ps2; -}) diff --git a/riscv/insns/stas32.h b/riscv/insns/stas32.h deleted file mode 100644 index 2009a69..0000000 --- a/riscv/insns/stas32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_STRAIGHT_LOOP(32, { - pd = ps1 + ps2; -}, { - pd = ps1 - ps2; -}) diff --git a/riscv/insns/stsa16.h b/riscv/insns/stsa16.h deleted file mode 100644 index 7e4371d..0000000 --- a/riscv/insns/stsa16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_STRAIGHT_LOOP(16, { - pd = ps1 - ps2; -}, { - pd = ps1 + ps2; -}) diff --git a/riscv/insns/stsa32.h b/riscv/insns/stsa32.h deleted file mode 100644 index e2d81b7..0000000 --- a/riscv/insns/stsa32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_STRAIGHT_LOOP(32, { - pd = ps1 - ps2; -}, { - pd = ps1 + ps2; -}) diff --git a/riscv/insns/sub16.h b/riscv/insns/sub16.h deleted file mode 100644 index 5d36aaf..0000000 --- a/riscv/insns/sub16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(16, { - pd = ps1 - ps2; -}) diff --git a/riscv/insns/sub32.h b/riscv/insns/sub32.h deleted file mode 100644 index 70bbc53..0000000 --- a/riscv/insns/sub32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_LOOP(32, { - pd = ps1 - ps2; -}) diff --git a/riscv/insns/sub64.h b/riscv/insns/sub64.h deleted file mode 100644 index d977526..0000000 --- a/riscv/insns/sub64.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_PROFILE({ - rd = rs1 - rs2; -}) diff --git a/riscv/insns/sub8.h b/riscv/insns/sub8.h deleted file mode 100644 index 7f13d61..0000000 --- a/riscv/insns/sub8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_LOOP(8, { - pd = ps1 - ps2; -}) diff --git a/riscv/insns/sunpkd810.h b/riscv/insns/sunpkd810.h deleted file mode 100644 index 2a2f7c3..0000000 --- a/riscv/insns/sunpkd810.h +++ /dev/null @@ -1 +0,0 @@ -P_SUNPKD8(1, 0) diff --git a/riscv/insns/sunpkd820.h b/riscv/insns/sunpkd820.h deleted file mode 100644 index 84d5248..0000000 --- a/riscv/insns/sunpkd820.h +++ /dev/null @@ -1 +0,0 @@ -P_SUNPKD8(2, 0) diff --git a/riscv/insns/sunpkd830.h b/riscv/insns/sunpkd830.h deleted file mode 100644 index 8817907..0000000 --- a/riscv/insns/sunpkd830.h +++ /dev/null @@ -1 +0,0 @@ -P_SUNPKD8(3, 0) diff --git a/riscv/insns/sunpkd831.h b/riscv/insns/sunpkd831.h deleted file mode 100644 index 98ed748..0000000 --- a/riscv/insns/sunpkd831.h +++ /dev/null @@ -1 +0,0 @@ -P_SUNPKD8(3, 1) diff --git a/riscv/insns/sunpkd832.h b/riscv/insns/sunpkd832.h deleted file mode 100644 index b0ac29f..0000000 --- a/riscv/insns/sunpkd832.h +++ /dev/null @@ -1 +0,0 @@ -P_SUNPKD8(3, 2) diff --git a/riscv/insns/uclip16.h b/riscv/insns/uclip16.h deleted file mode 100644 index 4cc2519..0000000 --- a/riscv/insns/uclip16.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -P_I_LOOP(16, 4, { - int64_t uint_max = imm4u ? UINT64_MAX >> (64 - imm4u) : 0; - pd = ps1; - - if (ps1 > uint_max) { - pd = uint_max; - P_SET_OV(1); - } else if (ps1 < 0) { - pd = 0; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/uclip32.h b/riscv/insns/uclip32.h deleted file mode 100644 index d347650..0000000 --- a/riscv/insns/uclip32.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -P_I_LOOP(32, 5, { - int64_t uint_max = imm5u ? UINT64_MAX >> (64 - imm5u) : 0; - pd = ps1; - - if (ps1 > uint_max) { - pd = uint_max; - P_SET_OV(1); - } else if (ps1 < 0) { - pd = 0; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/uclip8.h b/riscv/insns/uclip8.h deleted file mode 100644 index b8a95c0..0000000 --- a/riscv/insns/uclip8.h +++ /dev/null @@ -1,13 +0,0 @@ -require_vector_vs; -P_I_LOOP(8, 3, { - int64_t uint_max = imm3u ? UINT64_MAX >> (64 - imm3u) : 0; - pd = ps1; - - if (ps1 > uint_max) { - pd = uint_max; - P_SET_OV(1); - } else if (ps1 < 0) { - pd = 0; - P_SET_OV(1); - } -}) diff --git a/riscv/insns/ucmple16.h b/riscv/insns/ucmple16.h deleted file mode 100644 index fe2b93f..0000000 --- a/riscv/insns/ucmple16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(16, { - pd = (ps1 <= ps2) ? -1 : 0; -}) diff --git a/riscv/insns/ucmple8.h b/riscv/insns/ucmple8.h deleted file mode 100644 index bd44cb0..0000000 --- a/riscv/insns/ucmple8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(8, { - pd = (ps1 <= ps2) ? -1 : 0; -}) diff --git a/riscv/insns/ucmplt16.h b/riscv/insns/ucmplt16.h deleted file mode 100644 index fa7512c..0000000 --- a/riscv/insns/ucmplt16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(16, { - pd = (ps1 < ps2) ? -1 : 0; -}) diff --git a/riscv/insns/ucmplt8.h b/riscv/insns/ucmplt8.h deleted file mode 100644 index 6fa85b1..0000000 --- a/riscv/insns/ucmplt8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(8, { - pd = (ps1 < ps2) ? -1 : 0; -}) diff --git a/riscv/insns/ukadd16.h b/riscv/insns/ukadd16.h deleted file mode 100644 index 680b5b6..0000000 --- a/riscv/insns/ukadd16.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_ULOOP(16, { - bool sat = false; - pd = (sat_addu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukadd32.h b/riscv/insns/ukadd32.h deleted file mode 100644 index dd836c1..0000000 --- a/riscv/insns/ukadd32.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -require_rv64; -P_ULOOP(32, { - bool sat = false; - pd = (sat_addu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukadd64.h b/riscv/insns/ukadd64.h deleted file mode 100644 index d7e98f3..0000000 --- a/riscv/insns/ukadd64.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_64_UPROFILE({ - bool sat = false; - rd = (sat_addu<uint64_t>(rs1, rs2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukadd8.h b/riscv/insns/ukadd8.h deleted file mode 100644 index 4bcada2..0000000 --- a/riscv/insns/ukadd8.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_ULOOP(8, { - bool sat = false; - pd = (sat_addu<uint8_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukaddh.h b/riscv/insns/ukaddh.h deleted file mode 100644 index 30c970a..0000000 --- a/riscv/insns/ukaddh.h +++ /dev/null @@ -1,5 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_H(RS1, 0) + (sreg_t)P_H(RS2, 0); -P_SATU(res, 16); -WRITE_RD(sext_xlen((int16_t)res)); diff --git a/riscv/insns/ukaddw.h b/riscv/insns/ukaddw.h deleted file mode 100644 index 5d4d91e..0000000 --- a/riscv/insns/ukaddw.h +++ /dev/null @@ -1,5 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_W(RS1, 0) + (sreg_t)P_W(RS2, 0); -P_SATU(res, 32); -WRITE_RD(sext32(res)); diff --git a/riscv/insns/ukcras16.h b/riscv/insns/ukcras16.h deleted file mode 100644 index 54b9a10..0000000 --- a/riscv/insns/ukcras16.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_CROSS_ULOOP(16, { - bool sat = false; - pd = (sat_addu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_subu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukcras32.h b/riscv/insns/ukcras32.h deleted file mode 100644 index 001644c..0000000 --- a/riscv/insns/ukcras32.h +++ /dev/null @@ -1,11 +0,0 @@ -require_vector_vs; -require_rv64; -P_CROSS_ULOOP(32, { - bool sat = false; - pd = (sat_addu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_subu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukcrsa16.h b/riscv/insns/ukcrsa16.h deleted file mode 100644 index 343063c..0000000 --- a/riscv/insns/ukcrsa16.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_CROSS_ULOOP(16, { - bool sat = false; - pd = (sat_subu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_addu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukcrsa32.h b/riscv/insns/ukcrsa32.h deleted file mode 100644 index 260f181..0000000 --- a/riscv/insns/ukcrsa32.h +++ /dev/null @@ -1,11 +0,0 @@ -require_vector_vs; -require_rv64; -P_CROSS_ULOOP(32, { - bool sat = false; - pd = (sat_subu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_addu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukmar64.h b/riscv/insns/ukmar64.h deleted file mode 100644 index e33ad7d..0000000 --- a/riscv/insns/ukmar64.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_64_UPROFILE_REDUCTION(32, { - bool sat = false; - rd = (sat_addu<uint64_t>(rd, ps1 * ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukmsr64.h b/riscv/insns/ukmsr64.h deleted file mode 100644 index 9a38cb0..0000000 --- a/riscv/insns/ukmsr64.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_64_UPROFILE_REDUCTION(32, { - bool sat = false; - rd = (sat_subu<uint64_t>(rd, ps1 * ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukstas16.h b/riscv/insns/ukstas16.h deleted file mode 100644 index a8203e4..0000000 --- a/riscv/insns/ukstas16.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_STRAIGHT_ULOOP(16, { - bool sat = false; - pd = (sat_addu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_subu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukstas32.h b/riscv/insns/ukstas32.h deleted file mode 100644 index c734eb6..0000000 --- a/riscv/insns/ukstas32.h +++ /dev/null @@ -1,11 +0,0 @@ -require_vector_vs; -require_rv64; -P_STRAIGHT_ULOOP(32, { - bool sat = false; - pd = (sat_addu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_subu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukstsa16.h b/riscv/insns/ukstsa16.h deleted file mode 100644 index 8145111..0000000 --- a/riscv/insns/ukstsa16.h +++ /dev/null @@ -1,10 +0,0 @@ -require_vector_vs; -P_STRAIGHT_ULOOP(16, { - bool sat = false; - pd = (sat_subu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_addu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/ukstsa32.h b/riscv/insns/ukstsa32.h deleted file mode 100644 index 9eb713e..0000000 --- a/riscv/insns/ukstsa32.h +++ /dev/null @@ -1,11 +0,0 @@ -require_vector_vs; -require_rv64; -P_STRAIGHT_ULOOP(32, { - bool sat = false; - pd = (sat_subu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}, { - bool sat = false; - pd = (sat_addu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/uksub16.h b/riscv/insns/uksub16.h deleted file mode 100644 index 7fba16e..0000000 --- a/riscv/insns/uksub16.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_ULOOP(16, { - bool sat = false; - pd = (sat_subu<uint16_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/uksub32.h b/riscv/insns/uksub32.h deleted file mode 100644 index 3d4913b..0000000 --- a/riscv/insns/uksub32.h +++ /dev/null @@ -1,7 +0,0 @@ -require_vector_vs; -require_rv64; -P_ULOOP(32, { - bool sat = false; - pd = (sat_subu<uint32_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/uksub64.h b/riscv/insns/uksub64.h deleted file mode 100644 index 0d2bb05..0000000 --- a/riscv/insns/uksub64.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_64_UPROFILE({ - bool sat = false; - rd = (sat_subu<uint64_t>(rs1, rs2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/uksub8.h b/riscv/insns/uksub8.h deleted file mode 100644 index f26621e..0000000 --- a/riscv/insns/uksub8.h +++ /dev/null @@ -1,6 +0,0 @@ -require_vector_vs; -P_ULOOP(8, { - bool sat = false; - pd = (sat_subu<uint8_t>(ps1, ps2, sat)); - P_SET_OV(sat); -}) diff --git a/riscv/insns/uksubh.h b/riscv/insns/uksubh.h deleted file mode 100644 index ac23989..0000000 --- a/riscv/insns/uksubh.h +++ /dev/null @@ -1,5 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_H(RS1, 0) - (sreg_t)P_H(RS2, 0); -P_SATU(res, 16); -WRITE_RD(sext_xlen((int16_t)res)); diff --git a/riscv/insns/uksubw.h b/riscv/insns/uksubw.h deleted file mode 100644 index 41a32e7..0000000 --- a/riscv/insns/uksubw.h +++ /dev/null @@ -1,5 +0,0 @@ -require_vector_vs; -require_extension(EXT_ZPN); -sreg_t res = (sreg_t)P_W(RS1, 0) - (sreg_t)P_W(RS2, 0); -P_SATU(res, 32); -WRITE_RD(sext32(res)); diff --git a/riscv/insns/umaqa.h b/riscv/insns/umaqa.h deleted file mode 100644 index 474b174..0000000 --- a/riscv/insns/umaqa.h +++ /dev/null @@ -1,3 +0,0 @@ -P_REDUCTION_ULOOP(32, 8, true, false, { - pd_res += ps1 * ps2; -}) diff --git a/riscv/insns/umar64.h b/riscv/insns/umar64.h deleted file mode 100644 index 0a8a352..0000000 --- a/riscv/insns/umar64.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_UPROFILE_REDUCTION(32, { - rd += ps1 * ps2; -}) diff --git a/riscv/insns/umax16.h b/riscv/insns/umax16.h deleted file mode 100644 index e60ed4a..0000000 --- a/riscv/insns/umax16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(16, { - pd = (ps1 > ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/umax32.h b/riscv/insns/umax32.h deleted file mode 100644 index 6156345..0000000 --- a/riscv/insns/umax32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_ULOOP(32, { - pd = (ps1 > ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/umax8.h b/riscv/insns/umax8.h deleted file mode 100644 index 8a575a6..0000000 --- a/riscv/insns/umax8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(8, { - pd = (ps1 > ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/umin16.h b/riscv/insns/umin16.h deleted file mode 100644 index d414211..0000000 --- a/riscv/insns/umin16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(16, { - pd = (ps1 < ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/umin32.h b/riscv/insns/umin32.h deleted file mode 100644 index 9669945..0000000 --- a/riscv/insns/umin32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_ULOOP(32, { - pd = (ps1 < ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/umin8.h b/riscv/insns/umin8.h deleted file mode 100644 index bea8ccd..0000000 --- a/riscv/insns/umin8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(8, { - pd = (ps1 < ps2) ? ps1 : ps2; -}) diff --git a/riscv/insns/umsr64.h b/riscv/insns/umsr64.h deleted file mode 100644 index 0e186d9..0000000 --- a/riscv/insns/umsr64.h +++ /dev/null @@ -1,3 +0,0 @@ -P_64_UPROFILE_REDUCTION(32, { - rd -= ps1 * ps2; -}) diff --git a/riscv/insns/umul16.h b/riscv/insns/umul16.h deleted file mode 100644 index 09b839c..0000000 --- a/riscv/insns/umul16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_MUL_ULOOP(16, { - pd = (uint32_t)ps1 * (uint32_t)ps2; -}) diff --git a/riscv/insns/umul8.h b/riscv/insns/umul8.h deleted file mode 100644 index 29cae88..0000000 --- a/riscv/insns/umul8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_MUL_ULOOP(8, { - pd = (uint16_t)ps1 * (uint16_t)ps2; -}) diff --git a/riscv/insns/umulx16.h b/riscv/insns/umulx16.h deleted file mode 100644 index 3f0cce8..0000000 --- a/riscv/insns/umulx16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_MUL_CROSS_ULOOP(16, { - pd = (uint32_t)ps1 * (uint32_t)ps2; -}) diff --git a/riscv/insns/umulx8.h b/riscv/insns/umulx8.h deleted file mode 100644 index 848b5d5..0000000 --- a/riscv/insns/umulx8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_MUL_CROSS_ULOOP(8, { - pd = (uint16_t)ps1 * (uint16_t)ps2; -}) diff --git a/riscv/insns/uradd16.h b/riscv/insns/uradd16.h deleted file mode 100644 index 29610bf..0000000 --- a/riscv/insns/uradd16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(16, { - pd = (ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/uradd32.h b/riscv/insns/uradd32.h deleted file mode 100644 index 4f791d9..0000000 --- a/riscv/insns/uradd32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_ULOOP(32, { - pd = ((uint64_t)ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/uradd64.h b/riscv/insns/uradd64.h deleted file mode 100644 index f6787e1..0000000 --- a/riscv/insns/uradd64.h +++ /dev/null @@ -1,9 +0,0 @@ -P_64_UPROFILE({ - rd = rs1 + rs2; - if (rd < rs1) { - rd >>= 1; - rd |= ((reg_t)1 << 63); - } else { - rd >>= 1; - } -}) diff --git a/riscv/insns/uradd8.h b/riscv/insns/uradd8.h deleted file mode 100644 index 412e3d5..0000000 --- a/riscv/insns/uradd8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(8, { - pd = (ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/uraddw.h b/riscv/insns/uraddw.h deleted file mode 100644 index 6a9455f..0000000 --- a/riscv/insns/uraddw.h +++ /dev/null @@ -1,4 +0,0 @@ -require_extension(EXT_ZPN); -reg_t res = (reg_t)P_W(RS1, 0) + (reg_t)P_W(RS2, 0); -res >>= 1; -WRITE_RD(sext_xlen((int32_t)res)); diff --git a/riscv/insns/urcras16.h b/riscv/insns/urcras16.h deleted file mode 100644 index 2bac315..0000000 --- a/riscv/insns/urcras16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_CROSS_ULOOP(16, { - pd = (ps1 + ps2) >> 1; -}, { - pd = (ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/urcras32.h b/riscv/insns/urcras32.h deleted file mode 100644 index a08e877..0000000 --- a/riscv/insns/urcras32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_CROSS_ULOOP(32, { - pd = ((uint64_t)ps1 + ps2) >> 1; -}, { - pd = ((uint64_t)ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/urcrsa16.h b/riscv/insns/urcrsa16.h deleted file mode 100644 index a890990..0000000 --- a/riscv/insns/urcrsa16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_CROSS_ULOOP(16, { - pd = (ps1 - ps2) >> 1; -}, { - pd = (ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/urcrsa32.h b/riscv/insns/urcrsa32.h deleted file mode 100644 index 7ddd4f9..0000000 --- a/riscv/insns/urcrsa32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_CROSS_ULOOP(32, { - pd = ((uint64_t)ps1 - ps2) >> 1; -}, { - pd = ((uint64_t)ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/urstas16.h b/riscv/insns/urstas16.h deleted file mode 100644 index 3cc89d8..0000000 --- a/riscv/insns/urstas16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_STRAIGHT_ULOOP(16, { - pd = (ps1 + ps2) >> 1; -}, { - pd = (ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/urstas32.h b/riscv/insns/urstas32.h deleted file mode 100644 index 668fa66..0000000 --- a/riscv/insns/urstas32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_STRAIGHT_ULOOP(32, { - pd = ((uint64_t)ps1 + ps2) >> 1; -}, { - pd = ((uint64_t)ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/urstsa16.h b/riscv/insns/urstsa16.h deleted file mode 100644 index a88bcf1..0000000 --- a/riscv/insns/urstsa16.h +++ /dev/null @@ -1,5 +0,0 @@ -P_STRAIGHT_ULOOP(16, { - pd = (ps1 - ps2) >> 1; -}, { - pd = (ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/urstsa32.h b/riscv/insns/urstsa32.h deleted file mode 100644 index 097337c..0000000 --- a/riscv/insns/urstsa32.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -P_STRAIGHT_ULOOP(32, { - pd = ((uint64_t)ps1 - ps2) >> 1; -}, { - pd = ((uint64_t)ps1 + ps2) >> 1; -}) diff --git a/riscv/insns/ursub16.h b/riscv/insns/ursub16.h deleted file mode 100644 index bcd09f0..0000000 --- a/riscv/insns/ursub16.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(16, { - pd = (ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/ursub32.h b/riscv/insns/ursub32.h deleted file mode 100644 index 215436d..0000000 --- a/riscv/insns/ursub32.h +++ /dev/null @@ -1,4 +0,0 @@ -require_rv64; -P_ULOOP(32, { - pd = ((uint64_t)ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/ursub64.h b/riscv/insns/ursub64.h deleted file mode 100644 index 3d845a0..0000000 --- a/riscv/insns/ursub64.h +++ /dev/null @@ -1,9 +0,0 @@ -P_64_UPROFILE({ - rd = rs1 - rs2; - if (rd > rs1) { - rd >>= 1; - rd |= ((reg_t)1 << 63); - } else { - rd >>= 1; - } -}) diff --git a/riscv/insns/ursub8.h b/riscv/insns/ursub8.h deleted file mode 100644 index d66a995..0000000 --- a/riscv/insns/ursub8.h +++ /dev/null @@ -1,3 +0,0 @@ -P_ULOOP(8, { - pd = (ps1 - ps2) >> 1; -}) diff --git a/riscv/insns/ursubw.h b/riscv/insns/ursubw.h deleted file mode 100644 index 5c90fde..0000000 --- a/riscv/insns/ursubw.h +++ /dev/null @@ -1,4 +0,0 @@ -require_extension(EXT_ZPN); -reg_t res = (reg_t)P_W(RS1, 0) - (reg_t)P_W(RS2, 0); -res >>= 1; -WRITE_RD(sext_xlen((int32_t)res)); diff --git a/riscv/insns/zunpkd810.h b/riscv/insns/zunpkd810.h deleted file mode 100644 index 88434de..0000000 --- a/riscv/insns/zunpkd810.h +++ /dev/null @@ -1 +0,0 @@ -P_ZUNPKD8(1, 0) diff --git a/riscv/insns/zunpkd820.h b/riscv/insns/zunpkd820.h deleted file mode 100644 index f206508..0000000 --- a/riscv/insns/zunpkd820.h +++ /dev/null @@ -1 +0,0 @@ -P_ZUNPKD8(2, 0) diff --git a/riscv/insns/zunpkd830.h b/riscv/insns/zunpkd830.h deleted file mode 100644 index 1365514..0000000 --- a/riscv/insns/zunpkd830.h +++ /dev/null @@ -1 +0,0 @@ -P_ZUNPKD8(3, 0) diff --git a/riscv/insns/zunpkd831.h b/riscv/insns/zunpkd831.h deleted file mode 100644 index 8febe77..0000000 --- a/riscv/insns/zunpkd831.h +++ /dev/null @@ -1 +0,0 @@ -P_ZUNPKD8(3, 1) diff --git a/riscv/insns/zunpkd832.h b/riscv/insns/zunpkd832.h deleted file mode 100644 index f14030b..0000000 --- a/riscv/insns/zunpkd832.h +++ /dev/null @@ -1 +0,0 @@ -P_ZUNPKD8(3, 2) diff --git a/riscv/isa_parser.h b/riscv/isa_parser.h index 72e8211..4bd9d4b 100644 --- a/riscv/isa_parser.h +++ b/riscv/isa_parser.h @@ -32,9 +32,6 @@ typedef enum { EXT_ZKSH, EXT_ZKR, EXT_ZMMUL, - EXT_ZBPBO, - EXT_ZPN, - EXT_ZPSFOPERAND, EXT_ZVFH, EXT_ZVFHMIN, EXT_SMEPMP, @@ -66,14 +63,6 @@ typedef enum { EXT_ZVKNHB, EXT_ZVKSED, EXT_ZVKSH, - EXT_XZBP, - EXT_XZBS, - EXT_XZBE, - EXT_XZBF, - EXT_XZBC, - EXT_XZBM, - EXT_XZBR, - EXT_XZBT, EXT_SSTC, EXT_ZAAMO, EXT_ZALRSC, diff --git a/riscv/overlap_list.h b/riscv/overlap_list.h index 6c943bd..04ae443 100644 --- a/riscv/overlap_list.h +++ b/riscv/overlap_list.h @@ -17,10 +17,6 @@ DECLARE_OVERLAP_INSN(vghsh_vv, EXT_ZVKG) DECLARE_OVERLAP_INSN(vsha2ms_vv, EXT_ZVKNHA) DECLARE_OVERLAP_INSN(vsha2ms_vv, EXT_ZVKNHB) DECLARE_OVERLAP_INSN(vsm3me_vv, EXT_ZVKSH) -DECLARE_OVERLAP_INSN(rstsa16, EXT_ZPN) -DECLARE_OVERLAP_INSN(rstsa32, EXT_ZPN) -DECLARE_OVERLAP_INSN(srli32_u, EXT_ZPN) -DECLARE_OVERLAP_INSN(umax32, EXT_ZPN) DECLARE_OVERLAP_INSN(lpad, EXT_ZICFILP) DECLARE_OVERLAP_INSN(mop_r_28, EXT_ZIMOP) DECLARE_OVERLAP_INSN(mop_r_N, EXT_ZIMOP) diff --git a/riscv/p_ext_macros.h b/riscv/p_ext_macros.h deleted file mode 100644 index 29437ad..0000000 --- a/riscv/p_ext_macros.h +++ /dev/null @@ -1,506 +0,0 @@ -// See LICENSE for license details. - -#ifndef _RISCV_P_EXT_MACROS_H -#define _RISCV_P_EXT_MACROS_H - -// The p-extension support is contributed by -// Programming Langauge Lab, Department of Computer Science, National Tsing-Hua University, Taiwan - -#define P_FIELD(R, INDEX, SIZE) \ - (type_sew_t<SIZE>::type)get_field(R, make_mask64(((INDEX) * SIZE), SIZE)) - -#define P_UFIELD(R, INDEX, SIZE) \ - (type_usew_t<SIZE>::type)get_field(R, make_mask64(((INDEX) * SIZE), SIZE)) - -#define P_B(R, INDEX) P_UFIELD(R, INDEX, 8) -#define P_H(R, INDEX) P_UFIELD(R, INDEX, 16) -#define P_W(R, INDEX) P_UFIELD(R, INDEX, 32) -#define P_SB(R, INDEX) P_FIELD(R, INDEX, 8) -#define P_SH(R, INDEX) P_FIELD(R, INDEX, 16) -#define P_SW(R, INDEX) P_FIELD(R, INDEX, 32) - -#define READ_REG_PAIR(reg) ({ \ - require((reg) % 2 == 0); \ - (reg) == 0 ? reg_t(0) : \ - (READ_REG((reg) + 1) << 32) + zext32(READ_REG(reg)); }) - -#define RS1_PAIR READ_REG_PAIR(insn.rs1()) -#define RS2_PAIR READ_REG_PAIR(insn.rs2()) -#define RD_PAIR READ_REG_PAIR(insn.rd()) - -#define WRITE_PD() \ - rd_tmp = set_field(rd_tmp, make_mask64((i * sizeof(pd) * 8), sizeof(pd) * 8), pd); - -#define WRITE_RD_PAIR(value) \ - if (insn.rd() != 0) { \ - require(insn.rd() % 2 == 0); \ - WRITE_REG(insn.rd(), sext32(value)); \ - WRITE_REG(insn.rd() + 1, (sreg_t(value)) >> 32); \ - } - -#define P_SET_OV(ov) \ - if (ov) P.VU.vxsat->write(1); - -#define P_SAT(R, BIT) \ - if (R > INT##BIT##_MAX) { \ - R = INT##BIT##_MAX; \ - P_SET_OV(1); \ - } else if (R < INT##BIT##_MIN) { \ - R = INT##BIT##_MIN; \ - P_SET_OV(1); \ - } - -#define P_SATU(R, BIT) \ - if (R > UINT##BIT##_MAX) { \ - R = UINT##BIT##_MAX; \ - P_SET_OV(1); \ - } else if (R < 0) { \ - P_SET_OV(1); \ - R = 0; \ - } - -#define P_LOOP_BASE(BIT) \ - require_extension(EXT_ZPN); \ - require(BIT == e8 || BIT == e16 || BIT == e32); \ - reg_t rd_tmp = RD; \ - reg_t rs1 = RS1; \ - reg_t rs2 = RS2; \ - sreg_t len = xlen / BIT; \ - for (sreg_t i = len - 1; i >= 0; --i) { - -#define P_ONE_LOOP_BASE(BIT) \ - require_extension(EXT_ZPN); \ - require(BIT == e8 || BIT == e16 || BIT == e32); \ - reg_t rd_tmp = RD; \ - reg_t rs1 = RS1; \ - sreg_t len = xlen / BIT; \ - for (sreg_t i = len - 1; i >= 0; --i) { - -#define P_I_LOOP_BASE(BIT, IMMBIT) \ - require_extension(EXT_ZPN); \ - require(BIT == e8 || BIT == e16 || BIT == e32); \ - reg_t rd_tmp = RD; \ - reg_t rs1 = RS1; \ - type_usew_t<BIT>::type imm##IMMBIT##u = insn.p_imm##IMMBIT(); \ - sreg_t len = xlen / BIT; \ - for (sreg_t i = len - 1; i >= 0; --i) { - -#define P_X_LOOP_BASE(BIT, LOWBIT) \ - require_extension(EXT_ZPN); \ - require(BIT == e8 || BIT == e16 || BIT == e32); \ - reg_t rd_tmp = RD; \ - reg_t rs1 = RS1; \ - type_usew_t<BIT>::type sa = RS2 & ((uint64_t(1) << LOWBIT) - 1); \ - type_sew_t<BIT>::type UNUSED ssa = int64_t(RS2) << (64 - LOWBIT) >> (64 - LOWBIT); \ - sreg_t len = xlen / BIT; \ - for (sreg_t i = len - 1; i >= 0; --i) { - -#define P_MUL_LOOP_BASE(BIT) \ - require_extension(EXT_ZPN); \ - require(BIT == e8 || BIT == e16 || BIT == e32); \ - reg_t rd_tmp = RD; \ - reg_t rs1 = RS1; \ - reg_t rs2 = RS2; \ - sreg_t len = 32 / BIT; \ - for (sreg_t i = len - 1; i >= 0; --i) { - -#define P_REDUCTION_LOOP_BASE(BIT, BIT_INNER, USE_RD) \ - require_extension(EXT_ZPN); \ - require(BIT == e16 || BIT == e32 || BIT == e64); \ - reg_t rd_tmp = USE_RD ? zext_xlen(RD) : 0; \ - reg_t rs1 = zext_xlen(RS1); \ - reg_t rs2 = zext_xlen(RS2); \ - sreg_t len = 64 / BIT; \ - sreg_t len_inner = BIT / BIT_INNER; \ - for (sreg_t i = len - 1; i >= 0; --i) { \ - sreg_t pd_res = P_FIELD(rd_tmp, i, BIT); \ - for (sreg_t j = i * len_inner; j < (i + 1) * len_inner; ++j) { - -#define P_REDUCTION_ULOOP_BASE(BIT, BIT_INNER, USE_RD) \ - require_extension(EXT_ZPN); \ - require(BIT == e16 || BIT == e32 || BIT == e64); \ - reg_t rd_tmp = USE_RD ? zext_xlen(RD) : 0; \ - reg_t rs1 = zext_xlen(RS1); \ - reg_t rs2 = zext_xlen(RS2); \ - sreg_t len = 64 / BIT; \ - sreg_t len_inner = BIT / BIT_INNER; \ - for (sreg_t i = len - 1; i >=0; --i) { \ - reg_t pd_res = P_UFIELD(rd_tmp, i, BIT); \ - for (sreg_t j = i * len_inner; j < (i + 1) * len_inner; ++j) { - -#define P_PARAMS(BIT) \ - auto pd = P_FIELD(rd_tmp, i, BIT); \ - auto ps1 = P_FIELD(rs1, i, BIT); \ - auto ps2 = P_FIELD(rs2, i, BIT); - -#define P_UPARAMS(BIT) \ - auto pd = P_UFIELD(rd_tmp, i, BIT); \ - auto ps1 = P_UFIELD(rs1, i, BIT); \ - auto ps2 = P_UFIELD(rs2, i, BIT); - -#define P_CORSS_PARAMS(BIT) \ - auto pd = P_FIELD(rd_tmp, i, BIT); \ - auto UNUSED ps1 = P_FIELD(rs1, i, BIT); \ - auto UNUSED ps2 = P_FIELD(rs2, (i ^ 1), BIT); - -#define P_CORSS_UPARAMS(BIT) \ - auto pd = P_UFIELD(rd_tmp, i, BIT); \ - auto ps1 = P_UFIELD(rs1, i, BIT); \ - auto ps2 = P_UFIELD(rs2, (i ^ 1), BIT); - -#define P_ONE_PARAMS(BIT) \ - auto pd = P_FIELD(rd_tmp, i, BIT); \ - auto ps1 = P_FIELD(rs1, i, BIT); - -#define P_ONE_UPARAMS(BIT) \ - auto pd = P_UFIELD(rd_tmp, i, BIT); \ - auto ps1 = P_UFIELD(rs1, i, BIT); - -#define P_ONE_SUPARAMS(BIT) \ - auto pd = P_UFIELD(rd_tmp, i, BIT); \ - auto ps1 = P_FIELD(rs1, i, BIT); - -#define P_MUL_PARAMS(BIT) \ - auto pd = P_FIELD(rd_tmp, i, BIT * 2); \ - auto ps1 = P_FIELD(rs1, i, BIT); \ - auto ps2 = P_FIELD(rs2, i, BIT); - -#define P_MUL_UPARAMS(BIT) \ - auto pd = P_UFIELD(rd_tmp, i, BIT * 2); \ - auto ps1 = P_UFIELD(rs1, i, BIT); \ - auto ps2 = P_UFIELD(rs2, i, BIT); - -#define P_MUL_CROSS_PARAMS(BIT) \ - auto pd = P_FIELD(rd_tmp, i, BIT * 2); \ - auto ps1 = P_FIELD(rs1, i, BIT); \ - auto ps2 = P_FIELD(rs2, (i ^ 1), BIT); - -#define P_MUL_CROSS_UPARAMS(BIT) \ - auto pd = P_UFIELD(rd_tmp, i, BIT*2); \ - auto ps1 = P_UFIELD(rs1, i, BIT); \ - auto ps2 = P_UFIELD(rs2, (i ^ 1), BIT); - -#define P_REDUCTION_PARAMS(BIT_INNER) \ - auto ps1 = P_FIELD(rs1, j, BIT_INNER); \ - auto ps2 = P_FIELD(rs2, j, BIT_INNER); - -#define P_REDUCTION_UPARAMS(BIT_INNER) \ - auto ps1 = P_UFIELD(rs1, j, BIT_INNER); \ - auto ps2 = P_UFIELD(rs2, j, BIT_INNER); - -#define P_REDUCTION_SUPARAMS(BIT_INNER) \ - auto ps1 = P_FIELD(rs1, j, BIT_INNER); \ - auto ps2 = P_UFIELD(rs2, j, BIT_INNER); - -#define P_REDUCTION_CROSS_PARAMS(BIT_INNER) \ - auto ps1 = P_FIELD(rs1, j, BIT_INNER); \ - auto ps2 = P_FIELD(rs2, (j ^ 1), BIT_INNER); - -#define P_LOOP_BODY(BIT, BODY) { \ - P_PARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_ULOOP_BODY(BIT, BODY) { \ - P_UPARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_ONE_LOOP_BODY(BIT, BODY) { \ - P_ONE_PARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_CROSS_LOOP_BODY(BIT, BODY) { \ - P_CORSS_PARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_CROSS_ULOOP_BODY(BIT, BODY) { \ - P_CORSS_UPARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_ONE_ULOOP_BODY(BIT, BODY) { \ - P_ONE_UPARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_MUL_LOOP_BODY(BIT, BODY) { \ - P_MUL_PARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_MUL_ULOOP_BODY(BIT, BODY) { \ - P_MUL_UPARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_MUL_CROSS_LOOP_BODY(BIT, BODY) { \ - P_MUL_CROSS_PARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_MUL_CROSS_ULOOP_BODY(BIT, BODY) { \ - P_MUL_CROSS_UPARAMS(BIT) \ - BODY \ - WRITE_PD(); \ -} - -#define P_LOOP(BIT, BODY) \ - P_LOOP_BASE(BIT) \ - P_LOOP_BODY(BIT, BODY) \ - P_LOOP_END() - -#define P_ONE_LOOP(BIT, BODY) \ - P_ONE_LOOP_BASE(BIT) \ - P_ONE_LOOP_BODY(BIT, BODY) \ - P_LOOP_END() - -#define P_ULOOP(BIT, BODY) \ - P_LOOP_BASE(BIT) \ - P_ULOOP_BODY(BIT, BODY) \ - P_LOOP_END() - -#define P_CROSS_LOOP(BIT, BODY1, BODY2) \ - P_LOOP_BASE(BIT) \ - P_CROSS_LOOP_BODY(BIT, BODY1) \ - --i; \ - if (sizeof(#BODY2) == 1) { \ - P_CROSS_LOOP_BODY(BIT, BODY1) \ - } \ - else { \ - P_CROSS_LOOP_BODY(BIT, BODY2) \ - } \ - P_LOOP_END() - -#define P_CROSS_ULOOP(BIT, BODY1, BODY2) \ - P_LOOP_BASE(BIT) \ - P_CROSS_ULOOP_BODY(BIT, BODY1) \ - --i; \ - P_CROSS_ULOOP_BODY(BIT, BODY2) \ - P_LOOP_END() - -#define P_STRAIGHT_LOOP(BIT, BODY1, BODY2) \ - P_LOOP_BASE(BIT) \ - P_LOOP_BODY(BIT, BODY1) \ - --i; \ - P_LOOP_BODY(BIT, BODY2) \ - P_LOOP_END() - -#define P_STRAIGHT_ULOOP(BIT, BODY1, BODY2) \ - P_LOOP_BASE(BIT) \ - P_ULOOP_BODY(BIT, BODY1) \ - --i; \ - P_ULOOP_BODY(BIT, BODY2) \ - P_LOOP_END() - -#define P_X_LOOP(BIT, RS2_LOW_BIT, BODY) \ - P_X_LOOP_BASE(BIT, RS2_LOW_BIT) \ - P_ONE_LOOP_BODY(BIT, BODY) \ - P_LOOP_END() - -#define P_X_ULOOP(BIT, RS2_LOW_BIT, BODY) \ - P_X_LOOP_BASE(BIT, RS2_LOW_BIT) \ - P_ONE_ULOOP_BODY(BIT, BODY) \ - P_LOOP_END() - -#define P_I_LOOP(BIT, IMMBIT, BODY) \ - P_I_LOOP_BASE(BIT, IMMBIT) \ - P_ONE_LOOP_BODY(BIT, BODY) \ - P_LOOP_END() - -#define P_I_ULOOP(BIT, IMMBIT, BODY) \ - P_I_LOOP_BASE(BIT, IMMBIT) \ - P_ONE_ULOOP_BODY(BIT, BODY) \ - P_LOOP_END() - -#define P_MUL_LOOP(BIT, BODY) \ - P_MUL_LOOP_BASE(BIT) \ - P_MUL_LOOP_BODY(BIT, BODY) \ - P_PAIR_LOOP_END() - -#define P_MUL_ULOOP(BIT, BODY) \ - P_MUL_LOOP_BASE(BIT) \ - P_MUL_ULOOP_BODY(BIT, BODY) \ - P_PAIR_LOOP_END() - -#define P_MUL_CROSS_LOOP(BIT, BODY) \ - P_MUL_LOOP_BASE(BIT) \ - P_MUL_CROSS_LOOP_BODY(BIT, BODY) \ - P_PAIR_LOOP_END() - -#define P_MUL_CROSS_ULOOP(BIT, BODY) \ - P_MUL_LOOP_BASE(BIT) \ - P_MUL_CROSS_ULOOP_BODY(BIT, BODY) \ - P_PAIR_LOOP_END() - -#define P_REDUCTION_LOOP(BIT, BIT_INNER, USE_RD, IS_SAT, BODY) \ - P_REDUCTION_LOOP_BASE(BIT, BIT_INNER, USE_RD) \ - P_REDUCTION_PARAMS(BIT_INNER) \ - BODY \ - P_REDUCTION_LOOP_END(BIT, IS_SAT) - -#define P_REDUCTION_ULOOP(BIT, BIT_INNER, USE_RD, IS_SAT, BODY) \ - P_REDUCTION_ULOOP_BASE(BIT, BIT_INNER, USE_RD) \ - P_REDUCTION_UPARAMS(BIT_INNER) \ - BODY \ - P_REDUCTION_ULOOP_END(BIT, IS_SAT) - -#define P_REDUCTION_SULOOP(BIT, BIT_INNER, USE_RD, IS_SAT, BODY) \ - P_REDUCTION_LOOP_BASE(BIT, BIT_INNER, USE_RD) \ - P_REDUCTION_SUPARAMS(BIT_INNER) \ - BODY \ - P_REDUCTION_LOOP_END(BIT, IS_SAT) - -#define P_REDUCTION_CROSS_LOOP(BIT, BIT_INNER, USE_RD, IS_SAT, BODY) \ - P_REDUCTION_LOOP_BASE(BIT, BIT_INNER, USE_RD) \ - P_REDUCTION_CROSS_PARAMS(BIT_INNER) \ - BODY \ - P_REDUCTION_LOOP_END(BIT, IS_SAT) - -#define P_LOOP_END() \ - } \ - WRITE_RD(sext_xlen(rd_tmp)); - -#define P_PAIR_LOOP_END() \ - } \ - if (xlen == 32) { \ - WRITE_RD_PAIR(rd_tmp); \ - } \ - else { \ - WRITE_RD(sext_xlen(rd_tmp)); \ - } - -#define P_REDUCTION_LOOP_END(BIT, IS_SAT) \ - } \ - if (IS_SAT) { \ - P_SAT(pd_res, BIT); \ - } \ - type_usew_t<BIT>::type pd = pd_res; \ - WRITE_PD(); \ - } \ - WRITE_RD(sext_xlen(rd_tmp)); - -#define P_REDUCTION_ULOOP_END(BIT, IS_SAT) \ - } \ - if (IS_SAT) { \ - P_SATU(pd_res, BIT); \ - } \ - type_usew_t<BIT>::type pd = pd_res; \ - WRITE_PD(); \ - } \ - WRITE_RD(sext_xlen(rd_tmp)); - -#define P_SUNPKD8(X, Y) \ - require_extension(EXT_ZPN); \ - reg_t rd_tmp = 0; \ - int16_t pd[4] = { \ - P_SB(RS1, Y), \ - P_SB(RS1, X), \ - P_SB(RS1, Y + 4), \ - P_SB(RS1, X + 4), \ - }; \ - if (xlen == 64) { \ - memcpy(&rd_tmp, pd, 8); \ - } else { \ - memcpy(&rd_tmp, pd, 4); \ - } \ - WRITE_RD(sext_xlen(rd_tmp)); - -#define P_ZUNPKD8(X, Y) \ - require_extension(EXT_ZPN); \ - reg_t rd_tmp = 0; \ - uint16_t pd[4] = { \ - P_B(RS1, Y), \ - P_B(RS1, X), \ - P_B(RS1, Y + 4), \ - P_B(RS1, X + 4), \ - }; \ - if (xlen == 64) { \ - memcpy(&rd_tmp, pd, 8); \ - } else { \ - memcpy(&rd_tmp, pd, 4); \ - } \ - WRITE_RD(sext_xlen(rd_tmp)); - -#define P_PK(BIT, X, Y) \ - require_extension(EXT_ZPN); \ - require(BIT == e16 || BIT == e32); \ - reg_t rd_tmp = 0, UNUSED rs1 = RS1, UNUSED rs2 = RS2; \ - for (sreg_t i = 0; i < xlen / BIT / 2; i++) { \ - rd_tmp = set_field(rd_tmp, make_mask64(i * 2 * BIT, BIT), \ - P_UFIELD(RS2, i * 2 + Y, BIT)); \ - rd_tmp = set_field(rd_tmp, make_mask64((i * 2 + 1) * BIT, BIT), \ - P_UFIELD(RS1, i * 2 + X, BIT)); \ - } \ - WRITE_RD(sext_xlen(rd_tmp)); - -#define P_64_PROFILE_BASE() \ - require_extension(EXT_ZPSFOPERAND); \ - sreg_t rd, rs1, rs2; - -#define P_64_UPROFILE_BASE() \ - require_extension(EXT_ZPSFOPERAND); \ - reg_t rd, rs1, rs2; - -#define P_64_PROFILE_PARAM(USE_RD, INPUT_PAIR) \ - if (xlen == 32) { \ - rs1 = INPUT_PAIR ? RS1_PAIR : RS1; \ - rs2 = INPUT_PAIR ? RS2_PAIR : RS2; \ - rd = USE_RD ? RD_PAIR : 0; \ - } else { \ - rs1 = RS1; \ - rs2 = RS2; \ - rd = USE_RD ? RD : 0; \ - } - -#define P_64_PROFILE(BODY) \ - P_64_PROFILE_BASE() \ - P_64_PROFILE_PARAM(false, true) \ - BODY \ - P_64_PROFILE_END() \ - -#define P_64_UPROFILE(BODY) \ - P_64_UPROFILE_BASE() \ - P_64_PROFILE_PARAM(false, true) \ - BODY \ - P_64_PROFILE_END() \ - -#define P_64_PROFILE_REDUCTION(BIT, BODY) \ - P_64_PROFILE_BASE() \ - P_64_PROFILE_PARAM(true, false) \ - for (sreg_t i = 0; i < xlen / BIT; i++) { \ - sreg_t ps1 = P_FIELD(rs1, i, BIT); \ - sreg_t ps2 = P_FIELD(rs2, i, BIT); \ - BODY \ - } \ - P_64_PROFILE_END() \ - -#define P_64_UPROFILE_REDUCTION(BIT, BODY) \ - P_64_UPROFILE_BASE() \ - P_64_PROFILE_PARAM(true, false) \ - for (sreg_t i = 0; i < xlen / BIT; i++) { \ - reg_t ps1 = P_UFIELD(rs1, i, BIT); \ - reg_t ps2 = P_UFIELD(rs2, i, BIT); \ - BODY \ - } \ - P_64_PROFILE_END() \ - -#define P_64_PROFILE_END() \ - if (xlen == 32) { \ - WRITE_RD_PAIR(rd); \ - } else { \ - WRITE_RD(sext_xlen(rd)); \ - } - -#endif diff --git a/riscv/riscv.mk.in b/riscv/riscv.mk.in index f388426..6db6fa9 100644 --- a/riscv/riscv.mk.in +++ b/riscv/riscv.mk.in @@ -403,12 +403,8 @@ riscv_insn_ext_b = \ clmulr \ clz \ clzw \ - cmix \ ctz \ ctzw \ - fsr \ - fsri \ - fsrw \ gorci \ grevi \ max \ @@ -418,7 +414,6 @@ riscv_insn_ext_b = \ orn \ pack \ packh \ - packu \ packw \ cpop \ cpopw \ @@ -883,336 +878,6 @@ riscv_insn_ext_h = \ hsv_w \ hsv_d \ -riscv_insn_ext_p_simd = \ - add16 \ - radd16 \ - uradd16 \ - kadd16 \ - ukadd16 \ - sub16 \ - rsub16 \ - ursub16 \ - ksub16 \ - uksub16 \ - cras16 \ - rcras16 \ - urcras16 \ - kcras16 \ - ukcras16 \ - crsa16 \ - rcrsa16 \ - urcrsa16 \ - kcrsa16 \ - ukcrsa16 \ - stas16 \ - rstas16 \ - urstas16 \ - kstas16 \ - ukstas16 \ - stsa16 \ - rstsa16 \ - urstsa16 \ - kstsa16 \ - ukstsa16 \ - add8 \ - radd8 \ - uradd8 \ - kadd8 \ - ukadd8 \ - sub8 \ - rsub8 \ - ursub8 \ - ksub8 \ - uksub8 \ - sra16 \ - srai16 \ - sra16_u \ - srai16_u \ - srl16 \ - srli16 \ - srl16_u \ - srli16_u \ - sll16 \ - slli16 \ - ksll16 \ - kslli16 \ - kslra16 \ - kslra16_u \ - sra8 \ - srai8 \ - sra8_u \ - srai8_u \ - srl8 \ - srli8 \ - srl8_u \ - srli8_u \ - sll8 \ - slli8 \ - ksll8 \ - kslli8 \ - kslra8 \ - kslra8_u \ - cmpeq16 \ - scmplt16 \ - scmple16 \ - ucmplt16 \ - ucmple16 \ - cmpeq8 \ - scmplt8 \ - scmple8 \ - ucmplt8 \ - ucmple8 \ - smul16 \ - smulx16 \ - umul16 \ - umulx16 \ - khm16 \ - khmx16 \ - smul8 \ - smulx8 \ - umul8 \ - umulx8 \ - khm8 \ - khmx8 \ - smin16 \ - umin16 \ - smax16 \ - umax16 \ - sclip16 \ - uclip16 \ - kabs16 \ - clrs16 \ - clz16 \ - smin8 \ - umin8 \ - smax8 \ - umax8 \ - sclip8 \ - uclip8 \ - kabs8 \ - clrs8 \ - clz8 \ - sunpkd810 \ - sunpkd820 \ - sunpkd830 \ - sunpkd831 \ - sunpkd832 \ - zunpkd810 \ - zunpkd820 \ - zunpkd830 \ - zunpkd831 \ - zunpkd832 \ - -riscv_insn_ext_p_partial_simd = \ - pkbb16 \ - pkbt16 \ - pktb16 \ - pktt16 \ - smmul \ - smmul_u \ - kmmac \ - kmmac_u \ - kmmsb \ - kmmsb_u \ - kwmmul \ - kwmmul_u \ - smmwb \ - smmwb_u \ - smmwt \ - smmwt_u \ - kmmawb \ - kmmawb_u \ - kmmawt \ - kmmawt_u \ - kmmwb2 \ - kmmwb2_u \ - kmmwt2 \ - kmmwt2_u \ - kmmawb2 \ - kmmawb2_u \ - kmmawt2 \ - kmmawt2_u \ - smbb16 \ - smbt16 \ - smtt16 \ - kmda \ - kmxda \ - smds \ - smdrs \ - smxds \ - kmabb \ - kmabt \ - kmatt \ - kmada \ - kmaxda \ - kmads \ - kmadrs \ - kmaxds \ - kmsda \ - kmsxda \ - smal \ - sclip32 \ - uclip32 \ - clrs32 \ - pbsad \ - pbsada \ - smaqa \ - umaqa \ - smaqa_su \ - -riscv_insn_ext_p_64_bit_profile = \ - add64 \ - radd64 \ - uradd64 \ - kadd64 \ - ukadd64 \ - sub64 \ - rsub64 \ - ursub64 \ - ksub64 \ - uksub64 \ - smar64 \ - smsr64 \ - umar64 \ - umsr64 \ - kmar64 \ - kmsr64 \ - ukmar64 \ - ukmsr64 \ - smalbb \ - smalbt \ - smaltt \ - smalda \ - smalxda \ - smalds \ - smaldrs \ - smalxds \ - smslda \ - smslxda \ - -riscv_insn_ext_p_non_simd = \ - kaddh \ - ksubh \ - khmbb \ - khmbt \ - khmtt \ - ukaddh \ - uksubh \ - kaddw \ - ukaddw \ - ksubw \ - uksubw \ - kdmbb \ - kdmbt \ - kdmtt \ - kslraw \ - kslraw_u \ - ksllw \ - kslliw \ - kdmabb \ - kdmabt \ - kdmatt \ - kabsw \ - raddw \ - uraddw \ - rsubw \ - ursubw \ - mulr64 \ - mulsr64 \ - msubr32 \ - ave \ - sra_u \ - srai_u \ - insb \ - maddr32 \ - -riscv_insn_ext_p_rv64_only = \ - add32 \ - radd32 \ - uradd32 \ - kadd32 \ - ukadd32 \ - sub32 \ - rsub32 \ - ursub32 \ - ksub32 \ - uksub32 \ - cras32 \ - rcras32 \ - urcras32 \ - kcras32 \ - ukcras32 \ - crsa32 \ - rcrsa32 \ - urcrsa32 \ - kcrsa32 \ - ukcrsa32 \ - stas32 \ - rstas32 \ - urstas32 \ - kstas32 \ - ukstas32 \ - stsa32 \ - rstsa32 \ - urstsa32 \ - kstsa32 \ - ukstsa32 \ - sra32 \ - srai32 \ - sra32_u \ - srai32_u \ - srl32 \ - srli32 \ - srl32_u \ - srli32_u \ - sll32 \ - slli32 \ - ksll32 \ - kslli32 \ - kslra32 \ - kslra32_u \ - smin32 \ - umin32 \ - smax32 \ - umax32 \ - kabs32 \ - khmbb16 \ - khmbt16 \ - khmtt16 \ - kdmbb16 \ - kdmbt16 \ - kdmtt16 \ - kdmabb16 \ - kdmabt16 \ - kdmatt16 \ - smbt32 \ - smtt32 \ - kmabb32 \ - kmabt32 \ - kmatt32 \ - kmda32 \ - kmxda32 \ - kmaxda32 \ - kmads32 \ - kmadrs32 \ - kmaxds32 \ - kmsda32 \ - kmsxda32 \ - smds32 \ - smdrs32 \ - smxds32 \ - sraiw_u \ - pkbt32 \ - pktb32 \ - clz32 \ - -riscv_insn_ext_p = \ - $(riscv_insn_ext_p_simd) \ - $(riscv_insn_ext_p_partial_simd) \ - $(riscv_insn_ext_p_64_bit_profile) \ - $(riscv_insn_ext_p_non_simd) \ - $(riscv_insn_ext_p_rv64_only) \ - riscv_insn_priv = \ csrrc \ csrrci \ @@ -1430,7 +1095,6 @@ riscv_insn_list = \ $(riscv_insn_ext_i) \ $(riscv_insn_ext_k) \ $(riscv_insn_ext_m) \ - $(riscv_insn_ext_p) \ $(riscv_insn_ext_q) \ $(riscv_insn_ext_q_zfa) \ $(riscv_insn_ext_zacas) \ diff --git a/riscv/v_ext_macros.h b/riscv/v_ext_macros.h index 42d723a..8f9820d 100644 --- a/riscv/v_ext_macros.h +++ b/riscv/v_ext_macros.h @@ -2112,4 +2112,7 @@ reg_t index[P.VU.vlmax]; \ break; \ } +#define P_SET_OV(ov) \ + if (ov) P.VU.vxsat->write(1); + #endif |