2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc < %s -mtriple=i686-- -mattr=+sse4.1 -o %t
|
2019-06-14 03:24:51 +08:00
|
|
|
; RUN: grep xorps %t | count 1
|
2009-01-31 14:07:45 +08:00
|
|
|
|
|
|
|
; Test that when we don't -enable-unsafe-fp-math, we don't do the optimization
|
|
|
|
; -0 - (A - B) to (B - A) because A==B, -0 != 0
|
|
|
|
|
|
|
|
define float @negfp(float %a, float %b) {
|
|
|
|
entry:
|
2009-06-05 06:49:04 +08:00
|
|
|
%sub = fsub float %a, %b ; <float> [#uses=1]
|
|
|
|
%neg = fsub float -0.000000e+00, %sub ; <float> [#uses=1]
|
2009-01-31 14:07:45 +08:00
|
|
|
ret float %neg
|
2009-08-25 23:38:29 +08:00
|
|
|
}
|