|
| From: | Bastian Koppelmann |
| Subject: | Re: [Qemu-devel] [PATCH 5/8] target-tricore: Add instructions of RR opcode format, that have 0x4b as the first opcode |
| Date: | Wed, 17 Dec 2014 15:43:37 +0000 |
| User-agent: | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 12/12/2014 08:45 PM, Richard Henderson wrote:
Probably doesn't matter much, but
ret = (ctpop8(r1) & 1)
| ((ctpop8(r1 >> 8) & 1) << 8)
| ((ctpop8(r1 >> 16) & 1) << 16)
| ((ctpop8(r1 >> 24) & 1) << 24);
This looks much more compact to me. Thanks!
One could also make a case for adding new helpers that use __builtin_parity rather than __builtin_popcount. I usually like to look at things like this and see how the general infrastructure can be improved...
This is a good idea. I'll send another patch, that adds the infrastructure. Cheers, Bastian
| [Prev in Thread] | Current Thread | [Next in Thread] |