Skip to content

Commit

Permalink
SPARC: Add asr17 register support
Browse files Browse the repository at this point in the history
This register is activated by CPU_FEATURE_ASR17 in the feature field.

Signed-off-by: Fabien Chouteau <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
  • Loading branch information
Fabien-Chouteau authored and blueswirl committed Jan 24, 2011
1 parent b04d989 commit 4a2ba23
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions target-sparc/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ typedef struct sparc_def_t {
#define CPU_FEATURE_CMT (1 << 12)
#define CPU_FEATURE_GL (1 << 13)
#define CPU_FEATURE_TA0_SHUTDOWN (1 << 14) /* Shutdown on "ta 0x0" */
#define CPU_FEATURE_ASR17 (1 << 15)
#ifndef TARGET_SPARC64
#define CPU_DEFAULT_FEATURES (CPU_FEATURE_FLOAT | CPU_FEATURE_SWAP | \
CPU_FEATURE_MUL | CPU_FEATURE_DIV | \
Expand Down
3 changes: 2 additions & 1 deletion target-sparc/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,8 @@ static const sparc_def_t sparc_defs[] = {
.mmu_sfsr_mask = 0xffffffff,
.mmu_trcr_mask = 0xffffffff,
.nwindows = 8,
.features = CPU_DEFAULT_FEATURES | CPU_FEATURE_TA0_SHUTDOWN,
.features = CPU_DEFAULT_FEATURES | CPU_FEATURE_TA0_SHUTDOWN |
CPU_FEATURE_ASR17,
},
#endif
};
Expand Down
11 changes: 11 additions & 0 deletions target-sparc/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,17 @@ static void disas_sparc_insn(DisasContext * dc)
case 0x10 ... 0x1f: /* implementation-dependent in the
SPARCv8 manual, rdy on the
microSPARC II */
/* Read Asr17 */
if (rs1 == 0x11 && dc->def->features & CPU_FEATURE_ASR17) {
TCGv r_const;

/* Read Asr17 for a Leon3 monoprocessor */
r_const = tcg_const_tl((1 << 8)
| (dc->def->nwindows - 1));
gen_movl_TN_reg(rd, r_const);
tcg_temp_free(r_const);
break;
}
#endif
gen_movl_TN_reg(rd, cpu_y);
break;
Expand Down

0 comments on commit 4a2ba23

Please sign in to comment.