[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V3 09/12] Add helper functions for MIPS DSP Comp
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH V3 09/12] Add helper functions for MIPS DSP Compare-Pick instructions |
Date: |
Tue, 27 Mar 2012 10:42:24 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0 |
On 03/27/12 02:24, Jia Liu wrote:
> + uint32_t cc3 = 0, cc2 = 0, cc1 = 0, cc0 = 0;
> + uint32_t flag;
...
> + if (rs3 == rt3)
> + cc3 = 1;
Clearer as "cc3 = (rs3 == rt3);", etc.
I begin to wonder if it wouldn't be better to model the DSPControl
word as individual variables of their respective fields. That way
you don't need to involve ENV so much.
E.g.
Assume cpu_dspcc is a TCGv_i32 variable containing 4 bits.
case CMPGU_COND_QB:
gen_helper_cmpdu_cond_qb(cpu_gr[rd], cpu_gr[rs], cpu_gr[rt]);
break;
case CMPGDU_COND_QB:
gen_helper_cmpdu_cond_qb(cpu_dspcc, cpu_gr[rs], cpu_gr[rt]);
tcg_gen_mov(cpu_gr[rd], cpu_dspcc);
break;
No need for two separate helpers. Even if you don't decide to split
the field, you probably don't want to duplicate so much code in the
helpers file.
r~
- Re: [Qemu-devel] [PATCH V3 05/12] Add helper functions for MIPS DSP Arithmetic instructions, (continued)
- [Qemu-devel] [PATCH V3 07/12] Add helper functions for MIPS DSP Multiply instructions, Jia Liu, 2012/03/27
- [Qemu-devel] [PATCH V3 08/12] Add helper functions for MIPS DSP Bit/Manipulation instructions, Jia Liu, 2012/03/27
- [Qemu-devel] [PATCH V3 09/12] Add helper functions for MIPS DSP Compare-Pick instructions, Jia Liu, 2012/03/27
- Re: [Qemu-devel] [PATCH V3 09/12] Add helper functions for MIPS DSP Compare-Pick instructions,
Richard Henderson <=
- [Qemu-devel] [PATCH V3 11/12] Handle MIPS DSP instructions in target-mips/translate.c, Jia Liu, 2012/03/27
[Qemu-devel] [PATCH V3 12/12] add MIPS DSP testcases, Jia Liu, 2012/03/27
[Qemu-devel] [PATCH V3 10/12] Add helper functions for MIPS DSP Accumulator and DSPControl Access instrutions helpers, Jia Liu, 2012/03/27