replace ^ operator with rv_xor
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Oct 2018 04:46:37 +0000 (05:46 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Oct 2018 04:46:37 +0000 (05:46 +0100)
riscv/insns/xor.h
riscv/insns/xori.h
riscv/sv_insn_redirect.cc
riscv/sv_insn_redirect.h

index 771efa7fa05aa5f7341ba48f6cc66935ec788a5a..90cbd6a24385a18e70cf9c7dc1a4869c4697c9a8 100644 (file)
@@ -1 +1 @@
-WRITE_RD(RS1 ^ RS2);
+WRITE_RD(rv_xor(RS1, RS2));
index 33ce6307419d25055922e60bf4da30c89e3de8b3..e3b91cd20609a7c72edccb7f745822754244c7b8 100644 (file)
@@ -1 +1 @@
-WRITE_RD(insn.i_imm() ^ RS1);
+WRITE_RD(rv_xor(insn.i_imm(), RS1));
index 475f86e1070bdb92c29e71b48028ac4708f184d7..1b8e4f2b195743d7843cf261c207d31352ffdf29 100644 (file)
@@ -252,3 +252,8 @@ reg_t sv_proc_t::rv_or(reg_t lhs, reg_t rhs)
     return lhs | rhs;
 }
 
+reg_t sv_proc_t::rv_xor(reg_t lhs, reg_t rhs)
+{
+    return lhs ^ rhs;
+}
+
index 3f133beac7c7ab675e4faca259bc5ee844cb696a..af2864632f0b73115ac71d74e3d0ee7fa3cce6d7 100644 (file)
@@ -101,6 +101,7 @@ public:
     reg_t rv_mul(reg_t lhs, reg_t rhs);
     reg_t rv_and(reg_t lhs, reg_t rhs);
     reg_t rv_or(reg_t lhs, reg_t rhs);
+    reg_t rv_xor(reg_t lhs, reg_t rhs);
 
 #include "sv_insn_decl.h"
 };