Chris Lattner | 95ab268 | 2006-03-17 20:04:40 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | llc |
| 2 | ; Test that vectors are scalarized/lowered correctly. |
| 3 | |
| 4 | %f1 = type <1 x float> |
| 5 | %f2 = type <2 x float> |
| 6 | %f4 = type <4 x float> |
| 7 | %f8 = type <8 x float> |
| 8 | |
| 9 | implementation |
| 10 | |
| 11 | void %test_f1(%f1 *%P, %f1* %Q, %f1 *%S) { |
| 12 | %p = load %f1 *%P |
| 13 | %q = load %f1* %Q |
| 14 | %R = add %f1 %p, %q |
| 15 | store %f1 %R, %f1 *%S |
| 16 | ret void |
| 17 | } |
| 18 | |
| 19 | void %test_f2(%f2 *%P, %f2* %Q, %f2 *%S) { |
| 20 | %p = load %f2* %P |
| 21 | %q = load %f2* %Q |
| 22 | %R = add %f2 %p, %q |
| 23 | store %f2 %R, %f2 *%S |
| 24 | ret void |
| 25 | } |
| 26 | |
| 27 | void %test_f4(%f4 *%P, %f4* %Q, %f4 *%S) { |
| 28 | %p = load %f4* %P |
| 29 | %q = load %f4* %Q |
| 30 | %R = add %f4 %p, %q |
| 31 | store %f4 %R, %f4 *%S |
| 32 | ret void |
| 33 | } |
| 34 | |
| 35 | void %test_f8(%f8 *%P, %f8* %Q, %f8 *%S) { |
| 36 | %p = load %f8* %P |
| 37 | %q = load %f8* %Q |
| 38 | %R = add %f8 %p, %q |
| 39 | store %f8 %R, %f8 *%S |
| 40 | ret void |
| 41 | } |