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