[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes
From: |
Bastian Koppelmann |
Subject: |
Re: [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes |
Date: |
Thu, 17 Nov 2016 17:50:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 11/16/2016 08:25 PM, Richard Henderson wrote:
> +
> + OP_32_64(clz):
> + if (const_args[2]) {
> + tcg_debug_assert(have_bmi1);
> + tcg_debug_assert(args[2] == (rexw ? 64 : 32));
> + tcg_out_modrm(s, OPC_LZCNT + rexw, args[0], args[1]);
> + } else {
> + /* ??? See above. */
> + tcg_out_modrm(s, OPC_BSR + rexw, args[0], args[1]);
The Intel ISA manual states that it find the bit index of the most
significant bit, where the least significant bit is index 0. So for the
input 0x2 this should return 1. However this is not the number of
leading zeros.
Cheers,
Bastian
- [Qemu-devel] [PATCH 08/25] target-s390x: Use clz opcode, (continued)
- [Qemu-devel] [PATCH 08/25] target-s390x: Use clz opcode, Richard Henderson, 2016/11/16
- [Qemu-devel] [PATCH 11/25] target-unicore32: Use clz opcode, Richard Henderson, 2016/11/16
- [Qemu-devel] [PATCH 12/25] target-xtensa: Use clz opcode, Richard Henderson, 2016/11/16
- [Qemu-devel] [PATCH 13/25] target-arm: Use clz opcode, Richard Henderson, 2016/11/16
- [Qemu-devel] [PATCH 14/25] target-i386: Use clz and ctz opcodes, Richard Henderson, 2016/11/16
- [Qemu-devel] [PATCH 15/25] disas/i386.c: Handle tzcnt, Richard Henderson, 2016/11/16
- [Qemu-devel] [PATCH 17/25] tcg/ppc: Handle ctz and clz opcodes, Richard Henderson, 2016/11/16
- [Qemu-devel] [PATCH 18/25] tcg/aarch64: Handle ctz and clz opcodes, Richard Henderson, 2016/11/16
- [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes, Richard Henderson, 2016/11/16
- Re: [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes,
Bastian Koppelmann <=
- Re: [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes, Richard Henderson, 2016/11/17
- Re: [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes, Richard Henderson, 2016/11/17
- Re: [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes, Bastian Koppelmann, 2016/11/17
- Re: [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes, Richard Henderson, 2016/11/17
- Re: [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes, Bastian Koppelmann, 2016/11/18
- Re: [Qemu-devel] [PATCH 16/25] tcg/i386: Handle ctz and clz opcodes, Richard Henderson, 2016/11/21
[Qemu-devel] [PATCH 19/25] tcg/arm: Handle ctz and clz opcodes, Richard Henderson, 2016/11/16
[Qemu-devel] [PATCH 20/25] tcg/mips: Handle clz opcode, Richard Henderson, 2016/11/16
[Qemu-devel] [PATCH 23/25] target-arm: Use clrsb helper, Richard Henderson, 2016/11/16
[Qemu-devel] [PATCH 21/25] tcg/s390: Handle clz opcode, Richard Henderson, 2016/11/16