summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2019-10-18 09:47:48 +0000
committerDavid Green <david.green@arm.com>2019-10-18 09:47:48 +0000
commite6f313b3807d23017d188aa7060b8cad09b3d095 (patch)
treea5ee51474dbccbb28c4739edcc39dec640610a6d /llvm/test/CodeGen/X86
parent0c7cc383e5b846bc9e9fcc599d3f342333f5c963 (diff)
downloadbcm5719-llvm-e6f313b3807d23017d188aa7060b8cad09b3d095.tar.gz
bcm5719-llvm-e6f313b3807d23017d188aa7060b8cad09b3d095.zip
[Codegen] Alter the default promotion for saturating adds and subs
The default promotion for the add_sat/sub_sat nodes currently does: ANY_EXTEND iN to iM SHL by M-N [US][ADD|SUB]SAT L/ASHR by M-N If the promoted add_sat or sub_sat node is not legal, this can produce code that effectively does a lot of shifting (and requiring large constants to be materialised) just to use the overflow flag. It is simpler to just do the saturation manually, using the higher bitwidth addition and a min/max against the saturating bounds. That is what this patch attempts to do. Differential Revision: https://reviews.llvm.org/D68926 llvm-svn: 375211
Diffstat (limited to 'llvm/test/CodeGen/X86')
-rw-r--r--llvm/test/CodeGen/X86/sadd_sat.ll41
-rw-r--r--llvm/test/CodeGen/X86/sadd_sat_plus.ll37
-rw-r--r--llvm/test/CodeGen/X86/ssub_sat.ll39
-rw-r--r--llvm/test/CodeGen/X86/ssub_sat_plus.ll32
-rw-r--r--llvm/test/CodeGen/X86/uadd_sat.ll21
-rw-r--r--llvm/test/CodeGen/X86/uadd_sat_plus.ll29
-rw-r--r--llvm/test/CodeGen/X86/usub_sat.ll31
-rw-r--r--llvm/test/CodeGen/X86/usub_sat_plus.ll37
8 files changed, 124 insertions, 143 deletions
diff --git a/llvm/test/CodeGen/X86/sadd_sat.ll b/llvm/test/CodeGen/X86/sadd_sat.ll
index 485e547f594..ffb4e731f9e 100644
--- a/llvm/test/CodeGen/X86/sadd_sat.ll
+++ b/llvm/test/CodeGen/X86/sadd_sat.ll
@@ -158,36 +158,29 @@ define signext i8 @func8(i8 signext %x, i8 signext %y) nounwind {
define signext i4 @func3(i4 signext %x, i4 signext %y) nounwind {
; X86-LABEL: func3:
; X86: # %bb.0:
-; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NEXT: movb {{[0-9]+}}(%esp), %dl
-; X86-NEXT: shlb $4, %dl
-; X86-NEXT: shlb $4, %cl
-; X86-NEXT: xorl %eax, %eax
-; X86-NEXT: movb %cl, %ch
-; X86-NEXT: addb %dl, %ch
-; X86-NEXT: setns %al
-; X86-NEXT: addl $127, %eax
-; X86-NEXT: addb %dl, %cl
-; X86-NEXT: movzbl %cl, %ecx
-; X86-NEXT: cmovol %eax, %ecx
-; X86-NEXT: sarb $4, %cl
+; X86-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-NEXT: addb {{[0-9]+}}(%esp), %al
+; X86-NEXT: movzbl %al, %ecx
+; X86-NEXT: cmpb $7, %al
+; X86-NEXT: movl $7, %eax
+; X86-NEXT: cmovll %ecx, %eax
+; X86-NEXT: cmpb $-8, %al
+; X86-NEXT: movl $248, %ecx
+; X86-NEXT: cmovgl %eax, %ecx
; X86-NEXT: movsbl %cl, %eax
; X86-NEXT: retl
;
; X64-LABEL: func3:
; X64: # %bb.0:
-; X64-NEXT: shlb $4, %sil
-; X64-NEXT: shlb $4, %dil
-; X64-NEXT: xorl %eax, %eax
-; X64-NEXT: movl %edi, %ecx
-; X64-NEXT: addb %sil, %cl
-; X64-NEXT: setns %al
-; X64-NEXT: addl $127, %eax
; X64-NEXT: addb %sil, %dil
-; X64-NEXT: movzbl %dil, %ecx
-; X64-NEXT: cmovol %eax, %ecx
-; X64-NEXT: sarb $4, %cl
-; X64-NEXT: movsbl %cl, %eax
+; X64-NEXT: movzbl %dil, %eax
+; X64-NEXT: cmpb $7, %al
+; X64-NEXT: movl $7, %ecx
+; X64-NEXT: cmovll %eax, %ecx
+; X64-NEXT: cmpb $-8, %cl
+; X64-NEXT: movl $248, %eax
+; X64-NEXT: cmovgl %ecx, %eax
+; X64-NEXT: movsbl %al, %eax
; X64-NEXT: retq
%tmp = call i4 @llvm.sadd.sat.i4(i4 %x, i4 %y);
ret i4 %tmp;
diff --git a/llvm/test/CodeGen/X86/sadd_sat_plus.ll b/llvm/test/CodeGen/X86/sadd_sat_plus.ll
index 76cc1613b47..2c902be8097 100644
--- a/llvm/test/CodeGen/X86/sadd_sat_plus.ll
+++ b/llvm/test/CodeGen/X86/sadd_sat_plus.ll
@@ -169,21 +169,19 @@ define signext i8 @func8(i8 signext %x, i8 signext %y, i8 signext %z) nounwind {
define signext i4 @func4(i4 signext %x, i4 signext %y, i4 signext %z) nounwind {
; X86-LABEL: func4:
; X86: # %bb.0:
-; X86-NEXT: movb {{[0-9]+}}(%esp), %dl
; X86-NEXT: movb {{[0-9]+}}(%esp), %al
; X86-NEXT: mulb {{[0-9]+}}(%esp)
; X86-NEXT: shlb $4, %al
-; X86-NEXT: shlb $4, %dl
-; X86-NEXT: xorl %ecx, %ecx
-; X86-NEXT: movb %dl, %ah
-; X86-NEXT: addb %al, %ah
-; X86-NEXT: setns %cl
-; X86-NEXT: addl $127, %ecx
-; X86-NEXT: addb %al, %dl
-; X86-NEXT: movzbl %dl, %eax
-; X86-NEXT: cmovol %ecx, %eax
; X86-NEXT: sarb $4, %al
-; X86-NEXT: movsbl %al, %eax
+; X86-NEXT: addb {{[0-9]+}}(%esp), %al
+; X86-NEXT: movzbl %al, %ecx
+; X86-NEXT: cmpb $7, %al
+; X86-NEXT: movl $7, %eax
+; X86-NEXT: cmovll %ecx, %eax
+; X86-NEXT: cmpb $-8, %al
+; X86-NEXT: movl $248, %ecx
+; X86-NEXT: cmovgl %eax, %ecx
+; X86-NEXT: movsbl %cl, %eax
; X86-NEXT: retl
;
; X64-LABEL: func4:
@@ -192,16 +190,15 @@ define signext i4 @func4(i4 signext %x, i4 signext %y, i4 signext %z) nounwind {
; X64-NEXT: # kill: def $al killed $al killed $eax
; X64-NEXT: mulb %dl
; X64-NEXT: shlb $4, %al
-; X64-NEXT: shlb $4, %dil
-; X64-NEXT: xorl %ecx, %ecx
-; X64-NEXT: movl %edi, %edx
-; X64-NEXT: addb %al, %dl
-; X64-NEXT: setns %cl
-; X64-NEXT: addl $127, %ecx
-; X64-NEXT: addb %al, %dil
-; X64-NEXT: movzbl %dil, %eax
-; X64-NEXT: cmovol %ecx, %eax
; X64-NEXT: sarb $4, %al
+; X64-NEXT: addb %dil, %al
+; X64-NEXT: movzbl %al, %eax
+; X64-NEXT: cmpb $7, %al
+; X64-NEXT: movl $7, %ecx
+; X64-NEXT: cmovll %eax, %ecx
+; X64-NEXT: cmpb $-8, %cl
+; X64-NEXT: movl $248, %eax
+; X64-NEXT: cmovgl %ecx, %eax
; X64-NEXT: movsbl %al, %eax
; X64-NEXT: retq
%a = mul i4 %y, %z
diff --git a/llvm/test/CodeGen/X86/ssub_sat.ll b/llvm/test/CodeGen/X86/ssub_sat.ll
index a92905a975b..5e7a3f93506 100644
--- a/llvm/test/CodeGen/X86/ssub_sat.ll
+++ b/llvm/test/CodeGen/X86/ssub_sat.ll
@@ -147,34 +147,29 @@ define signext i8 @func8(i8 signext %x, i8 signext %y) nounwind {
define signext i4 @func3(i4 signext %x, i4 signext %y) nounwind {
; X86-LABEL: func3:
; X86: # %bb.0:
-; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NEXT: movb {{[0-9]+}}(%esp), %dl
-; X86-NEXT: shlb $4, %dl
-; X86-NEXT: shlb $4, %cl
-; X86-NEXT: xorl %eax, %eax
-; X86-NEXT: cmpb %dl, %cl
-; X86-NEXT: setns %al
-; X86-NEXT: addl $127, %eax
-; X86-NEXT: subb %dl, %cl
-; X86-NEXT: movzbl %cl, %ecx
-; X86-NEXT: cmovol %eax, %ecx
-; X86-NEXT: sarb $4, %cl
+; X86-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-NEXT: subb {{[0-9]+}}(%esp), %al
+; X86-NEXT: movzbl %al, %ecx
+; X86-NEXT: cmpb $7, %al
+; X86-NEXT: movl $7, %eax
+; X86-NEXT: cmovll %ecx, %eax
+; X86-NEXT: cmpb $-8, %al
+; X86-NEXT: movl $248, %ecx
+; X86-NEXT: cmovgl %eax, %ecx
; X86-NEXT: movsbl %cl, %eax
; X86-NEXT: retl
;
; X64-LABEL: func3:
; X64: # %bb.0:
-; X64-NEXT: shlb $4, %sil
-; X64-NEXT: shlb $4, %dil
-; X64-NEXT: xorl %eax, %eax
-; X64-NEXT: cmpb %sil, %dil
-; X64-NEXT: setns %al
-; X64-NEXT: addl $127, %eax
; X64-NEXT: subb %sil, %dil
-; X64-NEXT: movzbl %dil, %ecx
-; X64-NEXT: cmovol %eax, %ecx
-; X64-NEXT: sarb $4, %cl
-; X64-NEXT: movsbl %cl, %eax
+; X64-NEXT: movzbl %dil, %eax
+; X64-NEXT: cmpb $7, %al
+; X64-NEXT: movl $7, %ecx
+; X64-NEXT: cmovll %eax, %ecx
+; X64-NEXT: cmpb $-8, %cl
+; X64-NEXT: movl $248, %eax
+; X64-NEXT: cmovgl %ecx, %eax
+; X64-NEXT: movsbl %al, %eax
; X64-NEXT: retq
%tmp = call i4 @llvm.ssub.sat.i4(i4 %x, i4 %y)
ret i4 %tmp
diff --git a/llvm/test/CodeGen/X86/ssub_sat_plus.ll b/llvm/test/CodeGen/X86/ssub_sat_plus.ll
index ed0718ea6a8..12c587f1a19 100644
--- a/llvm/test/CodeGen/X86/ssub_sat_plus.ll
+++ b/llvm/test/CodeGen/X86/ssub_sat_plus.ll
@@ -158,19 +158,19 @@ define signext i8 @func8(i8 signext %x, i8 signext %y, i8 signext %z) nounwind {
define signext i4 @func4(i4 signext %x, i4 signext %y, i4 signext %z) nounwind {
; X86-LABEL: func4:
; X86: # %bb.0:
-; X86-NEXT: movb {{[0-9]+}}(%esp), %dl
+; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
; X86-NEXT: movb {{[0-9]+}}(%esp), %al
; X86-NEXT: mulb {{[0-9]+}}(%esp)
; X86-NEXT: shlb $4, %al
-; X86-NEXT: shlb $4, %dl
-; X86-NEXT: xorl %ecx, %ecx
-; X86-NEXT: cmpb %al, %dl
-; X86-NEXT: setns %cl
-; X86-NEXT: addl $127, %ecx
-; X86-NEXT: subb %al, %dl
-; X86-NEXT: movzbl %dl, %eax
-; X86-NEXT: cmovol %ecx, %eax
; X86-NEXT: sarb $4, %al
+; X86-NEXT: subb %al, %cl
+; X86-NEXT: movzbl %cl, %eax
+; X86-NEXT: cmpb $7, %cl
+; X86-NEXT: movl $7, %ecx
+; X86-NEXT: cmovll %eax, %ecx
+; X86-NEXT: cmpb $-8, %cl
+; X86-NEXT: movl $248, %eax
+; X86-NEXT: cmovgl %ecx, %eax
; X86-NEXT: movsbl %al, %eax
; X86-NEXT: retl
;
@@ -180,15 +180,15 @@ define signext i4 @func4(i4 signext %x, i4 signext %y, i4 signext %z) nounwind {
; X64-NEXT: # kill: def $al killed $al killed $eax
; X64-NEXT: mulb %dl
; X64-NEXT: shlb $4, %al
-; X64-NEXT: shlb $4, %dil
-; X64-NEXT: xorl %ecx, %ecx
-; X64-NEXT: cmpb %al, %dil
-; X64-NEXT: setns %cl
-; X64-NEXT: addl $127, %ecx
+; X64-NEXT: sarb $4, %al
; X64-NEXT: subb %al, %dil
; X64-NEXT: movzbl %dil, %eax
-; X64-NEXT: cmovol %ecx, %eax
-; X64-NEXT: sarb $4, %al
+; X64-NEXT: cmpb $7, %al
+; X64-NEXT: movl $7, %ecx
+; X64-NEXT: cmovll %eax, %ecx
+; X64-NEXT: cmpb $-8, %cl
+; X64-NEXT: movl $248, %eax
+; X64-NEXT: cmovgl %ecx, %eax
; X64-NEXT: movsbl %al, %eax
; X64-NEXT: retq
%a = mul i4 %y, %z
diff --git a/llvm/test/CodeGen/X86/uadd_sat.ll b/llvm/test/CodeGen/X86/uadd_sat.ll
index 7124e453523..3d3a1f534b0 100644
--- a/llvm/test/CodeGen/X86/uadd_sat.ll
+++ b/llvm/test/CodeGen/X86/uadd_sat.ll
@@ -98,26 +98,21 @@ define zeroext i4 @func3(i4 zeroext %x, i4 zeroext %y) nounwind {
; X86-LABEL: func3:
; X86: # %bb.0:
; X86-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NEXT: shlb $4, %cl
-; X86-NEXT: shlb $4, %al
-; X86-NEXT: addb %cl, %al
+; X86-NEXT: addb {{[0-9]+}}(%esp), %al
+; X86-NEXT: movzbl %al, %ecx
+; X86-NEXT: cmpb $15, %al
+; X86-NEXT: movl $15, %eax
+; X86-NEXT: cmovbl %ecx, %eax
; X86-NEXT: movzbl %al, %eax
-; X86-NEXT: movl $255, %ecx
-; X86-NEXT: cmovael %eax, %ecx
-; X86-NEXT: shrb $4, %cl
-; X86-NEXT: movzbl %cl, %eax
; X86-NEXT: retl
;
; X64-LABEL: func3:
; X64: # %bb.0:
-; X64-NEXT: shlb $4, %sil
-; X64-NEXT: shlb $4, %dil
; X64-NEXT: addb %sil, %dil
; X64-NEXT: movzbl %dil, %eax
-; X64-NEXT: movl $255, %ecx
-; X64-NEXT: cmovael %eax, %ecx
-; X64-NEXT: shrb $4, %cl
+; X64-NEXT: cmpb $15, %al
+; X64-NEXT: movl $15, %ecx
+; X64-NEXT: cmovbl %eax, %ecx
; X64-NEXT: movzbl %cl, %eax
; X64-NEXT: retq
%tmp = call i4 @llvm.uadd.sat.i4(i4 %x, i4 %y)
diff --git a/llvm/test/CodeGen/X86/uadd_sat_plus.ll b/llvm/test/CodeGen/X86/uadd_sat_plus.ll
index 428e2933c46..ac102033717 100644
--- a/llvm/test/CodeGen/X86/uadd_sat_plus.ll
+++ b/llvm/test/CodeGen/X86/uadd_sat_plus.ll
@@ -108,17 +108,15 @@ define zeroext i8 @func8(i8 zeroext %x, i8 zeroext %y, i8 zeroext %z) nounwind {
define zeroext i4 @func4(i4 zeroext %x, i4 zeroext %y, i4 zeroext %z) nounwind {
; X86-LABEL: func4:
; X86: # %bb.0:
-; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
; X86-NEXT: movb {{[0-9]+}}(%esp), %al
; X86-NEXT: mulb {{[0-9]+}}(%esp)
-; X86-NEXT: shlb $4, %al
-; X86-NEXT: shlb $4, %cl
-; X86-NEXT: addb %al, %cl
-; X86-NEXT: movzbl %cl, %eax
-; X86-NEXT: movl $255, %ecx
-; X86-NEXT: cmovael %eax, %ecx
-; X86-NEXT: shrb $4, %cl
-; X86-NEXT: movzbl %cl, %eax
+; X86-NEXT: andb $15, %al
+; X86-NEXT: addb {{[0-9]+}}(%esp), %al
+; X86-NEXT: movzbl %al, %ecx
+; X86-NEXT: cmpb $15, %al
+; X86-NEXT: movl $15, %eax
+; X86-NEXT: cmovbl %ecx, %eax
+; X86-NEXT: movzbl %al, %eax
; X86-NEXT: retl
;
; X64-LABEL: func4:
@@ -126,13 +124,12 @@ define zeroext i4 @func4(i4 zeroext %x, i4 zeroext %y, i4 zeroext %z) nounwind {
; X64-NEXT: movl %esi, %eax
; X64-NEXT: # kill: def $al killed $al killed $eax
; X64-NEXT: mulb %dl
-; X64-NEXT: shlb $4, %al
-; X64-NEXT: shlb $4, %dil
-; X64-NEXT: addb %al, %dil
-; X64-NEXT: movzbl %dil, %eax
-; X64-NEXT: movl $255, %ecx
-; X64-NEXT: cmovael %eax, %ecx
-; X64-NEXT: shrb $4, %cl
+; X64-NEXT: andb $15, %al
+; X64-NEXT: addb %dil, %al
+; X64-NEXT: movzbl %al, %eax
+; X64-NEXT: cmpb $15, %al
+; X64-NEXT: movl $15, %ecx
+; X64-NEXT: cmovbl %eax, %ecx
; X64-NEXT: movzbl %cl, %eax
; X64-NEXT: retq
%a = mul i4 %y, %z
diff --git a/llvm/test/CodeGen/X86/usub_sat.ll b/llvm/test/CodeGen/X86/usub_sat.ll
index a7de6b593be..f39aee388fd 100644
--- a/llvm/test/CodeGen/X86/usub_sat.ll
+++ b/llvm/test/CodeGen/X86/usub_sat.ll
@@ -97,28 +97,27 @@ define zeroext i8 @func8(i8 zeroext %x, i8 zeroext %y) nounwind {
define zeroext i4 @func3(i4 zeroext %x, i4 zeroext %y) nounwind {
; X86-LABEL: func3:
; X86: # %bb.0:
+; X86-NEXT: pushl %ebx
; X86-NEXT: movb {{[0-9]+}}(%esp), %al
; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NEXT: shlb $4, %cl
-; X86-NEXT: shlb $4, %al
-; X86-NEXT: xorl %edx, %edx
-; X86-NEXT: subb %cl, %al
-; X86-NEXT: movzbl %al, %eax
-; X86-NEXT: cmovbl %edx, %eax
-; X86-NEXT: shrb $4, %al
-; X86-NEXT: movzbl %al, %eax
+; X86-NEXT: movzbl %cl, %edx
+; X86-NEXT: movzbl %al, %ebx
+; X86-NEXT: cmpb %al, %cl
+; X86-NEXT: cmoval %edx, %ebx
+; X86-NEXT: subb %al, %bl
+; X86-NEXT: movzbl %bl, %eax
+; X86-NEXT: andl $15, %eax
+; X86-NEXT: popl %ebx
; X86-NEXT: retl
;
; X64-LABEL: func3:
; X64: # %bb.0:
-; X64-NEXT: shlb $4, %sil
-; X64-NEXT: shlb $4, %dil
-; X64-NEXT: xorl %eax, %eax
-; X64-NEXT: subb %sil, %dil
-; X64-NEXT: movzbl %dil, %ecx
-; X64-NEXT: cmovbl %eax, %ecx
-; X64-NEXT: shrb $4, %cl
-; X64-NEXT: movzbl %cl, %eax
+; X64-NEXT: cmpb %sil, %dil
+; X64-NEXT: movl %esi, %eax
+; X64-NEXT: cmoval %edi, %eax
+; X64-NEXT: subb %sil, %al
+; X64-NEXT: movzbl %al, %eax
+; X64-NEXT: andl $15, %eax
; X64-NEXT: retq
%tmp = call i4 @llvm.usub.sat.i4(i4 %x, i4 %y)
ret i4 %tmp
diff --git a/llvm/test/CodeGen/X86/usub_sat_plus.ll b/llvm/test/CodeGen/X86/usub_sat_plus.ll
index 6a9e5a46642..f56e0962eac 100644
--- a/llvm/test/CodeGen/X86/usub_sat_plus.ll
+++ b/llvm/test/CodeGen/X86/usub_sat_plus.ll
@@ -111,17 +111,22 @@ define zeroext i8 @func8(i8 zeroext %x, i8 zeroext %y, i8 zeroext %z) nounwind {
define zeroext i4 @func4(i4 zeroext %x, i4 zeroext %y, i4 zeroext %z) nounwind {
; X86-LABEL: func4:
; X86: # %bb.0:
+; X86-NEXT: pushl %ebx
+; X86-NEXT: pushl %esi
; X86-NEXT: movb {{[0-9]+}}(%esp), %cl
; X86-NEXT: movb {{[0-9]+}}(%esp), %al
; X86-NEXT: mulb {{[0-9]+}}(%esp)
-; X86-NEXT: shlb $4, %al
-; X86-NEXT: shlb $4, %cl
-; X86-NEXT: xorl %edx, %edx
-; X86-NEXT: subb %al, %cl
-; X86-NEXT: movzbl %cl, %eax
-; X86-NEXT: cmovbl %edx, %eax
-; X86-NEXT: shrb $4, %al
-; X86-NEXT: movzbl %al, %eax
+; X86-NEXT: movl %eax, %edx
+; X86-NEXT: andb $15, %dl
+; X86-NEXT: movzbl %dl, %esi
+; X86-NEXT: movzbl %cl, %ebx
+; X86-NEXT: cmpb %dl, %cl
+; X86-NEXT: cmovbel %esi, %ebx
+; X86-NEXT: subb %al, %bl
+; X86-NEXT: movzbl %bl, %eax
+; X86-NEXT: andl $15, %eax
+; X86-NEXT: popl %esi
+; X86-NEXT: popl %ebx
; X86-NEXT: retl
;
; X64-LABEL: func4:
@@ -129,14 +134,14 @@ define zeroext i4 @func4(i4 zeroext %x, i4 zeroext %y, i4 zeroext %z) nounwind {
; X64-NEXT: movl %esi, %eax
; X64-NEXT: # kill: def $al killed $al killed $eax
; X64-NEXT: mulb %dl
-; X64-NEXT: shlb $4, %al
-; X64-NEXT: shlb $4, %dil
-; X64-NEXT: xorl %ecx, %ecx
-; X64-NEXT: subb %al, %dil
-; X64-NEXT: movzbl %dil, %eax
-; X64-NEXT: cmovbl %ecx, %eax
-; X64-NEXT: shrb $4, %al
-; X64-NEXT: movzbl %al, %eax
+; X64-NEXT: movl %eax, %ecx
+; X64-NEXT: andb $15, %cl
+; X64-NEXT: movzbl %cl, %ecx
+; X64-NEXT: cmpb %cl, %dil
+; X64-NEXT: cmoval %edi, %ecx
+; X64-NEXT: subb %al, %cl
+; X64-NEXT: movzbl %cl, %eax
+; X64-NEXT: andl $15, %eax
; X64-NEXT: retq
%a = mul i4 %y, %z
%tmp = call i4 @llvm.usub.sat.i4(i4 %x, i4 %a)
OpenPOWER on IntegriCloud