target-microblaze: dec_msr: Use bool and extract32

Use bool and extract32 to represent the to, clr and
clrset flags.

No functional change.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
This commit is contained in:
Edgar E. Iglesias 2018-04-14 15:17:52 +02:00
parent 9ba8cd452b
commit 2023e9a3bc
1 changed files with 9 additions and 6 deletions

View File

@ -458,17 +458,20 @@ static void dec_msr(DisasContext *dc)
{ {
CPUState *cs = CPU(dc->cpu); CPUState *cs = CPU(dc->cpu);
TCGv_i32 t0, t1; TCGv_i32 t0, t1;
unsigned int sr, to, rn; unsigned int sr, rn;
bool to, clrset;
sr = dc->imm & ((1 << 14) - 1); sr = extract32(dc->imm, 0, 14);
to = dc->imm & (1 << 14); to = extract32(dc->imm, 14, 1);
clrset = extract32(dc->imm, 15, 1) == 0;
dc->type_b = 1; dc->type_b = 1;
if (to) if (to) {
dc->cpustate_changed = 1; dc->cpustate_changed = 1;
}
/* msrclr and msrset. */ /* msrclr and msrset. */
if (!(dc->imm & (1 << 15))) { if (clrset) {
unsigned int clr = dc->ir & (1 << 16); bool clr = extract32(dc->ir, 16, 1);
LOG_DIS("msr%s r%d imm=%x\n", clr ? "clr" : "set", LOG_DIS("msr%s r%d imm=%x\n", clr ? "clr" : "set",
dc->rd, dc->imm); dc->rd, dc->imm);