Dan Gohman | da594cf | 2009-09-09 00:09:15 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=thumb | FileCheck %s -check-prefix=V5 |
| 2 | ; RUN: llc < %s -march=thumb -mattr=+v6 | FileCheck %s -check-prefix=V6 |
Evan Cheng | 085e19b | 2009-06-24 06:36:07 +0000 | [diff] [blame] | 3 | |
Evan Cheng | 5e1d218 | 2009-08-28 00:31:43 +0000 | [diff] [blame] | 4 | ; rdar://7176514 |
| 5 | |
| 6 | define i32 @test1(i8* %t1) nounwind { |
| 7 | ; V5: ldrb |
| 8 | |
| 9 | ; V6: ldrb |
| 10 | %tmp.u = load i8* %t1 |
Evan Cheng | 085e19b | 2009-06-24 06:36:07 +0000 | [diff] [blame] | 11 | %tmp1.s = zext i8 %tmp.u to i32 |
| 12 | ret i32 %tmp1.s |
| 13 | } |
| 14 | |
Evan Cheng | 5e1d218 | 2009-08-28 00:31:43 +0000 | [diff] [blame] | 15 | define i32 @test2(i16* %t1) nounwind { |
| 16 | ; V5: ldrh |
| 17 | |
| 18 | ; V6: ldrh |
| 19 | %tmp.u = load i16* %t1 |
Evan Cheng | 085e19b | 2009-06-24 06:36:07 +0000 | [diff] [blame] | 20 | %tmp1.s = zext i16 %tmp.u to i32 |
| 21 | ret i32 %tmp1.s |
| 22 | } |
| 23 | |
Evan Cheng | 5e1d218 | 2009-08-28 00:31:43 +0000 | [diff] [blame] | 24 | define i32 @test3(i8* %t0) nounwind { |
| 25 | ; V5: ldrb |
| 26 | ; V5: lsls |
| 27 | ; V5: asrs |
| 28 | |
| 29 | ; V6: ldrb |
| 30 | ; V6: sxtb |
| 31 | %tmp.s = load i8* %t0 |
Evan Cheng | 085e19b | 2009-06-24 06:36:07 +0000 | [diff] [blame] | 32 | %tmp1.s = sext i8 %tmp.s to i32 |
| 33 | ret i32 %tmp1.s |
| 34 | } |
| 35 | |
Evan Cheng | 5e1d218 | 2009-08-28 00:31:43 +0000 | [diff] [blame] | 36 | define i32 @test4(i16* %t0) nounwind { |
| 37 | ; V5: ldrh |
| 38 | ; V5: lsls |
| 39 | ; V5: asrs |
| 40 | |
| 41 | ; V6: ldrh |
| 42 | ; V6: sxth |
| 43 | %tmp.s = load i16* %t0 |
| 44 | %tmp1.s = sext i16 %tmp.s to i32 |
| 45 | ret i32 %tmp1.s |
| 46 | } |
| 47 | |
| 48 | define i32 @test5() nounwind { |
| 49 | ; V5: movs r0, #0 |
| 50 | ; V5: ldrsh |
| 51 | |
| 52 | ; V6: movs r0, #0 |
| 53 | ; V6: ldrsh |
Evan Cheng | 085e19b | 2009-06-24 06:36:07 +0000 | [diff] [blame] | 54 | %tmp.s = load i16* null |
| 55 | %tmp1.s = sext i16 %tmp.s to i32 |
| 56 | ret i32 %tmp1.s |
| 57 | } |