From: Andrew Waterman Date: Tue, 7 Sep 2010 07:19:19 +0000 (-0700) Subject: [sim, xcc] branches now have 2-byte-aligned displacements X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8f2695a0500587a80b09224befd68c10a4e22686;p=riscv-isa-sim.git [sim, xcc] branches now have 2-byte-aligned displacements This will facilitate 16-bit instructions later on --- diff --git a/riscv/decode.h b/riscv/decode.h index 1b631ae..dffb9be 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -28,6 +28,8 @@ const int SHAMT_BITS = 6; const int FUNCT_BITS = 3; const int FFUNCT_BITS = 5; const int BIGIMM_BITS = 20; +const int BRANCH_ALIGN_BITS = 1; +const int JUMP_ALIGN_BITS = 1; #define SR_ET 0x0000000000000001ULL #define SR_PS 0x0000000000000004ULL @@ -129,8 +131,8 @@ union insn_t #define SIMM ((int32_t)((uint32_t)insn.itype.imm<<(32-IMM_BITS))>>(32-IMM_BITS)) #define SHAMT insn.rtype.shamt #define TARGET insn.jtype.target -#define BRANCH_TARGET (npc + (SIMM*sizeof(insn_t))) -#define JUMP_TARGET ((npc & ~((1<