Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
|
2018-05-19 03:30:49 +08:00
|
|
|
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
define float @fadd_zero_strict(float %x) {
|
|
|
|
; CHECK-LABEL: fadd_zero_strict:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: addss %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-05-19 06:31:43 +08:00
|
|
|
%r = fadd float %x, 0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fadd_negzero(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fadd_negzero:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: retq
|
2018-05-19 06:31:43 +08:00
|
|
|
%r = fadd float %x, -0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
2018-05-19 03:30:49 +08:00
|
|
|
|
2018-06-19 07:44:59 +08:00
|
|
|
define float @fadd_produce_zero(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fadd_produce_zero:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-06-19 07:44:59 +08:00
|
|
|
%neg = fsub nsz float 0.0, %x
|
|
|
|
%r = fadd nnan float %neg, %x
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fadd_reassociate(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fadd_reassociate:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: addss {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-06-19 07:44:59 +08:00
|
|
|
%sum = fadd float %x, 8.0
|
|
|
|
%r = fadd reassoc nsz float %sum, 12.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2018-06-09 01:39:50 +08:00
|
|
|
define float @fadd_negzero_nsz(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fadd_negzero_nsz:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: retq
|
2018-06-09 01:39:50 +08:00
|
|
|
%r = fadd nsz float %x, -0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2018-05-19 06:31:43 +08:00
|
|
|
define float @fadd_zero_nsz(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fadd_zero_nsz:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: retq
|
2018-05-19 03:30:49 +08:00
|
|
|
%r = fadd nsz float %x, 0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2018-06-09 01:39:50 +08:00
|
|
|
define float @fsub_zero(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_zero:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: retq
|
2018-06-09 01:39:50 +08:00
|
|
|
%r = fsub float %x, 0.0
|
2018-05-19 03:30:49 +08:00
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2018-06-09 01:39:50 +08:00
|
|
|
define float @fsub_self(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_self:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-08-09 06:18:16 +08:00
|
|
|
%r = fsub nnan float %x, %x
|
2018-05-19 03:30:49 +08:00
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2018-06-15 02:48:31 +08:00
|
|
|
define float @fsub_neg_x_y(float %x, float %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_neg_x_y:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: subss %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-06-15 02:48:31 +08:00
|
|
|
%neg = fsub nsz float 0.0, %x
|
|
|
|
%r = fadd nsz float %neg, %y
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2018-08-08 06:52:57 +08:00
|
|
|
define float @fsub_neg_y(float %x, float %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_neg_y:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulss {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-08-09 07:06:59 +08:00
|
|
|
%mul = fmul float %x, 5.0
|
2018-08-09 06:18:16 +08:00
|
|
|
%add = fadd float %mul, %y
|
|
|
|
%r = fsub nsz reassoc float %y, %add
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2019-06-06 19:15:36 +08:00
|
|
|
define <4 x float> @fsub_neg_y_vector(<4 x float> %x, <4 x float> %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_neg_y_vector:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2019-06-06 02:55:54 +08:00
|
|
|
%mul = fmul <4 x float> %x, <float 5.0, float 5.0, float 5.0, float 5.0>
|
|
|
|
%add = fadd <4 x float> %mul, %y
|
|
|
|
%r = fsub nsz reassoc <4 x float> %y, %add
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
2019-06-06 19:15:36 +08:00
|
|
|
define <4 x float> @fsub_neg_y_vector_nonuniform(<4 x float> %x, <4 x float> %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_neg_y_vector_nonuniform:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2019-06-06 19:15:36 +08:00
|
|
|
%mul = fmul <4 x float> %x, <float 5.0, float 6.0, float 7.0, float 8.0>
|
|
|
|
%add = fadd <4 x float> %mul, %y
|
|
|
|
%r = fsub nsz reassoc <4 x float> %y, %add
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
2018-08-09 07:06:59 +08:00
|
|
|
define float @fsub_neg_y_commute(float %x, float %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_neg_y_commute:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulss {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-08-09 07:06:59 +08:00
|
|
|
%mul = fmul float %x, 5.0
|
|
|
|
%add = fadd float %y, %mul
|
|
|
|
%r = fsub nsz reassoc float %y, %add
|
|
|
|
ret float %r
|
|
|
|
}
|
2019-06-06 02:55:54 +08:00
|
|
|
|
|
|
|
define <4 x float> @fsub_neg_y_commute_vector(<4 x float> %x, <4 x float> %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_neg_y_commute_vector:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2019-06-06 02:55:54 +08:00
|
|
|
%mul = fmul <4 x float> %x, <float 5.0, float 5.0, float 5.0, float 5.0>
|
|
|
|
%add = fadd <4 x float> %y, %mul
|
|
|
|
%r = fsub nsz reassoc <4 x float> %y, %add
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
2018-08-09 06:18:16 +08:00
|
|
|
; Y - (X + Y) --> -X
|
|
|
|
|
|
|
|
define float @fsub_fadd_common_op_fneg(float %x, float %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_fadd_common_op_fneg:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-08-09 06:18:16 +08:00
|
|
|
%a = fadd float %x, %y
|
|
|
|
%r = fsub reassoc nsz float %y, %a
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
|
|
|
; Y - (X + Y) --> -X
|
|
|
|
|
|
|
|
define <4 x float> @fsub_fadd_common_op_fneg_vec(<4 x float> %x, <4 x float> %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_fadd_common_op_fneg_vec:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-08-09 06:18:16 +08:00
|
|
|
%a = fadd <4 x float> %x, %y
|
|
|
|
%r = fsub nsz reassoc <4 x float> %y, %a
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
|
|
|
; Y - (Y + X) --> -X
|
|
|
|
; Commute operands of the 'add'.
|
|
|
|
|
|
|
|
define float @fsub_fadd_common_op_fneg_commute(float %x, float %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_fadd_common_op_fneg_commute:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-08-09 06:18:16 +08:00
|
|
|
%a = fadd float %y, %x
|
|
|
|
%r = fsub reassoc nsz float %y, %a
|
2018-08-08 06:52:57 +08:00
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2018-08-09 06:18:16 +08:00
|
|
|
; Y - (Y + X) --> -X
|
|
|
|
|
|
|
|
define <4 x float> @fsub_fadd_common_op_fneg_commute_vec(<4 x float> %x, <4 x float> %y) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_fadd_common_op_fneg_commute_vec:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-08-09 06:18:16 +08:00
|
|
|
%a = fadd <4 x float> %y, %x
|
|
|
|
%r = fsub reassoc nsz <4 x float> %y, %a
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
define float @fsub_negzero_strict(float %x) {
|
|
|
|
; CHECK-LABEL: fsub_negzero_strict:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: addss %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-05-19 03:30:49 +08:00
|
|
|
%r = fsub float %x, -0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
define float @fsub_negzero_nsz(float %x) {
|
|
|
|
; CHECK-LABEL: fsub_negzero_nsz:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%r = fsub nsz float %x, -0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x float> @fsub_negzero_strict_vector(<4 x float> %x) {
|
|
|
|
; CHECK-LABEL: fsub_negzero_strict_vector:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: addps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2019-06-06 02:55:54 +08:00
|
|
|
%r = fsub <4 x float> %x, <float -0.0, float -0.0, float -0.0, float -0.0>
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
define <4 x float> @fsub_negzero_nsz_vector(<4 x float> %x) {
|
|
|
|
; CHECK-LABEL: fsub_negzero_nsz_vector:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%r = fsub nsz <4 x float> %x, <float -0.0, float -0.0, float -0.0, float -0.0>
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
2018-06-09 01:39:50 +08:00
|
|
|
define float @fsub_zero_nsz_1(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_zero_nsz_1:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: retq
|
2018-05-19 06:31:43 +08:00
|
|
|
%r = fsub nsz float %x, 0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2018-06-09 01:39:50 +08:00
|
|
|
define float @fsub_zero_nsz_2(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fsub_zero_nsz_2:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-06-09 01:39:50 +08:00
|
|
|
%r = fsub nsz float 0.0, %x
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
2018-05-19 03:30:49 +08:00
|
|
|
define float @fmul_zero(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fmul_zero:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-05-19 03:30:49 +08:00
|
|
|
%r = fmul nnan nsz float %x, 0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fmul_one(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fmul_one:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: retq
|
2018-05-19 03:30:49 +08:00
|
|
|
%r = fmul float %x, 1.0
|
|
|
|
ret float %r
|
|
|
|
}
|
2018-06-13 00:13:11 +08:00
|
|
|
|
|
|
|
define float @fmul_x_const_const(float %x) {
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; CHECK-LABEL: fmul_x_const_const:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulss {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2018-06-13 00:13:11 +08:00
|
|
|
%mul = fmul reassoc float %x, 9.0
|
|
|
|
%r = fmul reassoc float %mul, 4.0
|
|
|
|
ret float %r
|
|
|
|
}
|