Skip to content

Commit

Permalink
target/mips: Introduce the R5900 shift amount (SA) register [#4]
Browse files Browse the repository at this point in the history
Signed-off-by: Fredrik Noring <[email protected]>
  • Loading branch information
frno7 committed Mar 2, 2019
1 parent c523776 commit 1b78849
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions target/mips/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ struct TCState {

/* Upper 64-bit multimedia registers (MMRs); the lower 64-bit are GPRs */
uint64_t mmr[32];
uint32_t sar; /* Shift amount (SA) register */
};

typedef struct CPUMIPSState CPUMIPSState;
Expand Down
5 changes: 5 additions & 0 deletions target/mips/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,7 @@ static TCGv_i64 msa_wr_d[64];
#if defined(TARGET_MIPS64)
/* Upper 64-bit multimedia registers (MMRs); the lower 64-bit are GPRs */
static TCGv_i64 cpu_mmr[32];
static TCGv_i32 cpu_sar; /* Shift amount (SA) register */
#else
/* MXU registers */
static TCGv mxu_gpr[NUMBER_OF_MXU_REGISTERS - 1];
Expand Down Expand Up @@ -29935,6 +29936,10 @@ void mips_tcg_init(void)
offsetof(CPUMIPSState,
active_tc.mmr[i]),
regnames[i]);
cpu_sar = tcg_global_mem_new_i32(cpu_env,
offsetof(CPUMIPSState,
active_tc.sar),
"sa");
#else
for (i = 0; i < NUMBER_OF_MXU_REGISTERS - 1; i++) {
mxu_gpr[i] = tcg_global_mem_new(cpu_env,
Expand Down

0 comments on commit 1b78849

Please sign in to comment.