diff options
author | Andrew Waterman <andrew@sifive.com> | 2023-06-17 14:25:27 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2023-06-18 01:23:40 -0700 |
commit | fff2699cfdcf9a2fe7e004ca92c299a2c11c37a1 (patch) | |
tree | 4f85d867bffaee8bd99878408eb6aa3eb4441150 /riscv/insns | |
parent | 3b6732458f5b6b47e87caad8cf9b03be13692f4f (diff) | |
download | riscv-isa-sim-fff2699cfdcf9a2fe7e004ca92c299a2c11c37a1.zip riscv-isa-sim-fff2699cfdcf9a2fe7e004ca92c299a2c11c37a1.tar.gz riscv-isa-sim-fff2699cfdcf9a2fe7e004ca92c299a2c11c37a1.tar.bz2 |
Remove instructions that belong only to Xbitmanip
Diffstat (limited to 'riscv/insns')
45 files changed, 0 insertions, 347 deletions
diff --git a/riscv/insns/bcompress.h b/riscv/insns/bcompress.h deleted file mode 100644 index 579346f..0000000 --- a/riscv/insns/bcompress.h +++ /dev/null @@ -1,9 +0,0 @@ -require_extension(EXT_XZBE); -uint64_t c = 0, i = 0, data = zext_xlen(RS1), mask = zext_xlen(RS2); -while (mask) { - uint64_t b = mask & ~((mask | (mask-1)) + 1); - c |= (data & b) >> (ctz(b) - i); - i += popcount(b); - mask -= b; -} -WRITE_RD(sext_xlen(c)); diff --git a/riscv/insns/bcompressw.h b/riscv/insns/bcompressw.h deleted file mode 100644 index 2c1017c..0000000 --- a/riscv/insns/bcompressw.h +++ /dev/null @@ -1,10 +0,0 @@ -require_rv64; -require_extension(EXT_XZBE); -uint64_t c = 0, i = 0, data = zext32(RS1), mask = zext32(RS2); -while (mask) { - uint64_t b = mask & ~((mask | (mask-1)) + 1); - c |= (data & b) >> (ctz(b) - i); - i += popcount(b); - mask -= b; -} -WRITE_RD(sext32(c)); diff --git a/riscv/insns/bdecompress.h b/riscv/insns/bdecompress.h deleted file mode 100644 index 2894be0..0000000 --- a/riscv/insns/bdecompress.h +++ /dev/null @@ -1,9 +0,0 @@ -require_extension(EXT_XZBE); -uint64_t c = 0, i = 0, data = zext_xlen(RS1), mask = zext_xlen(RS2); -while (mask) { - uint64_t b = mask & ~((mask | (mask-1)) + 1); - c |= (data << (ctz(b) - i)) & b; - i += popcount(b); - mask -= b; -} -WRITE_RD(sext_xlen(c)); diff --git a/riscv/insns/bdecompressw.h b/riscv/insns/bdecompressw.h deleted file mode 100644 index 468a726..0000000 --- a/riscv/insns/bdecompressw.h +++ /dev/null @@ -1,10 +0,0 @@ -require_rv64; -require_extension(EXT_XZBE); -uint64_t c = 0, i = 0, data = zext32(RS1), mask = zext32(RS2); -while (mask) { - uint64_t b = mask & ~((mask | (mask-1)) + 1); - c |= (data << (ctz(b) - i)) & b; - i += popcount(b); - mask -= b; -} -WRITE_RD(sext32(c)); diff --git a/riscv/insns/bfp.h b/riscv/insns/bfp.h deleted file mode 100644 index 886d840..0000000 --- a/riscv/insns/bfp.h +++ /dev/null @@ -1,10 +0,0 @@ -require_extension(EXT_XZBF); -reg_t cfg = RS2 >> (xlen/2); -if ((cfg >> 30) == 2) - cfg = cfg >> 16; -int len = (cfg >> 8) & (xlen/2-1); -int off = cfg & (xlen-1); -len = len ? len : xlen/2; -reg_t mask = ~(~reg_t(0) << len) << off; -reg_t data = RS2 << off; -WRITE_RD(sext_xlen((data & mask) | (RS1 & ~mask))); diff --git a/riscv/insns/bfpw.h b/riscv/insns/bfpw.h deleted file mode 100644 index 42479e7..0000000 --- a/riscv/insns/bfpw.h +++ /dev/null @@ -1,9 +0,0 @@ -require_rv64; -require_extension(EXT_XZBF); -reg_t cfg = RS2 >> 16; -int len = (cfg >> 8) & 15; -int off = cfg & 31; -len = len ? len : 16; -reg_t mask = ~(~reg_t(0) << len) << off; -reg_t data = RS2 << off; -WRITE_RD(sext32((data & mask) | (RS1 & ~mask))); diff --git a/riscv/insns/bmatflip.h b/riscv/insns/bmatflip.h deleted file mode 100644 index c10df8f..0000000 --- a/riscv/insns/bmatflip.h +++ /dev/null @@ -1,11 +0,0 @@ -require_rv64; -require_extension(EXT_XZBM); -reg_t x = RS1; -for (int i = 0; i < 3; i++) { - x = (x & 0xFFFF00000000FFFFLL) | ((x & 0x0000FFFF00000000LL) >> 16) | ((x & 0x00000000FFFF0000LL) << 16); - x = (x & 0xFF0000FFFF0000FFLL) | ((x & 0x00FF000000FF0000LL) >> 8) | ((x & 0x0000FF000000FF00LL) << 8); - x = (x & 0xF00FF00FF00FF00FLL) | ((x & 0x0F000F000F000F00LL) >> 4) | ((x & 0x00F000F000F000F0LL) << 4); - x = (x & 0xC3C3C3C3C3C3C3C3LL) | ((x & 0x3030303030303030LL) >> 2) | ((x & 0x0C0C0C0C0C0C0C0CLL) << 2); - x = (x & 0x9999999999999999LL) | ((x & 0x4444444444444444LL) >> 1) | ((x & 0x2222222222222222LL) << 1); -} -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/bmator.h b/riscv/insns/bmator.h deleted file mode 100644 index 33057ca..0000000 --- a/riscv/insns/bmator.h +++ /dev/null @@ -1,29 +0,0 @@ -require_rv64; -require_extension(EXT_XZBM); - -// transpose of rs2 -int64_t rs2t = RS2; -for (int i = 0; i < 3; i++) { - rs2t = (rs2t & 0xFFFF00000000FFFFLL) | ((rs2t & 0x0000FFFF00000000LL) >> 16) | ((rs2t & 0x00000000FFFF0000LL) << 16); - rs2t = (rs2t & 0xFF0000FFFF0000FFLL) | ((rs2t & 0x00FF000000FF0000LL) >> 8) | ((rs2t & 0x0000FF000000FF00LL) << 8); - rs2t = (rs2t & 0xF00FF00FF00FF00FLL) | ((rs2t & 0x0F000F000F000F00LL) >> 4) | ((rs2t & 0x00F000F000F000F0LL) << 4); - rs2t = (rs2t & 0xC3C3C3C3C3C3C3C3LL) | ((rs2t & 0x3030303030303030LL) >> 2) | ((rs2t & 0x0C0C0C0C0C0C0C0CLL) << 2); - rs2t = (rs2t & 0x9999999999999999LL) | ((rs2t & 0x4444444444444444LL) >> 1) | ((rs2t & 0x2222222222222222LL) << 1); -} - -int64_t rs1 = RS1; -uint8_t u[8]; // rows of rs1 -uint8_t v[8]; // cols of rs2 - -for (int i = 0; i < 8; i++) { - u[i] = rs1 >> (i*8); - v[i] = rs2t >> (i*8); -} - -uint64_t x = 0; -for (int i = 0; i < 64; i++) { - if ((u[i / 8] & v[i % 8]) != 0) - x |= 1LL << i; -} - -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/bmatxor.h b/riscv/insns/bmatxor.h deleted file mode 100644 index ca2d096..0000000 --- a/riscv/insns/bmatxor.h +++ /dev/null @@ -1,29 +0,0 @@ -require_rv64; -require_extension(EXT_XZBM); - -// transpose of rs2 -int64_t rs2t = RS2; -for (int i = 0; i < 3; i++) { - rs2t = (rs2t & 0xFFFF00000000FFFFLL) | ((rs2t & 0x0000FFFF00000000LL) >> 16) | ((rs2t & 0x00000000FFFF0000LL) << 16); - rs2t = (rs2t & 0xFF0000FFFF0000FFLL) | ((rs2t & 0x00FF000000FF0000LL) >> 8) | ((rs2t & 0x0000FF000000FF00LL) << 8); - rs2t = (rs2t & 0xF00FF00FF00FF00FLL) | ((rs2t & 0x0F000F000F000F00LL) >> 4) | ((rs2t & 0x00F000F000F000F0LL) << 4); - rs2t = (rs2t & 0xC3C3C3C3C3C3C3C3LL) | ((rs2t & 0x3030303030303030LL) >> 2) | ((rs2t & 0x0C0C0C0C0C0C0C0CLL) << 2); - rs2t = (rs2t & 0x9999999999999999LL) | ((rs2t & 0x4444444444444444LL) >> 1) | ((rs2t & 0x2222222222222222LL) << 1); -} - -int64_t rs1 = RS1; -uint8_t u[8]; // rows of rs1 -uint8_t v[8]; // cols of rs2 - -for (int i = 0; i < 8; i++) { - u[i] = rs1 >> (i*8); - v[i] = rs2t >> (i*8); -} - -uint64_t x = 0; -for (int i = 0; i < 64; i++) { - if (popcount(u[i / 8] & v[i % 8]) & 1) - x |= 1LL << i; -} - -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/clmulhw.h b/riscv/insns/clmulhw.h deleted file mode 100644 index f41acb0..0000000 --- a/riscv/insns/clmulhw.h +++ /dev/null @@ -1,6 +0,0 @@ -require_extension(EXT_XZBC); -reg_t a = zext32(RS1), b = zext32(RS2), x = 0; -for (int i = 1; i < 32; i++) - if ((b >> i) & 1) - x ^= a >> (32-i); -WRITE_RD(sext32(x)); diff --git a/riscv/insns/clmulrw.h b/riscv/insns/clmulrw.h deleted file mode 100644 index 784859a..0000000 --- a/riscv/insns/clmulrw.h +++ /dev/null @@ -1,6 +0,0 @@ -require_extension(EXT_XZBC); -reg_t a = zext32(RS1), b = zext32(RS2), x = 0; -for (int i = 0; i < 32; i++) - if ((b >> i) & 1) - x ^= a >> (31-i); -WRITE_RD(sext32(x)); diff --git a/riscv/insns/clmulw.h b/riscv/insns/clmulw.h deleted file mode 100644 index 5bb753f..0000000 --- a/riscv/insns/clmulw.h +++ /dev/null @@ -1,6 +0,0 @@ -require_extension(EXT_XZBC); -reg_t a = zext32(RS1), b = zext32(RS2), x = 0; -for (int i = 0; i < 32; i++) - if ((b >> i) & 1) - x ^= a << i; -WRITE_RD(sext32(x)); diff --git a/riscv/insns/cmov.h b/riscv/insns/cmov.h deleted file mode 100644 index c7551bc..0000000 --- a/riscv/insns/cmov.h +++ /dev/null @@ -1,2 +0,0 @@ -require_extension(EXT_XZBT); -WRITE_RD(RS2 ? RS1 : RS3); diff --git a/riscv/insns/crc32_b.h b/riscv/insns/crc32_b.h deleted file mode 100644 index 3111fe5..0000000 --- a/riscv/insns/crc32_b.h +++ /dev/null @@ -1,5 +0,0 @@ -require_extension(EXT_XZBR); -reg_t x = zext_xlen(RS1); -for (int i = 0; i < 8; i++) - x = (x >> 1) ^ (0xEDB88320 & ~((x&1)-1)); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/crc32_d.h b/riscv/insns/crc32_d.h deleted file mode 100644 index 7fd7a38..0000000 --- a/riscv/insns/crc32_d.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -require_extension(EXT_XZBR); -reg_t x = zext_xlen(RS1); -for (int i = 0; i < 64; i++) - x = (x >> 1) ^ (0xEDB88320 & ~((x&1)-1)); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/crc32_h.h b/riscv/insns/crc32_h.h deleted file mode 100644 index 5063fef..0000000 --- a/riscv/insns/crc32_h.h +++ /dev/null @@ -1,5 +0,0 @@ -require_extension(EXT_XZBR); -reg_t x = zext_xlen(RS1); -for (int i = 0; i < 16; i++) - x = (x >> 1) ^ (0xEDB88320 & ~((x&1)-1)); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/crc32_w.h b/riscv/insns/crc32_w.h deleted file mode 100644 index 6e425ab..0000000 --- a/riscv/insns/crc32_w.h +++ /dev/null @@ -1,5 +0,0 @@ -require_extension(EXT_XZBR); -reg_t x = zext_xlen(RS1); -for (int i = 0; i < 32; i++) - x = (x >> 1) ^ (0xEDB88320 & ~((x&1)-1)); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/crc32c_b.h b/riscv/insns/crc32c_b.h deleted file mode 100644 index d11b0dd..0000000 --- a/riscv/insns/crc32c_b.h +++ /dev/null @@ -1,5 +0,0 @@ -require_extension(EXT_XZBR); -reg_t x = zext_xlen(RS1); -for (int i = 0; i < 8; i++) - x = (x >> 1) ^ (0x82F63B78 & ~((x&1)-1)); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/crc32c_d.h b/riscv/insns/crc32c_d.h deleted file mode 100644 index 81175fd..0000000 --- a/riscv/insns/crc32c_d.h +++ /dev/null @@ -1,6 +0,0 @@ -require_rv64; -require_extension(EXT_XZBR); -reg_t x = zext_xlen(RS1); -for (int i = 0; i < 64; i++) - x = (x >> 1) ^ (0x82F63B78 & ~((x&1)-1)); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/crc32c_h.h b/riscv/insns/crc32c_h.h deleted file mode 100644 index ef5817d..0000000 --- a/riscv/insns/crc32c_h.h +++ /dev/null @@ -1,5 +0,0 @@ -require_extension(EXT_XZBR); -reg_t x = zext_xlen(RS1); -for (int i = 0; i < 16; i++) - x = (x >> 1) ^ (0x82F63B78 & ~((x&1)-1)); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/crc32c_w.h b/riscv/insns/crc32c_w.h deleted file mode 100644 index 8793540..0000000 --- a/riscv/insns/crc32c_w.h +++ /dev/null @@ -1,5 +0,0 @@ -require_extension(EXT_XZBR); -reg_t x = zext_xlen(RS1); -for (int i = 0; i < 32; i++) - x = (x >> 1) ^ (0x82F63B78 & ~((x&1)-1)); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/fsl.h b/riscv/insns/fsl.h deleted file mode 100644 index 53a2160..0000000 --- a/riscv/insns/fsl.h +++ /dev/null @@ -1,9 +0,0 @@ -require_extension(EXT_XZBT); -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 ? (a << shamt) | (zext_xlen(b) >> rshamt) : a)); diff --git a/riscv/insns/fslw.h b/riscv/insns/fslw.h deleted file mode 100644 index 8394010..0000000 --- a/riscv/insns/fslw.h +++ /dev/null @@ -1,10 +0,0 @@ -require_rv64; -require_extension(EXT_XZBT); -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 ? (a << shamt) | (zext32(b) >> rshamt) : a)); diff --git a/riscv/insns/fsriw.h b/riscv/insns/fsriw.h deleted file mode 100644 index 7956de7..0000000 --- a/riscv/insns/fsriw.h +++ /dev/null @@ -1,10 +0,0 @@ -require_rv64; -require_extension(EXT_XZBT); -int shamt = SHAMT & 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/gorc.h b/riscv/insns/gorc.h deleted file mode 100644 index ffe4413..0000000 --- a/riscv/insns/gorc.h +++ /dev/null @@ -1,10 +0,0 @@ -require_extension(EXT_XZBP); -reg_t x = RS1; -int shamt = RS2 & (xlen-1); -if (shamt & 1) x |= ((x & 0x5555555555555555LL) << 1) | ((x & 0xAAAAAAAAAAAAAAAALL) >> 1); -if (shamt & 2) x |= ((x & 0x3333333333333333LL) << 2) | ((x & 0xCCCCCCCCCCCCCCCCLL) >> 2); -if (shamt & 4) x |= ((x & 0x0F0F0F0F0F0F0F0FLL) << 4) | ((x & 0xF0F0F0F0F0F0F0F0LL) >> 4); -if (shamt & 8) x |= ((x & 0x00FF00FF00FF00FFLL) << 8) | ((x & 0xFF00FF00FF00FF00LL) >> 8); -if (shamt & 16) x |= ((x & 0x0000FFFF0000FFFFLL) << 16) | ((x & 0xFFFF0000FFFF0000LL) >> 16); -if (shamt & 32) x |= ((x & 0x00000000FFFFFFFFLL) << 32) | ((x & 0xFFFFFFFF00000000LL) >> 32); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/gorciw.h b/riscv/insns/gorciw.h deleted file mode 100644 index 44ade80..0000000 --- a/riscv/insns/gorciw.h +++ /dev/null @@ -1,11 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -require(SHAMT < 32); -reg_t x = RS1; -int shamt = SHAMT; -if (shamt & 1) x |= ((x & 0x5555555555555555LL) << 1) | ((x & 0xAAAAAAAAAAAAAAAALL) >> 1); -if (shamt & 2) x |= ((x & 0x3333333333333333LL) << 2) | ((x & 0xCCCCCCCCCCCCCCCCLL) >> 2); -if (shamt & 4) x |= ((x & 0x0F0F0F0F0F0F0F0FLL) << 4) | ((x & 0xF0F0F0F0F0F0F0F0LL) >> 4); -if (shamt & 8) x |= ((x & 0x00FF00FF00FF00FFLL) << 8) | ((x & 0xFF00FF00FF00FF00LL) >> 8); -if (shamt & 16) x |= ((x & 0x0000FFFF0000FFFFLL) << 16) | ((x & 0xFFFF0000FFFF0000LL) >> 16); -WRITE_RD(sext32(x)); diff --git a/riscv/insns/gorcw.h b/riscv/insns/gorcw.h deleted file mode 100644 index 611b3ca..0000000 --- a/riscv/insns/gorcw.h +++ /dev/null @@ -1,10 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -reg_t x = RS1; -int shamt = RS2 & 31; -if (shamt & 1) x |= ((x & 0x5555555555555555LL) << 1) | ((x & 0xAAAAAAAAAAAAAAAALL) >> 1); -if (shamt & 2) x |= ((x & 0x3333333333333333LL) << 2) | ((x & 0xCCCCCCCCCCCCCCCCLL) >> 2); -if (shamt & 4) x |= ((x & 0x0F0F0F0F0F0F0F0FLL) << 4) | ((x & 0xF0F0F0F0F0F0F0F0LL) >> 4); -if (shamt & 8) x |= ((x & 0x00FF00FF00FF00FFLL) << 8) | ((x & 0xFF00FF00FF00FF00LL) >> 8); -if (shamt & 16) x |= ((x & 0x0000FFFF0000FFFFLL) << 16) | ((x & 0xFFFF0000FFFF0000LL) >> 16); -WRITE_RD(sext32(x)); diff --git a/riscv/insns/grev.h b/riscv/insns/grev.h deleted file mode 100644 index 7181b3c..0000000 --- a/riscv/insns/grev.h +++ /dev/null @@ -1,10 +0,0 @@ -require_extension(EXT_XZBP); -reg_t x = RS1; -int shamt = RS2 & (xlen-1); -if (shamt & 1) x = ((x & 0x5555555555555555LL) << 1) | ((x & 0xAAAAAAAAAAAAAAAALL) >> 1); -if (shamt & 2) x = ((x & 0x3333333333333333LL) << 2) | ((x & 0xCCCCCCCCCCCCCCCCLL) >> 2); -if (shamt & 4) x = ((x & 0x0F0F0F0F0F0F0F0FLL) << 4) | ((x & 0xF0F0F0F0F0F0F0F0LL) >> 4); -if (shamt & 8) x = ((x & 0x00FF00FF00FF00FFLL) << 8) | ((x & 0xFF00FF00FF00FF00LL) >> 8); -if (shamt & 16) x = ((x & 0x0000FFFF0000FFFFLL) << 16) | ((x & 0xFFFF0000FFFF0000LL) >> 16); -if (shamt & 32) x = ((x & 0x00000000FFFFFFFFLL) << 32) | ((x & 0xFFFFFFFF00000000LL) >> 32); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/greviw.h b/riscv/insns/greviw.h deleted file mode 100644 index 004ecf3..0000000 --- a/riscv/insns/greviw.h +++ /dev/null @@ -1,11 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -require(SHAMT < 32); -reg_t x = RS1; -int shamt = SHAMT; -if (shamt & 1) x = ((x & 0x5555555555555555LL) << 1) | ((x & 0xAAAAAAAAAAAAAAAALL) >> 1); -if (shamt & 2) x = ((x & 0x3333333333333333LL) << 2) | ((x & 0xCCCCCCCCCCCCCCCCLL) >> 2); -if (shamt & 4) x = ((x & 0x0F0F0F0F0F0F0F0FLL) << 4) | ((x & 0xF0F0F0F0F0F0F0F0LL) >> 4); -if (shamt & 8) x = ((x & 0x00FF00FF00FF00FFLL) << 8) | ((x & 0xFF00FF00FF00FF00LL) >> 8); -if (shamt & 16) x = ((x & 0x0000FFFF0000FFFFLL) << 16) | ((x & 0xFFFF0000FFFF0000LL) >> 16); -WRITE_RD(sext32(x)); diff --git a/riscv/insns/grevw.h b/riscv/insns/grevw.h deleted file mode 100644 index 3fbcf22..0000000 --- a/riscv/insns/grevw.h +++ /dev/null @@ -1,10 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -reg_t x = RS1; -int shamt = RS2 & 31; -if (shamt & 1) x = ((x & 0x5555555555555555LL) << 1) | ((x & 0xAAAAAAAAAAAAAAAALL) >> 1); -if (shamt & 2) x = ((x & 0x3333333333333333LL) << 2) | ((x & 0xCCCCCCCCCCCCCCCCLL) >> 2); -if (shamt & 4) x = ((x & 0x0F0F0F0F0F0F0F0FLL) << 4) | ((x & 0xF0F0F0F0F0F0F0F0LL) >> 4); -if (shamt & 8) x = ((x & 0x00FF00FF00FF00FFLL) << 8) | ((x & 0xFF00FF00FF00FF00LL) >> 8); -if (shamt & 16) x = ((x & 0x0000FFFF0000FFFFLL) << 16) | ((x & 0xFFFF0000FFFF0000LL) >> 16); -WRITE_RD(sext32(x)); diff --git a/riscv/insns/packuw.h b/riscv/insns/packuw.h deleted file mode 100644 index 1b3f7d5..0000000 --- a/riscv/insns/packuw.h +++ /dev/null @@ -1,5 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -reg_t lo = zext32(RS1) >> 16; -reg_t hi = zext32(RS2) >> 16 << 16; -WRITE_RD(sext32(lo | hi)); diff --git a/riscv/insns/shfl.h b/riscv/insns/shfl.h deleted file mode 100644 index 3004871..0000000 --- a/riscv/insns/shfl.h +++ /dev/null @@ -1,9 +0,0 @@ -require_extension(EXT_XZBP); -reg_t x = RS1; -int shamt = RS2 & ((xlen-1) >> 1); -if (shamt & 16) x = (x & 0xFFFF00000000FFFFLL) | ((x & 0x0000FFFF00000000LL) >> 16) | ((x & 0x00000000FFFF0000LL) << 16); -if (shamt & 8) x = (x & 0xFF0000FFFF0000FFLL) | ((x & 0x00FF000000FF0000LL) >> 8) | ((x & 0x0000FF000000FF00LL) << 8); -if (shamt & 4) x = (x & 0xF00FF00FF00FF00FLL) | ((x & 0x0F000F000F000F00LL) >> 4) | ((x & 0x00F000F000F000F0LL) << 4); -if (shamt & 2) x = (x & 0xC3C3C3C3C3C3C3C3LL) | ((x & 0x3030303030303030LL) >> 2) | ((x & 0x0C0C0C0C0C0C0C0CLL) << 2); -if (shamt & 1) x = (x & 0x9999999999999999LL) | ((x & 0x4444444444444444LL) >> 1) | ((x & 0x2222222222222222LL) << 1); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/shflw.h b/riscv/insns/shflw.h deleted file mode 100644 index 06ee360..0000000 --- a/riscv/insns/shflw.h +++ /dev/null @@ -1,9 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -reg_t x = RS1; -int shamt = RS2 & 15; -if (shamt & 8) x = (x & 0xFF0000FFFF0000FFLL) | ((x & 0x00FF000000FF0000LL) >> 8) | ((x & 0x0000FF000000FF00LL) << 8); -if (shamt & 4) x = (x & 0xF00FF00FF00FF00FLL) | ((x & 0x0F000F000F000F00LL) >> 4) | ((x & 0x00F000F000F000F0LL) << 4); -if (shamt & 2) x = (x & 0xC3C3C3C3C3C3C3C3LL) | ((x & 0x3030303030303030LL) >> 2) | ((x & 0x0C0C0C0C0C0C0C0CLL) << 2); -if (shamt & 1) x = (x & 0x9999999999999999LL) | ((x & 0x4444444444444444LL) >> 1) | ((x & 0x2222222222222222LL) << 1); -WRITE_RD(sext32(x)); diff --git a/riscv/insns/slo.h b/riscv/insns/slo.h deleted file mode 100644 index a27ec37..0000000 --- a/riscv/insns/slo.h +++ /dev/null @@ -1,2 +0,0 @@ -require_extension(EXT_XZBP); -WRITE_RD(sext_xlen(~((~RS1) << (RS2 & (xlen-1))))); diff --git a/riscv/insns/sloi.h b/riscv/insns/sloi.h deleted file mode 100644 index 62278b0..0000000 --- a/riscv/insns/sloi.h +++ /dev/null @@ -1,3 +0,0 @@ -require(SHAMT < xlen); -require_extension(EXT_XZBP); -WRITE_RD(sext_xlen(~((~RS1) << SHAMT))); diff --git a/riscv/insns/sloiw.h b/riscv/insns/sloiw.h deleted file mode 100644 index 492c94a..0000000 --- a/riscv/insns/sloiw.h +++ /dev/null @@ -1,3 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -WRITE_RD(sext32(~((~RS1) << SHAMT))); diff --git a/riscv/insns/slow.h b/riscv/insns/slow.h deleted file mode 100644 index 04c90a4..0000000 --- a/riscv/insns/slow.h +++ /dev/null @@ -1,3 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -WRITE_RD(sext32(~((~RS1) << (RS2 & 0x1F)))); diff --git a/riscv/insns/sro.h b/riscv/insns/sro.h deleted file mode 100644 index 3ac050d..0000000 --- a/riscv/insns/sro.h +++ /dev/null @@ -1,2 +0,0 @@ -require_extension(EXT_XZBP); -WRITE_RD(sext_xlen(~((zext_xlen(~RS1)) >> (RS2 & (xlen-1))))); diff --git a/riscv/insns/sroi.h b/riscv/insns/sroi.h deleted file mode 100644 index e878892..0000000 --- a/riscv/insns/sroi.h +++ /dev/null @@ -1,3 +0,0 @@ -require(SHAMT < xlen); -require_extension(EXT_XZBP); -WRITE_RD(sext_xlen(~((zext_xlen(~RS1)) >> SHAMT))); diff --git a/riscv/insns/sroiw.h b/riscv/insns/sroiw.h deleted file mode 100644 index 8348070..0000000 --- a/riscv/insns/sroiw.h +++ /dev/null @@ -1,3 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -WRITE_RD(sext32(~((~(uint32_t)RS1) >> SHAMT))); diff --git a/riscv/insns/srow.h b/riscv/insns/srow.h deleted file mode 100644 index 808af8d..0000000 --- a/riscv/insns/srow.h +++ /dev/null @@ -1,3 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -WRITE_RD(sext32(~((~(uint32_t)RS1) >> (RS2 & 0x1F)))); diff --git a/riscv/insns/unshfl.h b/riscv/insns/unshfl.h deleted file mode 100644 index 78990b8..0000000 --- a/riscv/insns/unshfl.h +++ /dev/null @@ -1,9 +0,0 @@ -require_extension(EXT_XZBP); -reg_t x = RS1; -int shamt = RS2 & ((xlen-1) >> 1); -if (shamt & 1) x = (x & 0x9999999999999999LL) | ((x & 0x4444444444444444LL) >> 1) | ((x & 0x2222222222222222LL) << 1); -if (shamt & 2) x = (x & 0xC3C3C3C3C3C3C3C3LL) | ((x & 0x3030303030303030LL) >> 2) | ((x & 0x0C0C0C0C0C0C0C0CLL) << 2); -if (shamt & 4) x = (x & 0xF00FF00FF00FF00FLL) | ((x & 0x0F000F000F000F00LL) >> 4) | ((x & 0x00F000F000F000F0LL) << 4); -if (shamt & 8) x = (x & 0xFF0000FFFF0000FFLL) | ((x & 0x00FF000000FF0000LL) >> 8) | ((x & 0x0000FF000000FF00LL) << 8); -if (shamt & 16) x = (x & 0xFFFF00000000FFFFLL) | ((x & 0x0000FFFF00000000LL) >> 16) | ((x & 0x00000000FFFF0000LL) << 16); -WRITE_RD(sext_xlen(x)); diff --git a/riscv/insns/unshflw.h b/riscv/insns/unshflw.h deleted file mode 100644 index 776534e..0000000 --- a/riscv/insns/unshflw.h +++ /dev/null @@ -1,9 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -reg_t x = RS1; -int shamt = RS2 & 15; -if (shamt & 1) x = (x & 0x9999999999999999LL) | ((x & 0x4444444444444444LL) >> 1) | ((x & 0x2222222222222222LL) << 1); -if (shamt & 2) x = (x & 0xC3C3C3C3C3C3C3C3LL) | ((x & 0x3030303030303030LL) >> 2) | ((x & 0x0C0C0C0C0C0C0C0CLL) << 2); -if (shamt & 4) x = (x & 0xF00FF00FF00FF00FLL) | ((x & 0x0F000F000F000F00LL) >> 4) | ((x & 0x00F000F000F000F0LL) << 4); -if (shamt & 8) x = (x & 0xFF0000FFFF0000FFLL) | ((x & 0x00FF000000FF0000LL) >> 8) | ((x & 0x0000FF000000FF00LL) << 8); -WRITE_RD(sext32(x)); diff --git a/riscv/insns/xperm16.h b/riscv/insns/xperm16.h deleted file mode 100644 index 6b0ad51..0000000 --- a/riscv/insns/xperm16.h +++ /dev/null @@ -1,2 +0,0 @@ -require_extension(EXT_XZBP); -WRITE_RD(sext_xlen(xperm(RS1, RS2, 4, xlen))); diff --git a/riscv/insns/xperm32.h b/riscv/insns/xperm32.h deleted file mode 100644 index 64d90a4..0000000 --- a/riscv/insns/xperm32.h +++ /dev/null @@ -1,3 +0,0 @@ -require_rv64; -require_extension(EXT_XZBP); -WRITE_RD(xperm(RS1, RS2, 5, xlen)); |