diff options
author | Andrew Waterman <andrew@sifive.com> | 2021-09-15 15:35:01 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2021-09-15 15:35:01 -0700 |
commit | 734745a1d5b4ae93bc7b4f6898071ac3c3f78059 (patch) | |
tree | 044a4f07aa47fce07a7bcca2ffd3b49ba2a9018f /riscv | |
parent | 9a4465e67f39d12ab215df38e8e364a4ad9b26fc (diff) | |
download | spike-734745a1d5b4ae93bc7b4f6898071ac3c3f78059.zip spike-734745a1d5b4ae93bc7b4f6898071ac3c3f78059.tar.gz spike-734745a1d5b4ae93bc7b4f6898071ac3c3f78059.tar.bz2 |
Fix signed/unsigned warnings
The easiest solution was to make xlen a constant, rather than signed
or unsigned, since it's used in both contexts.
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/insn_template.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/riscv/insn_template.cc b/riscv/insn_template.cc index 1e79326..9d570f9 100644 --- a/riscv/insn_template.cc +++ b/riscv/insn_template.cc @@ -4,18 +4,20 @@ reg_t rv32_NAME(processor_t* p, insn_t insn, reg_t pc) { - int xlen = 32; + #define xlen 32 reg_t npc = sext_xlen(pc + insn_length(OPCODE)); #include "insns/NAME.h" trace_opcode(p, OPCODE, insn); + #undef xlen return npc; } reg_t rv64_NAME(processor_t* p, insn_t insn, reg_t pc) { - int xlen = 64; + #define xlen 64 reg_t npc = sext_xlen(pc + insn_length(OPCODE)); #include "insns/NAME.h" trace_opcode(p, OPCODE, insn); + #undef xlen return npc; } |