Request for reviews (S): 7063674: Wrong results from basic comparisons after calls to Long.bitCount(long)
Vladimir Kozlov
vladimir.kozlov at oracle.com
Mon Jun 11 16:37:31 PDT 2012
Looks good.
Vladimir
Christian Thalinger wrote:
> On Jun 11, 2012, at 4:14 PM, Vladimir Kozlov wrote:
>
>> I looked around and ReverseBytes instructions (which use shifts in addition to bswap) also missing KILL cr.
>
> Good catch. I fixed them too and updated the webrev.
>
> -- Chris
>
>> Thanks,
>> Vladimir
>>
>> Christian Thalinger wrote:
>>> http://cr.openjdk.java.net/~twisti/7063674
>>> 7063674: Wrong results from basic comparisons after calls to Long.bitCount(long)
>>> Reviewed-by:
>>> We are scheduling popcnt instructions between compare and branch/conditional
>>> move instructions because AD instructs are not defined to kill flags.
>>> But the Intel Instruction Set Reference says for POPCNT:
>>> Flags Affected
>>> OF, SF, ZF, AF, CF, PF are all cleared. ZF is set if SRC = 0, otherwise ZF is cleared
>>> The fix is to kill the flags in instructs that are using popcnt instructions.
>>> Tested with test case of CR. src/cpu/x86/vm/x86_32.ad
>>> src/cpu/x86/vm/x86_64.ad
>
More information about the hotspot-compiler-dev
mailing list