blob: 843505f13599446fe449bbe8c4b4e07dcef3c255 [file] [log] [blame]
Scott Michel58c58182008-01-17 20:38:41 +00001; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
Chris Lattner994d6cf2008-01-18 19:53:43 +00002; RUN: grep mpy %t1.s | count 44
3; RUN: grep mpyu %t1.s | count 4
4; RUN: grep mpyh %t1.s | count 10
5; RUN: grep mpyhh %t1.s | count 2
6; RUN: grep rotma %t1.s | count 12
7; RUN: grep rotmahi %t1.s | count 4
8; RUN: grep and %t1.s | count 2
9; RUN: grep selb %t1.s | count 6
10; RUN: grep fsmbi %t1.s | count 4
Scott Michela59d4692008-02-23 18:41:37 +000011; RUN: grep shli %t1.s | count 2
Chris Lattner994d6cf2008-01-18 19:53:43 +000012; RUN: grep shlhi %t1.s | count 4
13; RUN: grep ila %t1.s | count 2
Scott Michela59d4692008-02-23 18:41:37 +000014; RUN: grep xsbh %t1.s | count 4
Scott Michel58c58182008-01-17 20:38:41 +000015target 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"
16target triple = "spu"
17
18; 32-bit multiply instruction generation:
19define <4 x i32> @mpy_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
20entry:
21 %A = mul <4 x i32> %arg1, %arg2
22 ret <4 x i32> %A
23}
24
25define <4 x i32> @mpy_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
26entry:
27 %A = mul <4 x i32> %arg2, %arg1
28 ret <4 x i32> %A
29}
30
31define <8 x i16> @mpy_v8i16_1(<8 x i16> %arg1, <8 x i16> %arg2) {
32entry:
33 %A = mul <8 x i16> %arg1, %arg2
34 ret <8 x i16> %A
35}
36
37define <8 x i16> @mpy_v8i16_2(<8 x i16> %arg1, <8 x i16> %arg2) {
38entry:
39 %A = mul <8 x i16> %arg2, %arg1
40 ret <8 x i16> %A
41}
42
43define <16 x i8> @mul_v16i8_1(<16 x i8> %arg1, <16 x i8> %arg2) {
44entry:
45 %A = mul <16 x i8> %arg2, %arg1
46 ret <16 x i8> %A
47}
48
49define <16 x i8> @mul_v16i8_2(<16 x i8> %arg1, <16 x i8> %arg2) {
50entry:
51 %A = mul <16 x i8> %arg1, %arg2
52 ret <16 x i8> %A
53}
54
55define i32 @mul_i32_1(i32 %arg1, i32 %arg2) {
56entry:
Scott Michel53dec472008-03-05 23:00:19 +000057 %A = mul i32 %arg2, %arg1
58 ret i32 %A
Scott Michel58c58182008-01-17 20:38:41 +000059}
60
61define i32 @mul_i32_2(i32 %arg1, i32 %arg2) {
62entry:
Scott Michel53dec472008-03-05 23:00:19 +000063 %A = mul i32 %arg1, %arg2
64 ret i32 %A
Scott Michel58c58182008-01-17 20:38:41 +000065}
66
67define i16 @mul_i16_1(i16 %arg1, i16 %arg2) {
68entry:
Scott Michel53dec472008-03-05 23:00:19 +000069 %A = mul i16 %arg2, %arg1
70 ret i16 %A
Scott Michel58c58182008-01-17 20:38:41 +000071}
72
73define i16 @mul_i16_2(i16 %arg1, i16 %arg2) {
74entry:
Scott Michel53dec472008-03-05 23:00:19 +000075 %A = mul i16 %arg1, %arg2
76 ret i16 %A
Scott Michel58c58182008-01-17 20:38:41 +000077}
78
79define i8 @mul_i8_1(i8 %arg1, i8 %arg2) {
80entry:
Scott Michel53dec472008-03-05 23:00:19 +000081 %A = mul i8 %arg2, %arg1
82 ret i8 %A
Scott Michel58c58182008-01-17 20:38:41 +000083}
84
85define i8 @mul_i8_2(i8 %arg1, i8 %arg2) {
86entry:
Scott Michel53dec472008-03-05 23:00:19 +000087 %A = mul i8 %arg1, %arg2
88 ret i8 %A
Scott Michel58c58182008-01-17 20:38:41 +000089}