2018-06-09 01:42:35 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s
|
2014-08-16 18:14:19 +08:00
|
|
|
|
2018-10-08 00:00:55 +08:00
|
|
|
define <4 x float> @fmul_zero_not_fast(<4 x float> %x) nounwind {
|
|
|
|
; CHECK-LABEL: fmul_zero_not_fast:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: mulps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%r = fmul <4 x float> %x, zeroinitializer
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x float> @fmul_zero_nsz_nnan(<4 x float> %x) nounwind {
|
|
|
|
; CHECK-LABEL: fmul_zero_nsz_nnan:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%r = fmul nsz nnan <4 x float> %x, zeroinitializer
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x float> @fmul_zero_nsz_nnan_undef(<4 x float> %x) nounwind {
|
|
|
|
; CHECK-LABEL: fmul_zero_nsz_nnan_undef:
|
|
|
|
; CHECK: # %bb.0:
|
2018-10-08 00:05:37 +08:00
|
|
|
; CHECK-NEXT: xorps %xmm0, %xmm0
|
2018-10-08 00:00:55 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%r = fmul nsz nnan <4 x float> %x, <float 0.0, float 0.0, float 0.0, float undef>
|
|
|
|
ret <4 x float> %r
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:14:19 +08:00
|
|
|
define float @fmul2_f32(float %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul2_f32:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: addss %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-08-16 18:14:19 +08:00
|
|
|
%y = fmul float %x, 2.0
|
|
|
|
ret float %y
|
|
|
|
}
|
|
|
|
|
|
|
|
; fmul 2.0, x -> fadd x, x for vectors.
|
|
|
|
|
|
|
|
define <4 x float> @fmul2_v4f32(<4 x float> %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul2_v4f32:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: addps %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-08-16 18:14:19 +08:00
|
|
|
%y = fmul <4 x float> %x, <float 2.0, float 2.0, float 2.0, float 2.0>
|
|
|
|
ret <4 x float> %y
|
|
|
|
}
|
|
|
|
|
2018-10-08 00:00:55 +08:00
|
|
|
define <4 x float> @fmul2_v4f32_undef(<4 x float> %x) {
|
|
|
|
; CHECK-LABEL: fmul2_v4f32_undef:
|
|
|
|
; CHECK: # %bb.0:
|
2018-10-08 00:05:37 +08:00
|
|
|
; CHECK-NEXT: addps %xmm0, %xmm0
|
2018-10-08 00:00:55 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%y = fmul <4 x float> %x, <float undef, float 2.0, float 2.0, float 2.0>
|
|
|
|
ret <4 x float> %y
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:14:19 +08:00
|
|
|
define <4 x float> @constant_fold_fmul_v4f32(<4 x float> %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: constant_fold_fmul_v4f32:
|
|
|
|
; CHECK: # %bb.0:
|
2018-10-29 12:52:04 +08:00
|
|
|
; CHECK-NEXT: movaps {{.*#+}} xmm0 = [8.0E+0,8.0E+0,8.0E+0,8.0E+0]
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-08-16 18:14:19 +08:00
|
|
|
%y = fmul <4 x float> <float 4.0, float 4.0, float 4.0, float 4.0>, <float 2.0, float 2.0, float 2.0, float 2.0>
|
|
|
|
ret <4 x float> %y
|
|
|
|
}
|
|
|
|
|
2018-10-08 00:00:55 +08:00
|
|
|
define <4 x float> @constant_fold_fmul_v4f32_undef(<4 x float> %x) {
|
|
|
|
; CHECK-LABEL: constant_fold_fmul_v4f32_undef:
|
|
|
|
; CHECK: # %bb.0:
|
2018-10-29 12:52:04 +08:00
|
|
|
; CHECK-NEXT: movaps {{.*#+}} xmm0 = [8.0E+0,NaN,8.0E+0,NaN]
|
2018-10-08 00:00:55 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%y = fmul <4 x float> <float 4.0, float undef, float 4.0, float 4.0>, <float 2.0, float 2.0, float 2.0, float undef>
|
|
|
|
ret <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
|
|
|
define <4 x float> @fmul0_v4f32_nsz_nnan(<4 x float> %x) {
|
2019-07-11 02:23:26 +08:00
|
|
|
; CHECK-LABEL: fmul0_v4f32_nsz_nnan:
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xorps %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2019-07-11 02:23:26 +08:00
|
|
|
%y = fmul nnan nsz <4 x float> %x, <float 0.0, float 0.0, float 0.0, float 0.0>
|
2014-08-16 18:14:19 +08:00
|
|
|
ret <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
|
|
|
define <4 x float> @fmul0_v4f32_undef(<4 x float> %x) {
|
2018-10-08 00:00:55 +08:00
|
|
|
; CHECK-LABEL: fmul0_v4f32_undef:
|
|
|
|
; CHECK: # %bb.0:
|
2018-10-08 00:05:37 +08:00
|
|
|
; CHECK-NEXT: xorps %xmm0, %xmm0
|
2018-10-08 00:00:55 +08:00
|
|
|
; CHECK-NEXT: retq
|
2019-07-11 02:23:26 +08:00
|
|
|
%y = fmul nnan nsz <4 x float> %x, <float undef, float 0.0, float undef, float 0.0>
|
2018-10-08 00:00:55 +08:00
|
|
|
ret <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
|
|
|
define <4 x float> @fmul_c2_c4_v4f32(<4 x float> %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul_c2_c4_v4f32:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
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
|
|
|
%y = fmul fast <4 x float> %x, <float 2.0, float 2.0, float 2.0, float 2.0>
|
|
|
|
%z = fmul fast <4 x float> %y, <float 4.0, float 4.0, float 4.0, float 4.0>
|
2014-08-16 18:14:19 +08:00
|
|
|
ret <4 x float> %z
|
|
|
|
}
|
|
|
|
|
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> @fmul_c3_c4_v4f32(<4 x float> %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul_c3_c4_v4f32:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
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
|
|
|
%y = fmul fast <4 x float> %x, <float 3.0, float 3.0, float 3.0, float 3.0>
|
|
|
|
%z = fmul fast <4 x float> %y, <float 4.0, float 4.0, float 4.0, float 4.0>
|
2014-08-16 18:14:19 +08:00
|
|
|
ret <4 x float> %z
|
|
|
|
}
|
|
|
|
|
2015-12-08 10:37:48 +08:00
|
|
|
; CHECK: float 5
|
|
|
|
; CHECK: float 12
|
|
|
|
; CHECK: float 21
|
|
|
|
; CHECK: float 32
|
2018-06-09 01:42:35 +08:00
|
|
|
|
|
|
|
; We should be able to pre-multiply the two constant vectors.
|
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> @fmul_v4f32_two_consts_no_splat(<4 x float> %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul_v4f32_two_consts_no_splat:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
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
|
|
|
%y = fmul fast <4 x float> %x, <float 1.0, float 2.0, float 3.0, float 4.0>
|
|
|
|
%z = fmul fast <4 x float> %y, <float 5.0, float 6.0, float 7.0, float 8.0>
|
2014-09-11 23:45:27 +08:00
|
|
|
ret <4 x float> %z
|
|
|
|
}
|
|
|
|
|
|
|
|
; Same as above, but reverse operands to make sure non-canonical form is also handled.
|
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> @fmul_v4f32_two_consts_no_splat_non_canonical(<4 x float> %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul_v4f32_two_consts_no_splat_non_canonical:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
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
|
|
|
%y = fmul fast <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, %x
|
|
|
|
%z = fmul fast <4 x float> <float 5.0, float 6.0, float 7.0, float 8.0>, %y
|
2014-09-11 23:45:27 +08:00
|
|
|
ret <4 x float> %z
|
|
|
|
}
|
|
|
|
|
2018-06-09 01:54:28 +08:00
|
|
|
; Node-level FMF and no function-level attributes.
|
|
|
|
|
|
|
|
define <4 x float> @fmul_v4f32_two_consts_no_splat_reassoc(<4 x float> %x) {
|
|
|
|
; CHECK-LABEL: fmul_v4f32_two_consts_no_splat_reassoc:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%y = fmul <4 x float> %x, <float 1.0, float 2.0, float 3.0, float 4.0>
|
|
|
|
%z = fmul reassoc <4 x float> %y, <float 5.0, float 6.0, float 7.0, float 8.0>
|
|
|
|
ret <4 x float> %z
|
|
|
|
}
|
|
|
|
|
|
|
|
; Multiplication by 2.0 is a special case because that gets converted to fadd x, x.
|
|
|
|
|
|
|
|
define <4 x float> @fmul_v4f32_two_consts_no_splat_reassoc_2(<4 x float> %x) {
|
|
|
|
; CHECK-LABEL: fmul_v4f32_two_consts_no_splat_reassoc_2:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%y = fadd <4 x float> %x, %x
|
|
|
|
%z = fmul reassoc <4 x float> %y, <float 5.0, float 6.0, float 7.0, float 8.0>
|
|
|
|
ret <4 x float> %z
|
|
|
|
}
|
|
|
|
|
2015-12-08 10:37:48 +08:00
|
|
|
; CHECK: float 6
|
|
|
|
; CHECK: float 14
|
|
|
|
; CHECK: float 24
|
|
|
|
; CHECK: float 36
|
2018-06-09 01:42:35 +08:00
|
|
|
|
|
|
|
; More than one use of a constant multiply should not inhibit the optimization.
|
|
|
|
; Instead of a chain of 2 dependent mults, this test will have 2 independent mults.
|
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> @fmul_v4f32_two_consts_no_splat_multiple_use(<4 x float> %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul_v4f32_two_consts_no_splat_multiple_use:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
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
|
|
|
%y = fmul fast <4 x float> %x, <float 1.0, float 2.0, float 3.0, float 4.0>
|
|
|
|
%z = fmul fast <4 x float> %y, <float 5.0, float 6.0, float 7.0, float 8.0>
|
|
|
|
%a = fadd fast <4 x float> %y, %z
|
2014-09-11 23:45:27 +08:00
|
|
|
ret <4 x float> %a
|
|
|
|
}
|
|
|
|
|
2015-03-01 08:09:35 +08:00
|
|
|
; PR22698 - http://llvm.org/bugs/show_bug.cgi?id=22698
|
|
|
|
; Make sure that we don't infinite loop swapping constants back and forth.
|
|
|
|
|
2015-12-08 10:37:48 +08:00
|
|
|
; CHECK: float 24
|
|
|
|
; CHECK: float 24
|
|
|
|
; CHECK: float 24
|
|
|
|
; CHECK: float 24
|
2018-06-09 01:42:35 +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 <4 x float> @PR22698_splats(<4 x float> %a) {
|
2015-03-01 08:09:35 +08:00
|
|
|
; CHECK-LABEL: PR22698_splats:
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%mul1 = fmul fast <4 x float> <float 2.0, float 2.0, float 2.0, float 2.0>, <float 3.0, float 3.0, float 3.0, float 3.0>
|
|
|
|
%mul2 = fmul fast <4 x float> <float 4.0, float 4.0, float 4.0, float 4.0>, %mul1
|
|
|
|
%mul3 = fmul fast <4 x float> %a, %mul2
|
|
|
|
ret <4 x float> %mul3
|
2015-03-01 08:09:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
; Same as above, but verify that non-splat vectors are handled correctly too.
|
|
|
|
|
2015-12-08 10:37:48 +08:00
|
|
|
; CHECK: float 45
|
|
|
|
; CHECK: float 120
|
|
|
|
; CHECK: float 231
|
|
|
|
; CHECK: float 384
|
2018-06-09 01:42:35 +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 <4 x float> @PR22698_no_splats(<4 x float> %a) {
|
2015-03-01 08:09:35 +08:00
|
|
|
; CHECK-LABEL: PR22698_no_splats:
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%mul1 = fmul fast <4 x float> <float 1.0, float 2.0, float 3.0, float 4.0>, <float 5.0, float 6.0, float 7.0, float 8.0>
|
|
|
|
%mul2 = fmul fast <4 x float> <float 9.0, float 10.0, float 11.0, float 12.0>, %mul1
|
|
|
|
%mul3 = fmul fast <4 x float> %a, %mul2
|
|
|
|
ret <4 x float> %mul3
|
2015-03-01 08:09:35 +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 @fmul_c2_c4_f32(float %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul_c2_c4_f32:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulss {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
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
|
|
|
%y = fmul fast float %x, 2.0
|
|
|
|
%z = fmul fast float %y, 4.0
|
2014-08-16 18:14:19 +08:00
|
|
|
ret float %z
|
|
|
|
}
|
|
|
|
|
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 @fmul_c3_c4_f32(float %x) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul_c3_c4_f32:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulss {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
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
|
|
|
%y = fmul fast float %x, 3.0
|
|
|
|
%z = fmul fast float %y, 4.0
|
2014-08-16 18:14:19 +08:00
|
|
|
ret float %z
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fmul_fneg_fneg_f32(float %x, float %y) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul_fneg_fneg_f32:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulss %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-08-16 18:14:19 +08:00
|
|
|
%x.neg = fsub float -0.0, %x
|
|
|
|
%y.neg = fsub float -0.0, %y
|
|
|
|
%mul = fmul float %x.neg, %y.neg
|
|
|
|
ret float %mul
|
|
|
|
}
|
2018-06-09 01:42:35 +08:00
|
|
|
|
2014-08-16 18:14:19 +08:00
|
|
|
define <4 x float> @fmul_fneg_fneg_v4f32(<4 x float> %x, <4 x float> %y) {
|
2018-06-09 01:42:35 +08:00
|
|
|
; CHECK-LABEL: fmul_fneg_fneg_v4f32:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: mulps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2014-08-16 18:14:19 +08:00
|
|
|
%x.neg = fsub <4 x float> <float -0.0, float -0.0, float -0.0, float -0.0>, %x
|
|
|
|
%y.neg = fsub <4 x float> <float -0.0, float -0.0, float -0.0, float -0.0>, %y
|
|
|
|
%mul = fmul <4 x float> %x.neg, %y.neg
|
|
|
|
ret <4 x float> %mul
|
|
|
|
}
|