diff options
author | James Molloy <james.molloy@arm.com> | 2017-02-13 12:32:47 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2017-02-13 12:32:47 +0000 |
commit | d5087896686b3eb9ef5de2130e9f1da12bc47216 (patch) | |
tree | 323be170cca2684cb1666d02b3a857cc6422ce2b /llvm/test/CodeGen/Thumb2/float-cmp.ll | |
parent | 45889a28e23cfa06be58d6935fff0bab926b57df (diff) | |
download | bcm5719-llvm-d5087896686b3eb9ef5de2130e9f1da12bc47216.tar.gz bcm5719-llvm-d5087896686b3eb9ef5de2130e9f1da12bc47216.zip |
[ARM] Use VCMP, not VCMPE, for floating point equality comparisons
When generating a floating point comparison we currently unconditionally
generate VCMPE. This has the sideeffect of setting the cumulative Invalid
bit in FPSCR if any of the operands are QNaN.
It is expected that use of a relational predicate on a QNaN value should
raise Invalid. Quoting from the C standard:
The relational and equality operators support the usual mathematical
relationships between numeric values. For any ordered pair of numeric
values exactly one of relationships the less, greater, equal and is true.
Relational operators may raise the floating-point exception when argument
values are NaNs.
The standard doesn't explicitly state the expectation for equality operators,
but the implication and obvious expectation is that equality operators
should not raise Invalid on a QNaN input, as those predicates are wholly
defined on unordered inputs (to return not equal).
Therefore, add a new operand to ARMISD::FPCMP and FPCMPZ indicating if
QNaN should raise Invalid, and pipe that through to TableGen.
llvm-svn: 294945
Diffstat (limited to 'llvm/test/CodeGen/Thumb2/float-cmp.ll')
-rw-r--r-- | llvm/test/CodeGen/Thumb2/float-cmp.ll | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/test/CodeGen/Thumb2/float-cmp.ll b/llvm/test/CodeGen/Thumb2/float-cmp.ll index 77b0999337c..834812cddd6 100644 --- a/llvm/test/CodeGen/Thumb2/float-cmp.ll +++ b/llvm/test/CodeGen/Thumb2/float-cmp.ll @@ -15,7 +15,7 @@ define i1 @cmp_f_false(float %a, float %b) { define i1 @cmp_f_oeq(float %a, float %b) { ; CHECK-LABEL: cmp_f_oeq: ; NONE: bl __aeabi_fcmpeq -; HARD: vcmpe.f32 +; HARD: vcmp.f32 ; HARD: moveq r0, #1 %1 = fcmp oeq float %a, %b ret i1 %1 @@ -56,7 +56,7 @@ define i1 @cmp_f_one(float %a, float %b) { ; CHECK-LABEL: cmp_f_one: ; NONE: bl __aeabi_fcmpgt ; NONE: bl __aeabi_fcmplt -; HARD: vcmpe.f32 +; HARD: vcmp.f32 ; HARD: movmi r0, #1 ; HARD: movgt r0, #1 %1 = fcmp one float %a, %b @@ -73,7 +73,7 @@ define i1 @cmp_f_ord(float %a, float %b) { ; CHECK-LABEL: cmp_f_ueq: ; NONE: bl __aeabi_fcmpeq ; NONE: bl __aeabi_fcmpun -; HARD: vcmpe.f32 +; HARD: vcmp.f32 ; HARD: moveq r0, #1 ; HARD: movvs r0, #1 %1 = fcmp ueq float %a, %b @@ -122,7 +122,7 @@ define i1 @cmp_f_ule(float %a, float %b) { define i1 @cmp_f_une(float %a, float %b) { ; CHECK-LABEL: cmp_f_une: ; NONE: bl __aeabi_fcmpeq -; HARD: vcmpe.f32 +; HARD: vcmp.f32 ; HARD: movne r0, #1 %1 = fcmp une float %a, %b ret i1 %1 @@ -154,7 +154,7 @@ define i1 @cmp_d_oeq(double %a, double %b) { ; CHECK-LABEL: cmp_d_oeq: ; NONE: bl __aeabi_dcmpeq ; SP: bl __aeabi_dcmpeq -; DP: vcmpe.f64 +; DP: vcmp.f64 ; DP: moveq r0, #1 %1 = fcmp oeq double %a, %b ret i1 %1 @@ -201,7 +201,7 @@ define i1 @cmp_d_one(double %a, double %b) { ; NONE: bl __aeabi_dcmplt ; SP: bl __aeabi_dcmpgt ; SP: bl __aeabi_dcmplt -; DP: vcmpe.f64 +; DP: vcmp.f64 ; DP: movmi r0, #1 ; DP: movgt r0, #1 %1 = fcmp one double %a, %b @@ -259,7 +259,7 @@ define i1 @cmp_d_ueq(double %a, double %b) { ; NONE: bl __aeabi_dcmpun ; SP: bl __aeabi_dcmpeq ; SP: bl __aeabi_dcmpun -; DP: vcmpe.f64 +; DP: vcmp.f64 ; DP: moveq r0, #1 ; DP: movvs r0, #1 %1 = fcmp ueq double %a, %b @@ -290,7 +290,7 @@ define i1 @cmp_d_une(double %a, double %b) { ; CHECK-LABEL: cmp_d_une: ; NONE: bl __aeabi_dcmpeq ; SP: bl __aeabi_dcmpeq -; DP: vcmpe.f64 +; DP: vcmp.f64 ; DP: movne r0, #1 %1 = fcmp une double %a, %b ret i1 %1 |