mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
adding baseline fp fold tests for unsafe on and off
llvm-svn: 332756
This commit is contained in:
parent
bd044fcab6
commit
733ac0bf52
62
test/CodeGen/X86/fp-fold.ll
Normal file
62
test/CodeGen/X86/fp-fold.ll
Normal file
@ -0,0 +1,62 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=ANY,STRICT
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -enable-unsafe-fp-math | FileCheck %s --check-prefixes=ANY,UNSAFE
|
||||
|
||||
; This is duplicated from tests for InstSimplify. If you're
|
||||
; adding something here, you should probably add it there too.
|
||||
|
||||
define float @fadd_zero_1(float %x) {
|
||||
; ANY-LABEL: fadd_zero_1:
|
||||
; ANY: # %bb.0:
|
||||
; ANY-NEXT: retq
|
||||
%r = fadd nsz float %x, 0.0
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fadd_zero_2(float %x) {
|
||||
; ANY-LABEL: fadd_zero_2:
|
||||
; ANY: # %bb.0:
|
||||
; ANY-NEXT: retq
|
||||
%r = fadd nsz float %x, -0.0
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fsub_zero_1(float %x) {
|
||||
; UNSAFE-LABEL: fsub_zero_1:
|
||||
; UNSAFE: # %bb.0:
|
||||
; UNSAFE-NEXT: retq
|
||||
%r = fsub float %x, 0.0
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fsub_zero_2(float %x) {
|
||||
; UNSAFE-LABEL: fsub_zero_2:
|
||||
; UNSAFE: # %bb.0:
|
||||
; UNSAFE-NEXT: retq
|
||||
%r = fsub float %x, -0.0
|
||||
ret float %r
|
||||
}
|
||||
|
||||
; TODO: handle x*0 for fast flags the same as unsafe
|
||||
define float @fmul_zero(float %x) {
|
||||
; STRICT-LABEL: fmul_zero:
|
||||
; STRICT: # %bb.0:
|
||||
; STRICT: xorps %xmm1, %xmm1
|
||||
; STRICT: mulss %xmm1, %xmm0
|
||||
; STRICT-NEXT: retq
|
||||
;
|
||||
; UNSAFE-LABEL: fmul_zero:
|
||||
; UNSAFE: # %bb.0:
|
||||
; UNSAFE: xorps %xmm0, %xmm0
|
||||
; UNSAFE-NEXT: retq
|
||||
%r = fmul nnan nsz float %x, 0.0
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fmul_one(float %x) {
|
||||
; ANY-LABEL: fmul_one:
|
||||
; ANY: # %bb.0:
|
||||
; ANY-NEXT: retq
|
||||
%r = fmul float %x, 1.0
|
||||
ret float %r
|
||||
}
|
Loading…
Reference in New Issue
Block a user