; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd -verify-machineinstrs --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,NDD ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,+prefer-ndd-imm -verify-machineinstrs --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,IMM,IMMONLY ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,+prefer-ndd-mem -verify-machineinstrs --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,MEM,MEMONLY ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,+prefer-ndd-imm,+prefer-ndd-mem -verify-machineinstrs --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,IMM,MEM,BOTH define i8 @sbb8rr(i8 %a, i8 %b, i8 %x, i8 %y) nounwind { ; CHECK-LABEL: sbb8rr: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpb %dl, %cl # encoding: [0x38,0xd1] ; CHECK-NEXT: sbbb %sil, %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0x18,0xf7] ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i8 %a, %b %k = icmp ugt i8 %x, %y %z = zext i1 %k to i8 %r = sub i8 %s, %z ret i8 %r } define i16 @sbb16rr(i16 %a, i16 %b, i16 %x, i16 %y) nounwind { ; CHECK-LABEL: sbb16rr: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpw %dx, %cx # encoding: [0x66,0x39,0xd1] ; CHECK-NEXT: sbbw %si, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x19,0xf7] ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i16 %a, %b %k = icmp ugt i16 %x, %y %z = zext i1 %k to i16 %r = sub i16 %s, %z ret i16 %r } define i32 @sbb32rr(i32 %a, i32 %b, i32 %x, i32 %y) nounwind { ; CHECK-LABEL: sbb32rr: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpl %edx, %ecx # encoding: [0x39,0xd1] ; CHECK-NEXT: sbbl %esi, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x19,0xf7] ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i32 %a, %b %k = icmp ugt i32 %x, %y %z = zext i1 %k to i32 %r = sub i32 %s, %z ret i32 %r } define i64 @sbb64rr(i64 %a, i64 %b, i64 %x, i64 %y) nounwind { ; CHECK-LABEL: sbb64rr: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpq %rdx, %rcx # encoding: [0x48,0x39,0xd1] ; CHECK-NEXT: sbbq %rsi, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x19,0xf7] ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i64 %a, %b %k = icmp ugt i64 %x, %y %z = zext i1 %k to i64 %r = sub i64 %s, %z ret i64 %r } define i8 @sbb8rm(i8 %a, ptr %ptr, i8 %x, i8 %y) nounwind { ; NDD-LABEL: sbb8rm: ; NDD: # %bb.0: ; NDD-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; NDD-NEXT: cmpb %dl, %cl # encoding: [0x38,0xd1] ; NDD-NEXT: sbbb (%rsi), %al # encoding: [0x1a,0x06] ; NDD-NEXT: # kill: def $al killed $al killed $eax ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb8rm: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; IMMONLY-NEXT: cmpb %dl, %cl # encoding: [0x38,0xd1] ; IMMONLY-NEXT: sbbb (%rsi), %al # encoding: [0x1a,0x06] ; IMMONLY-NEXT: # kill: def $al killed $al killed $eax ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb8rm: ; MEM: # %bb.0: ; MEM-NEXT: cmpb %dl, %cl # encoding: [0x38,0xd1] ; MEM-NEXT: sbbb (%rsi), %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0x1a,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] %b = load i8, ptr %ptr %s = sub i8 %a, %b %k = icmp ugt i8 %x, %y %z = zext i1 %k to i8 %r = sub i8 %s, %z ret i8 %r } define i16 @sbb16rm(i16 %a, ptr %ptr, i16 %x, i16 %y) nounwind { ; NDD-LABEL: sbb16rm: ; NDD: # %bb.0: ; NDD-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; NDD-NEXT: cmpw %dx, %cx # encoding: [0x66,0x39,0xd1] ; NDD-NEXT: sbbw (%rsi), %ax # encoding: [0x66,0x1b,0x06] ; NDD-NEXT: # kill: def $ax killed $ax killed $eax ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb16rm: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; IMMONLY-NEXT: cmpw %dx, %cx # encoding: [0x66,0x39,0xd1] ; IMMONLY-NEXT: sbbw (%rsi), %ax # encoding: [0x66,0x1b,0x06] ; IMMONLY-NEXT: # kill: def $ax killed $ax killed $eax ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb16rm: ; MEM: # %bb.0: ; MEM-NEXT: cmpw %dx, %cx # encoding: [0x66,0x39,0xd1] ; MEM-NEXT: sbbw (%rsi), %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x1b,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] %b = load i16, ptr %ptr %s = sub i16 %a, %b %k = icmp ugt i16 %x, %y %z = zext i1 %k to i16 %r = sub i16 %s, %z ret i16 %r } define i32 @sbb32rm(i32 %a, ptr %ptr, i32 %x, i32 %y) nounwind { ; NDD-LABEL: sbb32rm: ; NDD: # %bb.0: ; NDD-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; NDD-NEXT: cmpl %edx, %ecx # encoding: [0x39,0xd1] ; NDD-NEXT: sbbl (%rsi), %eax # encoding: [0x1b,0x06] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb32rm: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; IMMONLY-NEXT: cmpl %edx, %ecx # encoding: [0x39,0xd1] ; IMMONLY-NEXT: sbbl (%rsi), %eax # encoding: [0x1b,0x06] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb32rm: ; MEM: # %bb.0: ; MEM-NEXT: cmpl %edx, %ecx # encoding: [0x39,0xd1] ; MEM-NEXT: sbbl (%rsi), %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x1b,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] %b = load i32, ptr %ptr %s = sub i32 %a, %b %k = icmp ugt i32 %x, %y %z = zext i1 %k to i32 %r = sub i32 %s, %z ret i32 %r } define i64 @sbb64rm(i64 %a, ptr %ptr, i64 %x, i64 %y) nounwind { ; NDD-LABEL: sbb64rm: ; NDD: # %bb.0: ; NDD-NEXT: movq %rdi, %rax # encoding: [0x48,0x89,0xf8] ; NDD-NEXT: cmpq %rdx, %rcx # encoding: [0x48,0x39,0xd1] ; NDD-NEXT: sbbq (%rsi), %rax # encoding: [0x48,0x1b,0x06] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb64rm: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movq %rdi, %rax # encoding: [0x48,0x89,0xf8] ; IMMONLY-NEXT: cmpq %rdx, %rcx # encoding: [0x48,0x39,0xd1] ; IMMONLY-NEXT: sbbq (%rsi), %rax # encoding: [0x48,0x1b,0x06] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb64rm: ; MEM: # %bb.0: ; MEM-NEXT: cmpq %rdx, %rcx # encoding: [0x48,0x39,0xd1] ; MEM-NEXT: sbbq (%rsi), %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x1b,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] %b = load i64, ptr %ptr %s = sub i64 %a, %b %k = icmp ugt i64 %x, %y %z = zext i1 %k to i64 %r = sub i64 %s, %z ret i64 %r } define i16 @sbb16ri8(i16 %a, i16 %x, i16 %y) nounwind { ; CHECK-LABEL: sbb16ri8: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpw %si, %dx # encoding: [0x66,0x39,0xf2] ; CHECK-NEXT: sbbw $123, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x83,0xdf,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i16 %a, 123 %k = icmp ugt i16 %x, %y %z = zext i1 %k to i16 %r = sub i16 %s, %z ret i16 %r } define i32 @sbb32ri8(i32 %a, i32 %x, i32 %y) nounwind { ; CHECK-LABEL: sbb32ri8: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpl %esi, %edx # encoding: [0x39,0xf2] ; CHECK-NEXT: sbbl $123, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x83,0xdf,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i32 %a, 123 %k = icmp ugt i32 %x, %y %z = zext i1 %k to i32 %r = sub i32 %s, %z ret i32 %r } define i64 @sbb64ri8(i64 %a, i64 %x, i64 %y) nounwind { ; CHECK-LABEL: sbb64ri8: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpq %rsi, %rdx # encoding: [0x48,0x39,0xf2] ; CHECK-NEXT: sbbq $123, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x83,0xdf,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i64 %a, 123 %k = icmp ugt i64 %x, %y %z = zext i1 %k to i64 %r = sub i64 %s, %z ret i64 %r } define i8 @sbb8ri(i8 %a, i8 %x, i8 %y) nounwind { ; CHECK-LABEL: sbb8ri: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpb %sil, %dl # encoding: [0x40,0x38,0xf2] ; CHECK-NEXT: sbbb $123, %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0x80,0xdf,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i8 %a, 123 %k = icmp ugt i8 %x, %y %z = zext i1 %k to i8 %r = sub i8 %s, %z ret i8 %r } define i16 @sbb16ri(i16 %a, i16 %x, i16 %y) nounwind { ; CHECK-LABEL: sbb16ri: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpw %si, %dx # encoding: [0x66,0x39,0xf2] ; CHECK-NEXT: sbbw $1234, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x81,0xdf,0xd2,0x04] ; CHECK-NEXT: # imm = 0x4D2 ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i16 %a, 1234 %k = icmp ugt i16 %x, %y %z = zext i1 %k to i16 %r = sub i16 %s, %z ret i16 %r } define i32 @sbb32ri(i32 %a, i32 %x, i32 %y) nounwind { ; CHECK-LABEL: sbb32ri: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpl %esi, %edx # encoding: [0x39,0xf2] ; CHECK-NEXT: sbbl $123456, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x81,0xdf,0x40,0xe2,0x01,0x00] ; CHECK-NEXT: # imm = 0x1E240 ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i32 %a, 123456 %k = icmp ugt i32 %x, %y %z = zext i1 %k to i32 %r = sub i32 %s, %z ret i32 %r } define i64 @sbb64ri(i64 %a, i64 %x, i64 %y) nounwind { ; CHECK-LABEL: sbb64ri: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpq %rsi, %rdx # encoding: [0x48,0x39,0xf2] ; CHECK-NEXT: sbbq $123456, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x81,0xdf,0x40,0xe2,0x01,0x00] ; CHECK-NEXT: # imm = 0x1E240 ; CHECK-NEXT: retq # encoding: [0xc3] %s = sub i64 %a, 123456 %k = icmp ugt i64 %x, %y %z = zext i1 %k to i64 %r = sub i64 %s, %z ret i64 %r } define i8 @sbb8mr(i8 %a, ptr %ptr, i8 %x, i8 %y) nounwind { ; NDD-LABEL: sbb8mr: ; NDD: # %bb.0: ; NDD-NEXT: movzbl (%rsi), %eax # encoding: [0x0f,0xb6,0x06] ; NDD-NEXT: cmpb %dl, %cl # encoding: [0x38,0xd1] ; NDD-NEXT: sbbb %dil, %al # EVEX TO LEGACY Compression encoding: [0x40,0x18,0xf8] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb8mr: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movzbl (%rsi), %eax # encoding: [0x0f,0xb6,0x06] ; IMMONLY-NEXT: cmpb %dl, %cl # encoding: [0x38,0xd1] ; IMMONLY-NEXT: sbbb %dil, %al # EVEX TO LEGACY Compression encoding: [0x40,0x18,0xf8] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb8mr: ; MEM: # %bb.0: ; MEM-NEXT: cmpb %dl, %cl # encoding: [0x38,0xd1] ; MEM-NEXT: sbbb %dil, (%rsi), %al # encoding: [0x62,0xf4,0x7c,0x18,0x18,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] %b = load i8, ptr %ptr %s = sub i8 %b, %a %k = icmp ugt i8 %x, %y %z = zext i1 %k to i8 %r = sub i8 %s, %z ret i8 %r } define i16 @sbb16mr(i16 %a, ptr %ptr, i16 %x, i16 %y) nounwind { ; NDD-LABEL: sbb16mr: ; NDD: # %bb.0: ; NDD-NEXT: movzwl (%rsi), %eax # encoding: [0x0f,0xb7,0x06] ; NDD-NEXT: cmpw %dx, %cx # encoding: [0x66,0x39,0xd1] ; NDD-NEXT: sbbw %di, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x19,0xf8] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb16mr: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movzwl (%rsi), %eax # encoding: [0x0f,0xb7,0x06] ; IMMONLY-NEXT: cmpw %dx, %cx # encoding: [0x66,0x39,0xd1] ; IMMONLY-NEXT: sbbw %di, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x19,0xf8] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb16mr: ; MEM: # %bb.0: ; MEM-NEXT: cmpw %dx, %cx # encoding: [0x66,0x39,0xd1] ; MEM-NEXT: sbbw %di, (%rsi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0x19,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] %b = load i16, ptr %ptr %s = sub i16 %b, %a %k = icmp ugt i16 %x, %y %z = zext i1 %k to i16 %r = sub i16 %s, %z ret i16 %r } define i32 @sbb32mr(i32 %a, ptr %ptr, i32 %x, i32 %y) nounwind { ; NDD-LABEL: sbb32mr: ; NDD: # %bb.0: ; NDD-NEXT: movl (%rsi), %eax # encoding: [0x8b,0x06] ; NDD-NEXT: cmpl %edx, %ecx # encoding: [0x39,0xd1] ; NDD-NEXT: sbbl %edi, %eax # EVEX TO LEGACY Compression encoding: [0x19,0xf8] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb32mr: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movl (%rsi), %eax # encoding: [0x8b,0x06] ; IMMONLY-NEXT: cmpl %edx, %ecx # encoding: [0x39,0xd1] ; IMMONLY-NEXT: sbbl %edi, %eax # EVEX TO LEGACY Compression encoding: [0x19,0xf8] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb32mr: ; MEM: # %bb.0: ; MEM-NEXT: cmpl %edx, %ecx # encoding: [0x39,0xd1] ; MEM-NEXT: sbbl %edi, (%rsi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0x19,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] %b = load i32, ptr %ptr %s = sub i32 %b, %a %k = icmp ugt i32 %x, %y %z = zext i1 %k to i32 %r = sub i32 %s, %z ret i32 %r } define i64 @sbb64mr(i64 %a, ptr %ptr, i64 %x, i64 %y) nounwind { ; NDD-LABEL: sbb64mr: ; NDD: # %bb.0: ; NDD-NEXT: movq (%rsi), %rax # encoding: [0x48,0x8b,0x06] ; NDD-NEXT: cmpq %rdx, %rcx # encoding: [0x48,0x39,0xd1] ; NDD-NEXT: sbbq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x19,0xf8] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb64mr: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movq (%rsi), %rax # encoding: [0x48,0x8b,0x06] ; IMMONLY-NEXT: cmpq %rdx, %rcx # encoding: [0x48,0x39,0xd1] ; IMMONLY-NEXT: sbbq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x19,0xf8] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb64mr: ; MEM: # %bb.0: ; MEM-NEXT: cmpq %rdx, %rcx # encoding: [0x48,0x39,0xd1] ; MEM-NEXT: sbbq %rdi, (%rsi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0x19,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] %b = load i64, ptr %ptr %s = sub i64 %b, %a %k = icmp ugt i64 %x, %y %z = zext i1 %k to i64 %r = sub i64 %s, %z ret i64 %r } define i16 @sbb16mi8(ptr %ptr, i16 %x, i16 %y) nounwind { ; NDD-LABEL: sbb16mi8: ; NDD: # %bb.0: ; NDD-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; NDD-NEXT: cmpw %si, %dx # encoding: [0x66,0x39,0xf2] ; NDD-NEXT: sbbw $123, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x83,0xd8,0x7b] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb16mi8: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; IMMONLY-NEXT: cmpw %si, %dx # encoding: [0x66,0x39,0xf2] ; IMMONLY-NEXT: sbbw $123, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x83,0xd8,0x7b] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb16mi8: ; MEM: # %bb.0: ; MEM-NEXT: cmpw %si, %dx # encoding: [0x66,0x39,0xf2] ; MEM-NEXT: sbbw $123, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0x83,0x1f,0x7b] ; MEM-NEXT: retq # encoding: [0xc3] %a = load i16, ptr %ptr %s = sub i16 %a, 123 %k = icmp ugt i16 %x, %y %z = zext i1 %k to i16 %r = sub i16 %s, %z ret i16 %r } define i32 @sbb32mi8(ptr %ptr, i32 %x, i32 %y) nounwind { ; NDD-LABEL: sbb32mi8: ; NDD: # %bb.0: ; NDD-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; NDD-NEXT: cmpl %esi, %edx # encoding: [0x39,0xf2] ; NDD-NEXT: sbbl $123, %eax # EVEX TO LEGACY Compression encoding: [0x83,0xd8,0x7b] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb32mi8: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; IMMONLY-NEXT: cmpl %esi, %edx # encoding: [0x39,0xf2] ; IMMONLY-NEXT: sbbl $123, %eax # EVEX TO LEGACY Compression encoding: [0x83,0xd8,0x7b] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb32mi8: ; MEM: # %bb.0: ; MEM-NEXT: cmpl %esi, %edx # encoding: [0x39,0xf2] ; MEM-NEXT: sbbl $123, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0x83,0x1f,0x7b] ; MEM-NEXT: retq # encoding: [0xc3] %a = load i32, ptr %ptr %s = sub i32 %a, 123 %k = icmp ugt i32 %x, %y %z = zext i1 %k to i32 %r = sub i32 %s, %z ret i32 %r } define i64 @sbb64mi8(ptr %ptr, i64 %x, i64 %y) nounwind { ; NDD-LABEL: sbb64mi8: ; NDD: # %bb.0: ; NDD-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07] ; NDD-NEXT: cmpq %rsi, %rdx # encoding: [0x48,0x39,0xf2] ; NDD-NEXT: sbbq $123, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x83,0xd8,0x7b] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb64mi8: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07] ; IMMONLY-NEXT: cmpq %rsi, %rdx # encoding: [0x48,0x39,0xf2] ; IMMONLY-NEXT: sbbq $123, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x83,0xd8,0x7b] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb64mi8: ; MEM: # %bb.0: ; MEM-NEXT: cmpq %rsi, %rdx # encoding: [0x48,0x39,0xf2] ; MEM-NEXT: sbbq $123, (%rdi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0x83,0x1f,0x7b] ; MEM-NEXT: retq # encoding: [0xc3] %a = load i64, ptr %ptr %s = sub i64 %a, 123 %k = icmp ugt i64 %x, %y %z = zext i1 %k to i64 %r = sub i64 %s, %z ret i64 %r } define i8 @sbb8mi(ptr %ptr, i8 %x, i8 %y) nounwind { ; NDD-LABEL: sbb8mi: ; NDD: # %bb.0: ; NDD-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07] ; NDD-NEXT: cmpb %sil, %dl # encoding: [0x40,0x38,0xf2] ; NDD-NEXT: sbbb $123, %al # EVEX TO LEGACY Compression encoding: [0x1c,0x7b] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb8mi: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07] ; IMMONLY-NEXT: cmpb %sil, %dl # encoding: [0x40,0x38,0xf2] ; IMMONLY-NEXT: sbbb $123, %al # EVEX TO LEGACY Compression encoding: [0x1c,0x7b] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb8mi: ; MEM: # %bb.0: ; MEM-NEXT: cmpb %sil, %dl # encoding: [0x40,0x38,0xf2] ; MEM-NEXT: sbbb $123, (%rdi), %al # encoding: [0x62,0xf4,0x7c,0x18,0x80,0x1f,0x7b] ; MEM-NEXT: retq # encoding: [0xc3] %a = load i8, ptr %ptr %s = sub i8 %a, 123 %k = icmp ugt i8 %x, %y %z = zext i1 %k to i8 %r = sub i8 %s, %z ret i8 %r } define i16 @sbb16mi(ptr %ptr, i16 %x, i16 %y) nounwind { ; NDD-LABEL: sbb16mi: ; NDD: # %bb.0: ; NDD-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; NDD-NEXT: cmpw %si, %dx # encoding: [0x66,0x39,0xf2] ; NDD-NEXT: sbbw $1234, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x1d,0xd2,0x04] ; NDD-NEXT: # imm = 0x4D2 ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb16mi: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; IMMONLY-NEXT: cmpw %si, %dx # encoding: [0x66,0x39,0xf2] ; IMMONLY-NEXT: sbbw $1234, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x1d,0xd2,0x04] ; IMMONLY-NEXT: # imm = 0x4D2 ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb16mi: ; MEM: # %bb.0: ; MEM-NEXT: cmpw %si, %dx # encoding: [0x66,0x39,0xf2] ; MEM-NEXT: sbbw $1234, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0x81,0x1f,0xd2,0x04] ; MEM-NEXT: # imm = 0x4D2 ; MEM-NEXT: retq # encoding: [0xc3] %a = load i16, ptr %ptr %s = sub i16 %a, 1234 %k = icmp ugt i16 %x, %y %z = zext i1 %k to i16 %r = sub i16 %s, %z ret i16 %r } define i32 @sbb32mi(ptr %ptr, i32 %x, i32 %y) nounwind { ; NDD-LABEL: sbb32mi: ; NDD: # %bb.0: ; NDD-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; NDD-NEXT: cmpl %esi, %edx # encoding: [0x39,0xf2] ; NDD-NEXT: sbbl $123456, %eax # EVEX TO LEGACY Compression encoding: [0x1d,0x40,0xe2,0x01,0x00] ; NDD-NEXT: # imm = 0x1E240 ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb32mi: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; IMMONLY-NEXT: cmpl %esi, %edx # encoding: [0x39,0xf2] ; IMMONLY-NEXT: sbbl $123456, %eax # EVEX TO LEGACY Compression encoding: [0x1d,0x40,0xe2,0x01,0x00] ; IMMONLY-NEXT: # imm = 0x1E240 ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb32mi: ; MEM: # %bb.0: ; MEM-NEXT: cmpl %esi, %edx # encoding: [0x39,0xf2] ; MEM-NEXT: sbbl $123456, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0x81,0x1f,0x40,0xe2,0x01,0x00] ; MEM-NEXT: # imm = 0x1E240 ; MEM-NEXT: retq # encoding: [0xc3] %a = load i32, ptr %ptr %s = sub i32 %a, 123456 %k = icmp ugt i32 %x, %y %z = zext i1 %k to i32 %r = sub i32 %s, %z ret i32 %r } define i64 @sbb64mi(ptr %ptr, i64 %x, i64 %y) nounwind { ; NDD-LABEL: sbb64mi: ; NDD: # %bb.0: ; NDD-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07] ; NDD-NEXT: cmpq %rsi, %rdx # encoding: [0x48,0x39,0xf2] ; NDD-NEXT: sbbq $123456, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x1d,0x40,0xe2,0x01,0x00] ; NDD-NEXT: # imm = 0x1E240 ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: sbb64mi: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07] ; IMMONLY-NEXT: cmpq %rsi, %rdx # encoding: [0x48,0x39,0xf2] ; IMMONLY-NEXT: sbbq $123456, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x1d,0x40,0xe2,0x01,0x00] ; IMMONLY-NEXT: # imm = 0x1E240 ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: sbb64mi: ; MEM: # %bb.0: ; MEM-NEXT: cmpq %rsi, %rdx # encoding: [0x48,0x39,0xf2] ; MEM-NEXT: sbbq $123456, (%rdi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0x81,0x1f,0x40,0xe2,0x01,0x00] ; MEM-NEXT: # imm = 0x1E240 ; MEM-NEXT: retq # encoding: [0xc3] %a = load i64, ptr %ptr %s = sub i64 %a, 123456 %k = icmp ugt i64 %x, %y %z = zext i1 %k to i64 %r = sub i64 %s, %z ret i64 %r } define void @sbb8mr_legacy(i8 %a, ptr %ptr, i8 %x, i8 %y) nounwind { ; CHECK-LABEL: sbb8mr_legacy: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpb %dl, %cl # encoding: [0x38,0xd1] ; CHECK-NEXT: sbbb %dil, (%rsi) # encoding: [0x40,0x18,0x3e] ; CHECK-NEXT: retq # encoding: [0xc3] %b = load i8, ptr %ptr %s = sub i8 %b, %a %k = icmp ugt i8 %x, %y %z = zext i1 %k to i8 %r = sub i8 %s, %z store i8 %r, ptr %ptr ret void } define void @sbb16mr_legacy(i16 %a, ptr %ptr, i16 %x, i16 %y) nounwind { ; CHECK-LABEL: sbb16mr_legacy: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpw %dx, %cx # encoding: [0x66,0x39,0xd1] ; CHECK-NEXT: sbbw %di, (%rsi) # encoding: [0x66,0x19,0x3e] ; CHECK-NEXT: retq # encoding: [0xc3] %b = load i16, ptr %ptr %s = sub i16 %b, %a %k = icmp ugt i16 %x, %y %z = zext i1 %k to i16 %r = sub i16 %s, %z store i16 %r, ptr %ptr ret void } define void @sbb32mr_legacy(i32 %a, ptr %ptr, i32 %x, i32 %y) nounwind { ; CHECK-LABEL: sbb32mr_legacy: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpl %edx, %ecx # encoding: [0x39,0xd1] ; CHECK-NEXT: sbbl %edi, (%rsi) # encoding: [0x19,0x3e] ; CHECK-NEXT: retq # encoding: [0xc3] %b = load i32, ptr %ptr %s = sub i32 %b, %a %k = icmp ugt i32 %x, %y %z = zext i1 %k to i32 %r = sub i32 %s, %z store i32 %r, ptr %ptr ret void } define void @sbb64mr_legacy(i64 %a, ptr %ptr, i64 %x, i64 %y) nounwind { ; CHECK-LABEL: sbb64mr_legacy: ; CHECK: # %bb.0: ; CHECK-NEXT: cmpq %rdx, %rcx # encoding: [0x48,0x39,0xd1] ; CHECK-NEXT: sbbq %rdi, (%rsi) # encoding: [0x48,0x19,0x3e] ; CHECK-NEXT: retq # encoding: [0xc3] %b = load i64, ptr %ptr %s = sub i64 %b, %a %k = icmp ugt i64 %x, %y %z = zext i1 %k to i64 %r = sub i64 %s, %z store i64 %r, ptr %ptr ret void } ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; BOTH: {{.*}} ; IMM: {{.*}} ; MEMONLY: {{.*}}