aboutsummaryrefslogtreecommitdiff
path: root/riscv/insn_template.cc
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2021-09-15 15:35:01 -0700
committerAndrew Waterman <andrew@sifive.com>2021-09-15 15:35:01 -0700
commit734745a1d5b4ae93bc7b4f6898071ac3c3f78059 (patch)
tree044a4f07aa47fce07a7bcca2ffd3b49ba2a9018f /riscv/insn_template.cc
parent9a4465e67f39d12ab215df38e8e364a4ad9b26fc (diff)
downloadspike-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/insn_template.cc')
-rw-r--r--riscv/insn_template.cc6
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;
}