Kalle Raiskila | 4794807 | 2010-06-21 10:17:36 +0000 | [diff] [blame] | 1 | ; RUN: llc --march=cellspu < %s | FileCheck %s |
| 2 | |
| 3 | define <4 x float> @shuffle(<4 x float> %param1, <4 x float> %param2) { |
| 4 | ; CHECK: cwd {{\$.}}, 0($sp) |
| 5 | ; CHECK: shufb {{\$., \$4, \$3, \$.}} |
| 6 | %val= shufflevector <4 x float> %param1, <4 x float> %param2, <4 x i32> <i32 4,i32 1,i32 2,i32 3> |
| 7 | ret <4 x float> %val |
Kalle Raiskila | 4794807 | 2010-06-21 10:17:36 +0000 | [diff] [blame] | 8 | } |
| 9 | |
Kalle Raiskila | 91fdee1 | 2010-06-21 14:42:19 +0000 | [diff] [blame] | 10 | define <4 x float> @splat(float %param1) { |
Kalle Raiskila | 2e39498 | 2010-06-21 15:11:51 +0000 | [diff] [blame] | 11 | ; CHECK: lqa |
| 12 | ; CHECK: shufb $3 |
| 13 | ; CHECK: bi |
Kalle Raiskila | 91fdee1 | 2010-06-21 14:42:19 +0000 | [diff] [blame] | 14 | %vec = insertelement <1 x float> undef, float %param1, i32 0 |
| 15 | %val= shufflevector <1 x float> %vec, <1 x float> undef, <4 x i32> <i32 0,i32 0,i32 0,i32 0> |
| 16 | ret <4 x float> %val |
| 17 | } |
| 18 | |
Kalle Raiskila | ca9460f | 2010-08-18 10:20:29 +0000 | [diff] [blame^] | 19 | define void @test_insert( <2 x float>* %ptr, float %val1, float %val2 ) { |
| 20 | %sl2_17_tmp1 = insertelement <2 x float> zeroinitializer, float %val1, i32 0 |
| 21 | ;CHECK: lqa $6, |
| 22 | ;CHECK: shufb $4, $4, $5, $6 |
| 23 | %sl2_17 = insertelement <2 x float> %sl2_17_tmp1, float %val2, i32 1 |
| 24 | |
| 25 | ;CHECK: cdd $5, 0($3) |
| 26 | ;CHECK: lqd $6, 0($3) |
| 27 | ;CHECK: shufb $4, $4, $6, $5 |
| 28 | ;CHECK: stqd $4, 0($3) |
| 29 | ;CHECK: bi $lr |
| 30 | store <2 x float> %sl2_17, <2 x float>* %ptr |
| 31 | ret void |
| 32 | } |
| 33 | |