[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipula
From: |
Jovanovic, Petar |
Subject: |
Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions |
Date: |
Sat, 27 Oct 2012 22:58:15 +0000 |
+ case OPC_REPL_PH:
+ check_dsp(ctx);
+ {
+ imm = (ctx->opcode >> 16) & 0x03FF;
+ tcg_gen_movi_tl(cpu_gpr[ret], \
+ (target_long)((int32_t)imm << 16 | \
+ (uint32_t)(uint16_t)imm));
+ }
10-bit integer in REPL.PH is signed, so this code will not work for negative
values.
You need to sign-extend it, e.g. something like this:
+ imm = (ctx->opcode >> 16) & 0x03FF;
+ if (imm & (1 << 9)) {
+ /* imm is negative, sign-extend it to 16 bits. */
+ imm |= 0xFC00;
+ }
+ tcg_gen_movi_tl(cpu_gpr[ret], \
+ (target_long)((int32_t)imm << 16 | \
+ (uint32_t)(uint16_t)imm));
As far as I can see, the test cases for REPL.PH in
tests/tcg/mips/mips32-dsp/repl_ph.c cover only positive values.
Make sure you include test cases for negative values as well.
Petar
- Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions,
Jovanovic, Petar <=
- Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions, Jia Liu, 2012/10/29
- Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions, Jovanovic, Petar, 2012/10/29
- Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions, Jia Liu, 2012/10/30
- Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions, Peter Maydell, 2012/10/30
- Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions, Richard Henderson, 2012/10/31
- Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions, Jia Liu, 2012/10/31
- Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions, Aurelien Jarno, 2012/10/31
- Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions, Jia Liu, 2012/10/31
Re: [Qemu-devel] [PATCH v12 09/14] target-mips: Add ASE DSP bit/manipulation instructions, Peter Maydell, 2012/10/30