@@ -73,8 +73,8 @@ define i16 @abd_ext_i16_i32(i16 %a, i32 %b) nounwind {
7373; CHECK-LABEL: abd_ext_i16_i32:
7474; CHECK: // %bb.0:
7575; CHECK-NEXT: and w8, w0, #0xffff
76- ; CHECK-NEXT: subs w8, w1, w8
77- ; CHECK-NEXT: cneg w0, w8, hs
76+ ; CHECK-NEXT: subs w8, w8, w1
77+ ; CHECK-NEXT: cneg w0, w8, hi
7878; CHECK-NEXT: ret
7979 %aext = zext i16 %a to i64
8080 %bext = zext i32 %b to i64
@@ -104,8 +104,8 @@ define i16 @abd_ext_i16_undef(i16 %a, i16 %b) nounwind {
104104define i32 @abd_ext_i32 (i32 %a , i32 %b ) nounwind {
105105; CHECK-LABEL: abd_ext_i32:
106106; CHECK: // %bb.0:
107- ; CHECK-NEXT: subs w8, w1, w0
108- ; CHECK-NEXT: cneg w0, w8, hs
107+ ; CHECK-NEXT: subs w8, w0, w1
108+ ; CHECK-NEXT: cneg w0, w8, hi
109109; CHECK-NEXT: ret
110110 %aext = zext i32 %a to i64
111111 %bext = zext i32 %b to i64
@@ -119,9 +119,8 @@ define i32 @abd_ext_i32(i32 %a, i32 %b) nounwind {
119119define i32 @abd_ext_i32_i16 (i32 %a , i16 %b ) nounwind {
120120; CHECK-LABEL: abd_ext_i32_i16:
121121; CHECK: // %bb.0:
122- ; CHECK-NEXT: and w8, w1, #0xffff
123- ; CHECK-NEXT: subs w8, w8, w0
124- ; CHECK-NEXT: cneg w0, w8, hs
122+ ; CHECK-NEXT: subs w8, w0, w1, uxth
123+ ; CHECK-NEXT: cneg w0, w8, hi
125124; CHECK-NEXT: ret
126125 %aext = zext i32 %a to i64
127126 %bext = zext i16 %b to i64
@@ -135,8 +134,8 @@ define i32 @abd_ext_i32_i16(i32 %a, i16 %b) nounwind {
135134define i32 @abd_ext_i32_undef (i32 %a , i32 %b ) nounwind {
136135; CHECK-LABEL: abd_ext_i32_undef:
137136; CHECK: // %bb.0:
138- ; CHECK-NEXT: subs w8, w1, w0
139- ; CHECK-NEXT: cneg w0, w8, hs
137+ ; CHECK-NEXT: subs w8, w0, w1
138+ ; CHECK-NEXT: cneg w0, w8, hi
140139; CHECK-NEXT: ret
141140 %aext = zext i32 %a to i64
142141 %bext = zext i32 %b to i64
@@ -150,8 +149,8 @@ define i32 @abd_ext_i32_undef(i32 %a, i32 %b) nounwind {
150149define i64 @abd_ext_i64 (i64 %a , i64 %b ) nounwind {
151150; CHECK-LABEL: abd_ext_i64:
152151; CHECK: // %bb.0:
153- ; CHECK-NEXT: subs x8, x1, x0
154- ; CHECK-NEXT: cneg x0, x8, hs
152+ ; CHECK-NEXT: subs x8, x0, x1
153+ ; CHECK-NEXT: cneg x0, x8, hi
155154; CHECK-NEXT: ret
156155 %aext = zext i64 %a to i128
157156 %bext = zext i64 %b to i128
@@ -165,8 +164,8 @@ define i64 @abd_ext_i64(i64 %a, i64 %b) nounwind {
165164define i64 @abd_ext_i64_undef (i64 %a , i64 %b ) nounwind {
166165; CHECK-LABEL: abd_ext_i64_undef:
167166; CHECK: // %bb.0:
168- ; CHECK-NEXT: subs x8, x1, x0
169- ; CHECK-NEXT: cneg x0, x8, hs
167+ ; CHECK-NEXT: subs x8, x0, x1
168+ ; CHECK-NEXT: cneg x0, x8, hi
170169; CHECK-NEXT: ret
171170 %aext = zext i64 %a to i128
172171 %bext = zext i64 %b to i128
0 commit comments