[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 04/32] target/mips: Use dup_const() to simplify
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v2 04/32] target/mips: Use dup_const() to simplify |
Date: |
Thu, 28 Oct 2021 22:53:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 10/27/21 21:06, Richard Henderson wrote:
> On 10/27/21 11:07 AM, Philippe Mathieu-Daudé wrote:
>> + uint64_t eval_big = dup_const(df, 0x80);
>> TCGv_i64 t0 = tcg_temp_new_i64();
>> TCGv_i64 t1 = tcg_temp_new_i64();
>> - switch (df) {
>> - case DF_BYTE:
>> - eval_zero_or_big = 0x0101010101010101ULL;
>> - eval_big = 0x8080808080808080ULL;
>> - break;
>> - case DF_HALF:
>> - eval_zero_or_big = 0x0001000100010001ULL;
>> - eval_big = 0x8000800080008000ULL;
>> - break;
>> - case DF_WORD:
>> - eval_zero_or_big = 0x0000000100000001ULL;
>> - eval_big = 0x8000000080000000ULL;
>> - break;
>> - case DF_DOUBLE:
>> - eval_zero_or_big = 0x0000000000000001ULL;
>> - eval_big = 0x8000000000000000ULL;
>
> The conversion is incorrect for eval_big.
> The conversion creates e.g.
>
> 0x0080 0080 0080 0080
> not
> 0x8000 8000 8000 8000
Oops...
> You'd have to do something like
>
> uint64_t eval_one = dup_const(df, 1);
> uint64_t eval_big = eval_one << ((8 << df) - 1);
Nice :)
- [PATCH v2 00/32] target/mips: Fully convert MSA opcodes to decodetree, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 02/32] target/mips: Fix MSA MSUBV.B opcode, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 01/32] target/mips: Fix MSA MADDV.B opcode, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 03/32] tests/tcg/mips: Run MSA opcodes tests on user-mode emulation, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 04/32] target/mips: Use dup_const() to simplify, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 05/32] target/mips: Have check_msa_access() return a boolean, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 06/32] target/mips: Use enum definitions from CPUMIPSMSADataFormat enum, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 07/32] target/mips: Rename sa16 -> sa, bz_df -> bz -> bz_v, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 10/32] target/mips: Convert MSA BIT instruction format to decodetree, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 12/32] target/mips: Convert MSA I8 instruction format to decodetree, Philippe Mathieu-Daudé, 2021/10/27
- [PATCH v2 11/32] target/mips: Convert MSA SHF opcode to decodetree, Philippe Mathieu-Daudé, 2021/10/27