1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -fast-isel -fast-isel-abort=3 -mtriple=x86_64-apple-darwin10 | FileCheck %s
3 ; RUN: llc < %s -fast-isel -mtriple=i686-- -mattr=+sse2 | FileCheck --check-prefix=SSE2 %s
5 define double @fneg_f64(double %x) nounwind {
6 ; CHECK-LABEL: fneg_f64:
8 ; CHECK-NEXT: movq %xmm0, %rax
9 ; CHECK-NEXT: movabsq $-9223372036854775808, %rcx ## imm = 0x8000000000000000
10 ; CHECK-NEXT: xorq %rax, %rcx
11 ; CHECK-NEXT: movq %rcx, %xmm0
14 ; SSE2-LABEL: fneg_f64:
16 ; SSE2-NEXT: pushl %ebp
17 ; SSE2-NEXT: movl %esp, %ebp
18 ; SSE2-NEXT: andl $-8, %esp
19 ; SSE2-NEXT: subl $8, %esp
20 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
21 ; SSE2-NEXT: xorps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
22 ; SSE2-NEXT: movlps %xmm0, (%esp)
23 ; SSE2-NEXT: fldl (%esp)
24 ; SSE2-NEXT: movl %ebp, %esp
25 ; SSE2-NEXT: popl %ebp
31 define float @fneg_f32(float %x) nounwind {
32 ; CHECK-LABEL: fneg_f32:
34 ; CHECK-NEXT: movd %xmm0, %eax
35 ; CHECK-NEXT: xorl $2147483648, %eax ## imm = 0x80000000
36 ; CHECK-NEXT: movd %eax, %xmm0
39 ; SSE2-LABEL: fneg_f32:
41 ; SSE2-NEXT: pushl %eax
42 ; SSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
43 ; SSE2-NEXT: xorps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
44 ; SSE2-NEXT: movss %xmm0, (%esp)
45 ; SSE2-NEXT: flds (%esp)
46 ; SSE2-NEXT: popl %eax
52 define void @fneg_f64_mem(ptr %x, ptr %y) nounwind {
53 ; CHECK-LABEL: fneg_f64_mem:
55 ; CHECK-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
56 ; CHECK-NEXT: movq %xmm0, %rax
57 ; CHECK-NEXT: movabsq $-9223372036854775808, %rcx ## imm = 0x8000000000000000
58 ; CHECK-NEXT: xorq %rax, %rcx
59 ; CHECK-NEXT: movq %rcx, %xmm0
60 ; CHECK-NEXT: movq %xmm0, (%rsi)
63 ; SSE2-LABEL: fneg_f64_mem:
65 ; SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
66 ; SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
67 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
68 ; SSE2-NEXT: xorps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
69 ; SSE2-NEXT: movsd %xmm0, (%eax)
71 %a = load double, ptr %x
73 store double %b, ptr %y
77 define void @fneg_f32_mem(ptr %x, ptr %y) nounwind {
78 ; CHECK-LABEL: fneg_f32_mem:
80 ; CHECK-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
81 ; CHECK-NEXT: movd %xmm0, %eax
82 ; CHECK-NEXT: xorl $2147483648, %eax ## imm = 0x80000000
83 ; CHECK-NEXT: movd %eax, %xmm0
84 ; CHECK-NEXT: movd %xmm0, (%rsi)
87 ; SSE2-LABEL: fneg_f32_mem:
89 ; SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
90 ; SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
91 ; SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
92 ; SSE2-NEXT: movd %xmm0, %ecx
93 ; SSE2-NEXT: xorl $2147483648, %ecx # imm = 0x80000000
94 ; SSE2-NEXT: movd %ecx, %xmm0
95 ; SSE2-NEXT: movd %xmm0, (%eax)
97 %a = load float, ptr %x
99 store float %b, ptr %y