diff options
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r-- | llvm/test/CodeGen/AArch64/sat-add.ll | 10 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/sat-add.ll | 25 |
2 files changed, 13 insertions, 22 deletions
diff --git a/llvm/test/CodeGen/AArch64/sat-add.ll b/llvm/test/CodeGen/AArch64/sat-add.ll index ad13274722f..d9082859988 100644 --- a/llvm/test/CodeGen/AArch64/sat-add.ll +++ b/llvm/test/CodeGen/AArch64/sat-add.ll @@ -123,9 +123,8 @@ define i32 @unsigned_sat_constant_i32_using_cmp_sum(i32 %x) { define i32 @unsigned_sat_constant_i32_using_cmp_notval(i32 %x) { ; CHECK-LABEL: unsigned_sat_constant_i32_using_cmp_notval: ; CHECK: // %bb.0: -; CHECK-NEXT: add w8, w0, #42 // =42 -; CHECK-NEXT: cmn w0, #43 // =43 -; CHECK-NEXT: csinv w0, w8, wzr, ls +; CHECK-NEXT: adds w8, w0, #42 // =42 +; CHECK-NEXT: csinv w0, w8, wzr, lo ; CHECK-NEXT: ret %a = add i32 %x, 42 %c = icmp ugt i32 %x, -43 @@ -162,9 +161,8 @@ define i64 @unsigned_sat_constant_i64_using_cmp_sum(i64 %x) { define i64 @unsigned_sat_constant_i64_using_cmp_notval(i64 %x) { ; CHECK-LABEL: unsigned_sat_constant_i64_using_cmp_notval: ; CHECK: // %bb.0: -; CHECK-NEXT: add x8, x0, #42 // =42 -; CHECK-NEXT: cmn x0, #43 // =43 -; CHECK-NEXT: csinv x0, x8, xzr, ls +; CHECK-NEXT: adds x8, x0, #42 // =42 +; CHECK-NEXT: csinv x0, x8, xzr, lo ; CHECK-NEXT: ret %a = add i64 %x, 42 %c = icmp ugt i64 %x, -43 diff --git a/llvm/test/CodeGen/X86/sat-add.ll b/llvm/test/CodeGen/X86/sat-add.ll index 5b667d86de1..1f2b69f8afe 100644 --- a/llvm/test/CodeGen/X86/sat-add.ll +++ b/llvm/test/CodeGen/X86/sat-add.ll @@ -44,11 +44,10 @@ define i8 @unsigned_sat_constant_i8_using_cmp_sum(i8 %x) { define i8 @unsigned_sat_constant_i8_using_cmp_notval(i8 %x) { ; ANY-LABEL: unsigned_sat_constant_i8_using_cmp_notval: ; ANY: # %bb.0: -; ANY-NEXT: cmpb $-43, %dil +; ANY-NEXT: addb $42, %dil ; ANY-NEXT: movb $-1, %al -; ANY-NEXT: ja .LBB2_2 +; ANY-NEXT: jb .LBB2_2 ; ANY-NEXT: # %bb.1: -; ANY-NEXT: addb $42, %dil ; ANY-NEXT: movl %edi, %eax ; ANY-NEXT: .LBB2_2: ; ANY-NEXT: retq @@ -91,12 +90,9 @@ define i16 @unsigned_sat_constant_i16_using_cmp_sum(i16 %x) { define i16 @unsigned_sat_constant_i16_using_cmp_notval(i16 %x) { ; ANY-LABEL: unsigned_sat_constant_i16_using_cmp_notval: ; ANY: # %bb.0: -; ANY-NEXT: # kill: def $edi killed $edi def $rdi -; ANY-NEXT: leal 42(%rdi), %ecx -; ANY-NEXT: movzwl %di, %eax -; ANY-NEXT: cmpl $65493, %eax # imm = 0xFFD5 +; ANY-NEXT: addw $42, %di ; ANY-NEXT: movl $65535, %eax # imm = 0xFFFF -; ANY-NEXT: cmovbel %ecx, %eax +; ANY-NEXT: cmovael %edi, %eax ; ANY-NEXT: # kill: def $ax killed $ax killed $eax ; ANY-NEXT: retq %a = add i16 %x, 42 @@ -135,11 +131,9 @@ define i32 @unsigned_sat_constant_i32_using_cmp_sum(i32 %x) { define i32 @unsigned_sat_constant_i32_using_cmp_notval(i32 %x) { ; ANY-LABEL: unsigned_sat_constant_i32_using_cmp_notval: ; ANY: # %bb.0: -; ANY-NEXT: # kill: def $edi killed $edi def $rdi -; ANY-NEXT: leal 42(%rdi), %ecx -; ANY-NEXT: cmpl $-43, %edi +; ANY-NEXT: addl $42, %edi ; ANY-NEXT: movl $-1, %eax -; ANY-NEXT: cmovbel %ecx, %eax +; ANY-NEXT: cmovael %edi, %eax ; ANY-NEXT: retq %a = add i32 %x, 42 %c = icmp ugt i32 %x, -43 @@ -177,10 +171,9 @@ define i64 @unsigned_sat_constant_i64_using_cmp_sum(i64 %x) { define i64 @unsigned_sat_constant_i64_using_cmp_notval(i64 %x) { ; ANY-LABEL: unsigned_sat_constant_i64_using_cmp_notval: ; ANY: # %bb.0: -; ANY-NEXT: cmpq $-43, %rdi -; ANY-NEXT: leaq 42(%rdi), %rax -; ANY-NEXT: movq $-1, %rcx -; ANY-NEXT: cmovaq %rcx, %rax +; ANY-NEXT: addq $42, %rdi +; ANY-NEXT: movq $-1, %rax +; ANY-NEXT: cmovaeq %rdi, %rax ; ANY-NEXT: retq %a = add i64 %x, 42 %c = icmp ugt i64 %x, -43 |