1 ; RUN: llc -march=sparc < %s | FileCheck %s -check-prefix=V8
2 ; RUN: llc -march=sparc -O0 < %s | FileCheck %s -check-prefix=V8-UNOPT
3 ; RUN: llc -march=sparc -mattr=v9 < %s | FileCheck %s -check-prefix=V9
10 ; V8-UNOPT-LABEL: test_neg:
12 ; V8-UNOPT: ! implicit-def
13 ; V8-UNOPT: fmovs {{.+}}, %f0
14 ; V8-UNOPT: fmovs {{.+}}, %f1
19 define double @test_neg() {
21 %0 = tail call double @get_double()
22 %1 = fsub double -0.000000e+00, %0
29 ; V8-UNOPT-LABEL: test_abs:
31 ; V8-UNOPT: ! implicit-def
32 ; V8-UNOPT: fmovs {{.+}}, %f0
33 ; V8-UNOPT: fmovs {{.+}}, %f1
38 define double @test_abs() {
40 %0 = tail call double @get_double()
41 %1 = tail call double @llvm.fabs.f64(double %0)
45 declare double @get_double()
46 declare double @llvm.fabs.f64(double) nounwind readonly
48 ; V8-LABEL: test_v9_floatreg:
49 ; V8: fsubd {{.+}}, {{.+}}, {{.+}}
50 ; V8: faddd {{.+}}, {{.+}}, [[R:%f(((1|2)?(0|2|4|6|8))|30)]]
51 ; V8: std [[R]], [%{{.+}}]
52 ; V8: ldd [%{{.+}}], %f0
54 ; V9-LABEL: test_v9_floatreg:
55 ; V9: fsubd {{.+}}, {{.+}}, {{.+}}
56 ; V9: faddd {{.+}}, {{.+}}, [[R:%f((3(2|4|6|8))|((4|5)(0|2|4|6|8))|(60|62))]]
57 ; V9: fmovd [[R]], %f0
60 define double @test_v9_floatreg() {
62 %0 = tail call double @get_double()
63 %1 = tail call double @get_double()
64 %2 = fsub double %0, %1
65 tail call void asm sideeffect "", "~{f0},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f8},~{f9},~{f10},~{f11},~{f12},~{f13},~{f14},~{f15},~{f16},~{f17},~{f18},~{f19},~{f20},~{f21},~{f22},~{f23},~{f24},~{f25},~{f26},~{f27},~{f28},~{f29},~{f30},~{f31}"()
66 %3 = fadd double %2, %2