blob: 4d388b1d223355b2e38ea63205358d6008496fc5 [file] [log] [blame]
Scott Michel86c041f2007-12-20 00:44:13 +00001; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
2; RUN: grep lqa %t1.s | count 13 &&
3; RUN: grep shufb %t1.s | count 13 &&
4; RUN: grep 65520 %t1.s | count 1 &&
5; RUN: grep 43981 %t1.s | count 1 &&
6; RUN: grep 13702 %t1.s | count 1 &&
7; RUN: grep 81 %t1.s | count 2 &&
8; RUN: grep 28225 %t1.s | count 1 &&
9; RUN: grep 30720 %t1.s | count 1 &&
10; RUN: grep 192 %t1.s | count 32 &&
11; RUN: grep 128 %t1.s | count 30 &&
12; RUN: grep 224 %t1.s | count 2
13
Scott Michel9de5d0d2008-01-11 02:53:15 +000014target 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"
15target triple = "spu"
16
Scott Michel86c041f2007-12-20 00:44:13 +000017; 1311768467750121234 => 0x 12345678 abcdef12 (4660,22136/43981,61202)
18; 18446744073709551591 => 0x ffffffff ffffffe7 (-25)
19; 18446744073708516742 => 0x ffffffff fff03586 (-1034874)
20; 5308431 => 0x 00000000 0051000F
21; 9223372038704560128 => 0x 80000000 6e417800
22
23define i64 @i64_const_1() {
24 ret i64 1311768467750121234 ;; Constant pool spill
25}
26
27define i64 @i64_const_2() {
28 ret i64 18446744073709551591 ;; IL/SHUFB
29}
30
31define i64 @i64_const_3() {
32 ret i64 18446744073708516742 ;; IHLU/IOHL/SHUFB
33}
34
35define i64 @i64_const_4() {
36 ret i64 5308431 ;; ILHU/IOHL/SHUFB
37}
38
39define i64 @i64_const_5() {
40 ret i64 511 ;; IL/SHUFB
41}
42
43define i64 @i64_const_6() {
44 ret i64 -512 ;; IL/SHUFB
45}
46
47define i64 @i64_const_7() {
48 ret i64 9223372038704560128 ;; IHLU/IOHL/SHUFB
49}
50
51define i64 @i64_const_8() {
52 ret i64 0 ;; IL
53}
54
55; 0x4005bf0a8b145769 ->
56; (ILHU 0x4005 [16389]/IOHL 0xbf0a [48906])
57; (ILHU 0x8b14 [35604]/IOHL 0x5769 [22377])
58define double @f64_const_1() {
59 ret double 0x4005bf0a8b145769 ;; ILHU/IOHL via pattern
60}
61
62define double @f64_const_2() {
63 ret double 0x0010000000000000
64}
65
66define double @f64_const_3() {
67 ret double 0x7fefffffffffffff
68}
69
70define double @f64_const_4() {
71 ret double 0x400921fb54442d18
72}
73
74define double @f64_const_5() {
75 ret double 0xbff6a09e667f3bcd ;; ILHU/IOHL via pattern
76}
77
78define double @f64_const_6() {
79 ret double 0x3ff6a09e667f3bcd
80}
81
82define double @f64_const_7() {
83 ret double 0.000000e+00
84}