Implement Hauser misa.C misalignment proposal (#187)
[riscv-isa-sim.git] / riscv / decode.h
index 596a2ad9bfea1bfe24b38ed1b733e5a8c91bb688..8fc8ada1b269cad40ecf04203a5fac245aec0584 100644 (file)
@@ -206,7 +206,7 @@ private:
      } while(0)
 
 #define set_pc_and_serialize(x) \
-  do { reg_t __npc = (x); \
+  do { reg_t __npc = (x) & p->pc_alignment_mask(); \
        npc = PC_SERIALIZE_AFTER; \
        STATE.pc = __npc; \
      } while(0)