@@ -41,3 +41,45 @@ define i32 @"test_zext_pcd_i16_to_i32"() {
4141 %val2 = zext i16 %val to i32
4242 ret i32 %val2
4343}
44+
45+ define i16 @test_anyext_pcd_i8_to_i16 () nounwind {
46+ ; CHECK-LABEL: test_anyext_pcd_i8_to_i16:
47+ ; CHECK: ; %bb.0:
48+ ; CHECK-NEXT: move.b (__unnamed_1+4,%pc), %d0
49+ ; CHECK-NEXT: and.l #255, %d0
50+ ; CHECK-NEXT: lsl.w #8, %d0
51+ ; CHECK-NEXT: ; kill: def $wd0 killed $wd0 killed $d0
52+ ; CHECK-NEXT: rts
53+ %copyload = load i8 , ptr getelementptr inbounds nuw (i8 , ptr @0 , i32 4 )
54+ %insert_ext = zext i8 %copyload to i16
55+ %insert_shift = shl i16 %insert_ext , 8
56+ ret i16 %insert_shift
57+ }
58+
59+ define i32 @test_anyext_pcd_i8_to_i32 () nounwind {
60+ ; CHECK-LABEL: test_anyext_pcd_i8_to_i32:
61+ ; CHECK: ; %bb.0:
62+ ; CHECK-NEXT: moveq #24, %d1
63+ ; CHECK-NEXT: move.b (__unnamed_1+4,%pc), %d0
64+ ; CHECK-NEXT: and.l #255, %d0
65+ ; CHECK-NEXT: lsl.l %d1, %d0
66+ ; CHECK-NEXT: rts
67+ %copyload = load i8 , ptr getelementptr inbounds nuw (i8 , ptr @0 , i32 4 )
68+ %insert_ext = zext i8 %copyload to i32
69+ %insert_shift = shl i32 %insert_ext , 24
70+ ret i32 %insert_shift
71+ }
72+
73+ define i32 @test_anyext_pcd_i16_to_i32 () nounwind {
74+ ; CHECK-LABEL: test_anyext_pcd_i16_to_i32:
75+ ; CHECK: ; %bb.0:
76+ ; CHECK-NEXT: moveq #16, %d1
77+ ; CHECK-NEXT: move.w (__unnamed_1+4,%pc), %d0
78+ ; CHECK-NEXT: and.l #65535, %d0
79+ ; CHECK-NEXT: lsl.l %d1, %d0
80+ ; CHECK-NEXT: rts
81+ %copyload = load i16 , ptr getelementptr inbounds nuw (i8 , ptr @0 , i32 4 )
82+ %insert_ext = zext i16 %copyload to i32
83+ %insert_shift = shl i32 %insert_ext , 16
84+ ret i32 %insert_shift
85+ }
0 commit comments