[aarch64-port-dev ] Another reproducer for AArch64 HS
Pavel Tisnovsky
ptisnovs at redhat.com
Fri Sep 13 10:08:49 PDT 2013
Hi Andrew,
the following reproducer ($attachment) is shorter and IMHO better than the previous one
(I'm not sure how to reproduce the issue introduced in changeset#4905)
Result for Hotspot @changeset#4904:
Testing for 1.0 against -0.0
OK
Testing for 1.7976931348623157E308 against -0.0
OK
Testing for -1.7976931348623157E308 against -0.0
OK
Testing for Infinity against -0.0
OK
Testing for -Infinity against -0.0
OK
Testing for NaN against -0.0
OK
Testing for 0.0 against -0.0
Iteration: 0 Double.equals() is broken!
Testing for -0.0 against -0.0
Iteration: 0 Double.equals() is broken!
Testing for 1.0 against +0.0
OK
Testing for 1.7976931348623157E308 against +0.0
OK
Testing for -1.7976931348623157E308 against +0.0
OK
Testing for Infinity against +0.0
OK
Testing for -Infinity against +0.0
OK
Testing for NaN against +0.0
OK
Testing for -0.0 against +0.0
OK
Testing for 0.0 against +0.0
OK
Result for Hotspot @changeset#4907:
Testing for 1.0 against -0.0
OK
Testing for 1.7976931348623157E308 against -0.0
OK
Testing for -1.7976931348623157E308 against -0.0
OK
Testing for Infinity against -0.0
OK
Testing for -Infinity against -0.0
OK
Testing for NaN against -0.0
OK
Testing for 0.0 against -0.0
OK
Testing for -0.0 against -0.0
OK
Testing for 1.0 against +0.0
OK
Testing for 1.7976931348623157E308 against +0.0
OK
Testing for -1.7976931348623157E308 against +0.0
OK
Testing for Infinity against +0.0
OK
Testing for -Infinity against +0.0
OK
Testing for NaN against +0.0
OK
Testing for -0.0 against +0.0
OK
Testing for 0.0 against +0.0
OK
Cheers,
Pavel
----- Andrew Haley <aph at redhat.com> wrote:
> Argh! I completely messed that up. I got the encodings the wrong
> way round, and was decoding what I should have been encoding. So it
> returned false except for values of zero.
>
> This one is right, I swear.
>
> Andrew.
>
>
> # HG changeset patch
> # User aph
> # Date 1379002844 -3600
> # Node ID 4afcbbbfaf7a4018766521e2b580c167c9c1f1e3
> # Parent 5e4c8854ea19ea3c673847d9f66d5184a1aa601c
> Fix the fix for operand_valid_for_float_immediate.
>
> diff -r 5e4c8854ea19 -r 4afcbbbfaf7a src/cpu/aarch64/vm/assembler_aarch64.cpp
> --- a/src/cpu/aarch64/vm/assembler_aarch64.cpp Thu Sep 12 16:04:07 2013 +0100
> +++ b/src/cpu/aarch64/vm/assembler_aarch64.cpp Thu Sep 12 17:20:44 2013 +0100
> @@ -1480,33 +1480,26 @@
> return encode_logical_immediate(is32, imm) != 0xffffffff;
> }
>
> -static jlong doubleToLongBits(jdouble d) {
> +static uint64_t doubleTo64Bits(jdouble d) {
> union {
> jdouble double_value;
> - jlong double_bits;
> + uint64_t double_bits;
> };
>
> double_value = d;
> return double_bits;
> }
>
> -static jint floatToIntBits(jfloat f) {
> - union {
> - jfloat float_value;
> - jint float_bits;
> - };
> +bool Assembler::operand_valid_for_float_immediate(double imm) {
> + // If imm is all zero bits we can use ZR as the source of a
> + // floating-point value.
> + if (doubleTo64Bits(imm) == 0)
> + return true;
>
> - float_value = f;
> - return float_bits;
> -}
> -
> -bool Assembler::operand_valid_for_float_immediate(double imm) {
> - // We try to encode the immediate value then we convert the encoded
> - // back and make sure it's the exact same bit pattern
> -
> - unsigned result = fp_immediate_for_encoding(floatToIntBits(imm), true);
> - return doubleToLongBits(imm)
> - == doubleToLongBits(encoding_for_fp_immediate(result));
> + // Otherwise try to encode imm then convert the encoded value back
> + // and make sure it's the exact same bit pattern.
> + unsigned result = encoding_for_fp_immediate(imm);
> + return doubleTo64Bits(imm) == fp_immediate_for_encoding(result, true);
> }
>
> int AbstractAssembler::code_fill_byte() {
>
More information about the aarch64-port-dev
mailing list