Use xlen, not xprlen, to refer to x-register width
authorAndrew Waterman <waterman@cs.berkeley.edu>
Sun, 8 Feb 2015 08:13:48 +0000 (00:13 -0800)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Sun, 8 Feb 2015 08:13:48 +0000 (00:13 -0800)
21 files changed:
hwacha/insn_template_hwacha.cc
hwacha/insn_template_hwacha_ut.cc
riscv/decode.h
riscv/insn_template.cc
riscv/insns/add.h
riscv/insns/addi.h
riscv/insns/auipc.h
riscv/insns/csrrc.h
riscv/insns/csrrci.h
riscv/insns/csrrs.h
riscv/insns/csrrsi.h
riscv/insns/csrrw.h
riscv/insns/csrrwi.h
riscv/insns/div.h
riscv/insns/divu.h
riscv/insns/mul.h
riscv/insns/rem.h
riscv/insns/remu.h
riscv/insns/sll.h
riscv/insns/sra.h
riscv/insns/sub.h

index cb44cac94e75044a13d36a767cbad8712a316c1d..d225949c993cf9377552bb0f4e2730ecccddf123 100644 (file)
@@ -3,8 +3,8 @@
 
 reg_t hwacha_NAME(processor_t* p, insn_t insn, reg_t pc)
 {
-  int xprlen = 64;
-  reg_t npc = sext_xprlen(pc + insn_length(OPCODE));
+  int xlen = 64;
+  reg_t npc = sext_xlen(pc + insn_length(OPCODE));
   hwacha_t* h = static_cast<hwacha_t*>(p->get_extension());
   rocc_insn_union_t u;
   u.i = insn;
index d312e93c8000cfd16b6cf289ae88e72473a4cdf5..7f5dc0ebb515dd9fe6cd8bcd284bc8a74ae2f670 100644 (file)
@@ -3,8 +3,8 @@
 
 reg_t hwacha_NAME(processor_t* p, insn_t insn, reg_t pc)
 {
-  int xprlen = 64;
-  reg_t npc = sext_xprlen(pc + insn_length(OPCODE));
+  int xlen = 64;
+  reg_t npc = sext_xlen(pc + insn_length(OPCODE));
   hwacha_t* h = static_cast<hwacha_t*>(p->get_extension());
   do {
     #include "insns_ut/NAME.h"
index 274ab2ac30d04639f0bbfd22c896a9c8b5d7554c..6ac465a07c74ba6cf942ab963dc96d29cb108848 100644 (file)
@@ -135,7 +135,7 @@ private:
               if(rm > 4) throw trap_illegal_instruction(); \
               rm; })
 
-#define xpr64 (xprlen == 64)
+#define xpr64 (xlen == 64)
 
 #define require_supervisor if(unlikely(!(STATE.sr & SR_S))) throw trap_privileged_instruction()
 #define require_xpr64 if(unlikely(!xpr64)) throw trap_illegal_instruction()
@@ -147,16 +147,16 @@ private:
 #endif
 #define require_accelerator if(unlikely(!(STATE.sr & SR_EA))) throw trap_accelerator_disabled()
 
-#define cmp_trunc(reg) (reg_t(reg) << (64-xprlen))
+#define cmp_trunc(reg) (reg_t(reg) << (64-xlen))
 #define set_fp_exceptions ({ STATE.fflags |= softfloat_exceptionFlags; \
                              softfloat_exceptionFlags = 0; })
 
 #define sext32(x) ((sreg_t)(int32_t)(x))
 #define zext32(x) ((reg_t)(uint32_t)(x))
-#define sext_xprlen(x) (((sreg_t)(x) << (64-xprlen)) >> (64-xprlen))
-#define zext_xprlen(x) (((reg_t)(x) << (64-xprlen)) >> (64-xprlen))
+#define sext_xlen(x) (((sreg_t)(x) << (64-xlen)) >> (64-xlen))
+#define zext_xlen(x) (((reg_t)(x) << (64-xlen)) >> (64-xlen))
 
-#define set_pc(x) (npc = sext_xprlen(x))
+#define set_pc(x) (npc = sext_xlen(x))
 
 #define validate_csr(which, write) ({ \
   unsigned my_priv = (STATE.sr & SR_S) ? 1 : 0; \
index d2c0fce4322a1f1dbd1ad7d4d3416c369da153bb..35f67a0d3cb57798850789343f083ea53543487e 100644 (file)
@@ -4,16 +4,16 @@
 
 reg_t rv32_NAME(processor_t* p, insn_t insn, reg_t pc)
 {
-  int xprlen = 32;
-  reg_t npc = sext_xprlen(pc + insn_length(OPCODE));
+  int xlen = 32;
+  reg_t npc = sext_xlen(pc + insn_length(OPCODE));
   #include "insns/NAME.h"
   return npc;
 }
 
 reg_t rv64_NAME(processor_t* p, insn_t insn, reg_t pc)
 {
-  int xprlen = 64;
-  reg_t npc = sext_xprlen(pc + insn_length(OPCODE));
+  int xlen = 64;
+  reg_t npc = sext_xlen(pc + insn_length(OPCODE));
   #include "insns/NAME.h"
   return npc;
 }
index d7a5c98d21867debe16657aad778d6b1be191c7e..895e2b1867dbf29aee59a86fc68fcbad5e2535f1 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xprlen(RS1 + RS2));
+WRITE_RD(sext_xlen(RS1 + RS2));
index c861a97c80ba3a81871f9ef3893d10bf7c387e85..1bb5dcedfa8e3c1269cd2f37697c090535e70d04 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xprlen(RS1 + insn.i_imm()));
+WRITE_RD(sext_xlen(RS1 + insn.i_imm()));
index d724d10b43352910fbf1cb8d8ebb6ddf5b9268d0..1a2b169b59a4b46ecb2976bb7ae427ae0fe49c48 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xprlen(insn.u_imm() + pc));
+WRITE_RD(sext_xlen(insn.u_imm() + pc));
index 8719267da7b33870c8f27e5afec9442d765c964f..4667fc889fc2e39e8adf30c261a0c7cd060335fe 100644 (file)
@@ -1,4 +1,4 @@
 int csr = validate_csr(insn.csr(), true);
 reg_t old = p->get_pcr(csr);
 p->set_pcr(csr, old & ~RS1);
-WRITE_RD(sext_xprlen(old));
+WRITE_RD(sext_xlen(old));
index 51a2cdeec6eac435c8c4a4cef1bb1c2669f746f7..172aea0a05bcd07def93d544349ddfe9d13f899d 100644 (file)
@@ -1,4 +1,4 @@
 int csr = validate_csr(insn.csr(), true);
 reg_t old = p->get_pcr(csr);
 p->set_pcr(csr, old & ~(reg_t)insn.rs1());
-WRITE_RD(sext_xprlen(old));
+WRITE_RD(sext_xlen(old));
index 675cb86e7a8476b969189e5445113036048b81d6..661685536f72627659fce52e536a1dcfd6eb044a 100644 (file)
@@ -1,4 +1,4 @@
 int csr = validate_csr(insn.csr(), insn.rs1() != 0);
 reg_t old = p->get_pcr(csr);
 p->set_pcr(csr, old | RS1);
-WRITE_RD(sext_xprlen(old));
+WRITE_RD(sext_xlen(old));
index 094e91a855869fafdf241a6aba6a1d7be525e91d..913c20a343ea317817eb32a220932e0c1029d1ea 100644 (file)
@@ -1,4 +1,4 @@
 int csr = validate_csr(insn.csr(), true);
 reg_t old = p->get_pcr(csr);
 p->set_pcr(csr, old | insn.rs1());
-WRITE_RD(sext_xprlen(old));
+WRITE_RD(sext_xlen(old));
index 3d1ea32dd9ac67f5fe00d30b7b0ca0deb32e0b96..b98166584b68decc869a9f7ed4ffbc624324b29a 100644 (file)
@@ -1,4 +1,4 @@
 int csr = validate_csr(insn.csr(), true);
 reg_t old = p->get_pcr(csr);
 p->set_pcr(csr, RS1);
-WRITE_RD(sext_xprlen(old));
+WRITE_RD(sext_xlen(old));
index 081b4e9573b4c139810b7ce9f7ad0c7d12be5521..cbee6b9de9e168d8d00602dc6d6b9aaf9377029b 100644 (file)
@@ -1,4 +1,4 @@
 int csr = validate_csr(insn.csr(), true);
 reg_t old = p->get_pcr(csr);
 p->set_pcr(csr, insn.rs1());
-WRITE_RD(sext_xprlen(old));
+WRITE_RD(sext_xlen(old));
index 261880fe3761b725fdf4d642c3cccfab2c46b3d4..3ad613a1113ff3c156720b7028aedea9a937e729 100644 (file)
@@ -1,8 +1,8 @@
-sreg_t lhs = sext_xprlen(RS1);
-sreg_t rhs = sext_xprlen(RS2);
+sreg_t lhs = sext_xlen(RS1);
+sreg_t rhs = sext_xlen(RS2);
 if(rhs == 0)
   WRITE_RD(UINT64_MAX);
 else if(lhs == INT64_MIN && rhs == -1)
   WRITE_RD(lhs);
 else
-  WRITE_RD(sext_xprlen(lhs / rhs));
+  WRITE_RD(sext_xlen(lhs / rhs));
index fd878a2f3e8a50bef036289924d0f5ddc7ceea7f..4887ce0a6037cbc78e2b3833d57e21de21f34482 100644 (file)
@@ -1,6 +1,6 @@
-reg_t lhs = zext_xprlen(RS1);
-reg_t rhs = zext_xprlen(RS2);
+reg_t lhs = zext_xlen(RS1);
+reg_t rhs = zext_xlen(RS2);
 if(rhs == 0)
   WRITE_RD(UINT64_MAX);
 else
-  WRITE_RD(sext_xprlen(lhs / rhs));
+  WRITE_RD(sext_xlen(lhs / rhs));
index 9725bfd7a0fc89f926028297ab9fd4ae310330b3..c6b53311e6df7839bc545740a582bbfa71ef3367 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xprlen(RS1 * RS2));
+WRITE_RD(sext_xlen(RS1 * RS2));
index fa98ac6893f8a2919c3a974a916889cc8757427b..d074f26f6b5944486a2fd977f73ec999d03dcbce 100644 (file)
@@ -1,8 +1,8 @@
-sreg_t lhs = sext_xprlen(RS1);
-sreg_t rhs = sext_xprlen(RS2);
+sreg_t lhs = sext_xlen(RS1);
+sreg_t rhs = sext_xlen(RS2);
 if(rhs == 0)
   WRITE_RD(lhs);
 else if(lhs == INT64_MIN && rhs == -1)
   WRITE_RD(0);
 else
-  WRITE_RD(sext_xprlen(lhs % rhs));
+  WRITE_RD(sext_xlen(lhs % rhs));
index 646bb3a65fa9ccd053b666eb070b81c45ac75139..c29194732f00d93415df95368052bbef2e3ec4cf 100644 (file)
@@ -1,6 +1,6 @@
-reg_t lhs = zext_xprlen(RS1);
-reg_t rhs = zext_xprlen(RS2);
+reg_t lhs = zext_xlen(RS1);
+reg_t rhs = zext_xlen(RS2);
 if(rhs == 0)
-  WRITE_RD(sext_xprlen(RS1));
+  WRITE_RD(sext_xlen(RS1));
 else
-  WRITE_RD(sext_xprlen(lhs % rhs));
+  WRITE_RD(sext_xlen(lhs % rhs));
index 48c0acfca7284b1e2db889feb6adc0e5853085f2..7db761318f576847e2421ce2fbf4fabbcd71e8a7 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xprlen(RS1 << (RS2 & (xprlen-1))));
+WRITE_RD(sext_xlen(RS1 << (RS2 & (xlen-1))));
index 45c96574f511b35c681c8a2a91597f6cd3c45b02..403b9b733a5e3cce36c7885e906a80f4dace1309 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xprlen(sext_xprlen(RS1) >> (RS2 & (xprlen-1))));
+WRITE_RD(sext_xlen(sext_xlen(RS1) >> (RS2 & (xlen-1))));
index 95fb83e3340f71beb2ca64115ed14bda85f29ec4..9ed48f7449061acd822a616d24fb8b16303cb13b 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xprlen(RS1 - RS2));
+WRITE_RD(sext_xlen(RS1 - RS2));