blob: 81373470d06926007b035ea1820aa53904df1cb6 [file] [log] [blame]
Dan Gohman0cb2f672009-09-11 18:36:27 +00001; RUN: llc < %s -march=cellspu > %t1.s
Chris Lattnerb39abf92008-01-18 19:53:43 +00002; RUN: grep fa %t1.s | count 5
3; RUN: grep fs %t1.s | count 5
4; RUN: grep fm %t1.s | count 15
5; RUN: grep fceq %t1.s | count 5
6; RUN: grep fcmeq %t1.s | count 5
7; RUN: grep fcgt %t1.s | count 5
8; RUN: grep fcmgt %t1.s | count 5
9; RUN: grep fma %t1.s | count 5
10; RUN: grep fnms %t1.s | count 5
Scott Micheldbac4cf2008-01-11 02:53:15 +000011; RUN: grep fms %t1.s | count 5
12target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
13target triple = "spu"
14
15declare <4 x i32> @llvm.spu.si.shli(<4 x i32>, i8)
16
17declare <4 x float> @llvm.spu.si.fa(<4 x float>, <4 x float>)
18declare <4 x float> @llvm.spu.si.fs(<4 x float>, <4 x float>)
19declare <4 x float> @llvm.spu.si.fm(<4 x float>, <4 x float>)
20
21declare <4 x float> @llvm.spu.si.fceq(<4 x float>, <4 x float>)
22declare <4 x float> @llvm.spu.si.fcmeq(<4 x float>, <4 x float>)
23declare <4 x float> @llvm.spu.si.fcgt(<4 x float>, <4 x float>)
24declare <4 x float> @llvm.spu.si.fcmgt(<4 x float>, <4 x float>)
25
26declare <4 x float> @llvm.spu.si.fma(<4 x float>, <4 x float>, <4 x float>)
27declare <4 x float> @llvm.spu.si.fnms(<4 x float>, <4 x float>, <4 x float>)
28declare <4 x float> @llvm.spu.si.fms(<4 x float>, <4 x float>, <4 x float>)
29
30define <4 x i32> @test(<4 x i32> %A) {
Scott Michele26d9a62008-03-05 23:00:19 +000031 call <4 x i32> @llvm.spu.si.shli(<4 x i32> %A, i8 3)
32 %Y = bitcast <4 x i32> %1 to <4 x i32>
33 ret <4 x i32> %Y
Scott Micheldbac4cf2008-01-11 02:53:15 +000034}
35
36define <4 x float> @fatest(<4 x float> %A, <4 x float> %B) {
Scott Michele26d9a62008-03-05 23:00:19 +000037 call <4 x float> @llvm.spu.si.fa(<4 x float> %A, <4 x float> %B)
38 %Y = bitcast <4 x float> %1 to <4 x float>
39 ret <4 x float> %Y
Scott Micheldbac4cf2008-01-11 02:53:15 +000040}
41
42define <4 x float> @fstest(<4 x float> %A, <4 x float> %B) {
43 call <4 x float> @llvm.spu.si.fs(<4 x float> %A, <4 x float> %B)
44 %Y = bitcast <4 x float> %1 to <4 x float>
45 ret <4 x float> %Y
46}
47
48define <4 x float> @fmtest(<4 x float> %A, <4 x float> %B) {
Scott Michele26d9a62008-03-05 23:00:19 +000049 call <4 x float> @llvm.spu.si.fm(<4 x float> %A, <4 x float> %B)
50 %Y = bitcast <4 x float> %1 to <4 x float>
51 ret <4 x float> %Y
Scott Micheldbac4cf2008-01-11 02:53:15 +000052}
53
54define <4 x float> @fceqtest(<4 x float> %A, <4 x float> %B) {
Scott Michele26d9a62008-03-05 23:00:19 +000055 call <4 x float> @llvm.spu.si.fceq(<4 x float> %A, <4 x float> %B)
56 %Y = bitcast <4 x float> %1 to <4 x float>
57 ret <4 x float> %Y
Scott Micheldbac4cf2008-01-11 02:53:15 +000058}
59
60define <4 x float> @fcmeqtest(<4 x float> %A, <4 x float> %B) {
Scott Michele26d9a62008-03-05 23:00:19 +000061 call <4 x float> @llvm.spu.si.fcmeq(<4 x float> %A, <4 x float> %B)
62 %Y = bitcast <4 x float> %1 to <4 x float>
63 ret <4 x float> %Y
Scott Micheldbac4cf2008-01-11 02:53:15 +000064}
65
66define <4 x float> @fcgttest(<4 x float> %A, <4 x float> %B) {
Scott Michele26d9a62008-03-05 23:00:19 +000067 call <4 x float> @llvm.spu.si.fcgt(<4 x float> %A, <4 x float> %B)
68 %Y = bitcast <4 x float> %1 to <4 x float>
69 ret <4 x float> %Y
Scott Micheldbac4cf2008-01-11 02:53:15 +000070}
71
72define <4 x float> @fcmgttest(<4 x float> %A, <4 x float> %B) {
Scott Michele26d9a62008-03-05 23:00:19 +000073 call <4 x float> @llvm.spu.si.fcmgt(<4 x float> %A, <4 x float> %B)
74 %Y = bitcast <4 x float> %1 to <4 x float>
75 ret <4 x float> %Y
Scott Micheldbac4cf2008-01-11 02:53:15 +000076}
77
78define <4 x float> @fmatest(<4 x float> %A, <4 x float> %B, <4 x float> %C) {
Scott Michele26d9a62008-03-05 23:00:19 +000079 call <4 x float> @llvm.spu.si.fma(<4 x float> %A, <4 x float> %B, <4 x float> %C)
80 %Y = bitcast <4 x float> %1 to <4 x float>
81 ret <4 x float> %Y
Scott Micheldbac4cf2008-01-11 02:53:15 +000082}
83
84define <4 x float> @fnmstest(<4 x float> %A, <4 x float> %B, <4 x float> %C) {
Scott Michele26d9a62008-03-05 23:00:19 +000085 call <4 x float> @llvm.spu.si.fnms(<4 x float> %A, <4 x float> %B, <4 x float> %C)
86 %Y = bitcast <4 x float> %1 to <4 x float>
87 ret <4 x float> %Y
Scott Micheldbac4cf2008-01-11 02:53:15 +000088}
89
90define <4 x float> @fmstest(<4 x float> %A, <4 x float> %B, <4 x float> %C) {
Scott Michele26d9a62008-03-05 23:00:19 +000091 call <4 x float> @llvm.spu.si.fms(<4 x float> %A, <4 x float> %B, <4 x float> %C)
92 %Y = bitcast <4 x float> %1 to <4 x float>
93 ret <4 x float> %Y
Chris Lattnerb39abf92008-01-18 19:53:43 +000094}