2019-04-17 14:09:16 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2019-05-07 06:04:26 +08:00
|
|
|
; RUN: llc < %s -fast-isel -fast-isel-abort=3 -mtriple=x86_64-apple-darwin10 | FileCheck %s
|
2019-05-07 12:25:24 +08:00
|
|
|
; RUN: llc < %s -fast-isel -mtriple=i686-- -mattr=+sse2 | FileCheck --check-prefix=SSE2 %s
|
2013-04-11 07:30:20 +08:00
|
|
|
|
2009-09-04 06:53:57 +08:00
|
|
|
define double @doo(double %x) nounwind {
|
2019-04-17 14:09:16 +08:00
|
|
|
; CHECK-LABEL: doo:
|
|
|
|
; CHECK: ## %bb.0:
|
2019-05-07 03:29:24 +08:00
|
|
|
; CHECK-NEXT: movq %xmm0, %rax
|
|
|
|
; CHECK-NEXT: movabsq $-9223372036854775808, %rcx ## imm = 0x8000000000000000
|
|
|
|
; CHECK-NEXT: xorq %rax, %rcx
|
|
|
|
; CHECK-NEXT: movq %rcx, %xmm0
|
2019-04-17 14:09:16 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE2-LABEL: doo:
|
|
|
|
; SSE2: # %bb.0:
|
|
|
|
; SSE2-NEXT: pushl %ebp
|
|
|
|
; SSE2-NEXT: movl %esp, %ebp
|
|
|
|
; SSE2-NEXT: andl $-8, %esp
|
|
|
|
; SSE2-NEXT: subl $8, %esp
|
|
|
|
; SSE2-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
|
|
|
|
; SSE2-NEXT: xorps {{\.LCPI.*}}, %xmm0
|
|
|
|
; SSE2-NEXT: movlps %xmm0, (%esp)
|
|
|
|
; SSE2-NEXT: fldl (%esp)
|
|
|
|
; SSE2-NEXT: movl %ebp, %esp
|
|
|
|
; SSE2-NEXT: popl %ebp
|
|
|
|
; SSE2-NEXT: retl
|
2009-09-04 06:53:57 +08:00
|
|
|
%y = fsub double -0.0, %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @foo(float %x) nounwind {
|
2019-04-17 14:09:16 +08:00
|
|
|
; CHECK-LABEL: foo:
|
|
|
|
; CHECK: ## %bb.0:
|
2019-05-07 03:29:24 +08:00
|
|
|
; CHECK-NEXT: movd %xmm0, %eax
|
|
|
|
; CHECK-NEXT: xorl $2147483648, %eax ## imm = 0x80000000
|
|
|
|
; CHECK-NEXT: movd %eax, %xmm0
|
2019-04-17 14:09:16 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE2-LABEL: foo:
|
|
|
|
; SSE2: # %bb.0:
|
|
|
|
; SSE2-NEXT: pushl %eax
|
|
|
|
; SSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
|
|
|
|
; SSE2-NEXT: xorps {{\.LCPI.*}}, %xmm0
|
|
|
|
; SSE2-NEXT: movss %xmm0, (%esp)
|
|
|
|
; SSE2-NEXT: flds (%esp)
|
|
|
|
; SSE2-NEXT: popl %eax
|
|
|
|
; SSE2-NEXT: retl
|
2009-09-04 06:53:57 +08:00
|
|
|
%y = fsub float -0.0, %x
|
|
|
|
ret float %y
|
|
|
|
}
|
2019-05-07 06:04:26 +08:00
|
|
|
|
|
|
|
define void @goo(double* %x, double* %y) nounwind {
|
|
|
|
; CHECK-LABEL: goo:
|
|
|
|
; CHECK: ## %bb.0:
|
|
|
|
; CHECK-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
|
|
|
|
; CHECK-NEXT: movq %xmm0, %rax
|
|
|
|
; CHECK-NEXT: movabsq $-9223372036854775808, %rcx ## imm = 0x8000000000000000
|
|
|
|
; CHECK-NEXT: xorq %rax, %rcx
|
|
|
|
; CHECK-NEXT: movq %rcx, %xmm0
|
|
|
|
; CHECK-NEXT: movq %xmm0, (%rsi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE2-LABEL: goo:
|
|
|
|
; SSE2: # %bb.0:
|
|
|
|
; SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; SSE2-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
|
2019-05-07 12:25:24 +08:00
|
|
|
; SSE2-NEXT: xorps {{\.LCPI.*}}, %xmm0
|
2019-05-07 06:04:26 +08:00
|
|
|
; SSE2-NEXT: movsd %xmm0, (%eax)
|
|
|
|
; SSE2-NEXT: retl
|
|
|
|
%a = load double, double* %x
|
|
|
|
%b = fsub double -0.0, %a
|
|
|
|
store double %b, double* %y
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @loo(float* %x, float* %y) nounwind {
|
|
|
|
; CHECK-LABEL: loo:
|
|
|
|
; CHECK: ## %bb.0:
|
|
|
|
; CHECK-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
|
|
|
|
; CHECK-NEXT: movd %xmm0, %eax
|
|
|
|
; CHECK-NEXT: xorl $2147483648, %eax ## imm = 0x80000000
|
|
|
|
; CHECK-NEXT: movd %eax, %xmm0
|
|
|
|
; CHECK-NEXT: movd %xmm0, (%rsi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE2-LABEL: loo:
|
|
|
|
; SSE2: # %bb.0:
|
|
|
|
; SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
|
|
|
|
; SSE2-NEXT: movd %xmm0, %ecx
|
|
|
|
; SSE2-NEXT: xorl $2147483648, %ecx # imm = 0x80000000
|
|
|
|
; SSE2-NEXT: movd %ecx, %xmm0
|
|
|
|
; SSE2-NEXT: movd %xmm0, (%eax)
|
|
|
|
; SSE2-NEXT: retl
|
|
|
|
%a = load float, float* %x
|
|
|
|
%b = fsub float -0.0, %a
|
|
|
|
store float %b, float* %y
|
|
|
|
ret void
|
|
|
|
}
|
2019-05-09 01:27:08 +08:00
|
|
|
|
|
|
|
define double @too(double %x) nounwind {
|
|
|
|
; CHECK-LABEL: too:
|
|
|
|
; CHECK: ## %bb.0:
|
|
|
|
; CHECK-NEXT: movq %xmm0, %rax
|
|
|
|
; CHECK-NEXT: movabsq $-9223372036854775808, %rcx ## imm = 0x8000000000000000
|
|
|
|
; CHECK-NEXT: xorq %rax, %rcx
|
|
|
|
; CHECK-NEXT: movq %rcx, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE2-LABEL: too:
|
|
|
|
; SSE2: # %bb.0:
|
|
|
|
; SSE2-NEXT: pushl %ebp
|
|
|
|
; SSE2-NEXT: movl %esp, %ebp
|
|
|
|
; SSE2-NEXT: andl $-8, %esp
|
|
|
|
; SSE2-NEXT: subl $8, %esp
|
|
|
|
; SSE2-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
|
|
|
|
; SSE2-NEXT: xorps {{\.LCPI.*}}, %xmm0
|
|
|
|
; SSE2-NEXT: movlps %xmm0, (%esp)
|
|
|
|
; SSE2-NEXT: fldl (%esp)
|
|
|
|
; SSE2-NEXT: movl %ebp, %esp
|
|
|
|
; SSE2-NEXT: popl %ebp
|
|
|
|
; SSE2-NEXT: retl
|
|
|
|
%y = fneg double %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @zoo(float %x) nounwind {
|
|
|
|
; CHECK-LABEL: zoo:
|
|
|
|
; CHECK: ## %bb.0:
|
|
|
|
; CHECK-NEXT: movd %xmm0, %eax
|
|
|
|
; CHECK-NEXT: xorl $2147483648, %eax ## imm = 0x80000000
|
|
|
|
; CHECK-NEXT: movd %eax, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE2-LABEL: zoo:
|
|
|
|
; SSE2: # %bb.0:
|
|
|
|
; SSE2-NEXT: pushl %eax
|
|
|
|
; SSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
|
|
|
|
; SSE2-NEXT: xorps {{\.LCPI.*}}, %xmm0
|
|
|
|
; SSE2-NEXT: movss %xmm0, (%esp)
|
|
|
|
; SSE2-NEXT: flds (%esp)
|
|
|
|
; SSE2-NEXT: popl %eax
|
|
|
|
; SSE2-NEXT: retl
|
|
|
|
%y = fneg float %x
|
|
|
|
ret float %y
|
|
|
|
}
|