; 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 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,nf -verify-machineinstrs --show-mc-encoding | FileCheck --check-prefix=NF %s ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,nf -x86-enable-apx-for-relocation=true -verify-machineinstrs --show-mc-encoding | FileCheck --check-prefix=NF %s define i8 @and8rr(i8 noundef %a, i8 noundef %b) { ; CHECK-LABEL: and8rr: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andl %esi, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x21,0xf7] ; CHECK-NEXT: # kill: def $al killed $al killed $eax ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and8rr: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andl %esi, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x21,0xf7] ; NF-NEXT: # kill: def $al killed $al killed $eax ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i8 %a, %b ret i8 %and } define i16 @and16rr(i16 noundef %a, i16 noundef %b) { ; CHECK-LABEL: and16rr: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andl %esi, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x21,0xf7] ; CHECK-NEXT: # kill: def $ax killed $ax killed $eax ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and16rr: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andl %esi, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x21,0xf7] ; NF-NEXT: # kill: def $ax killed $ax killed $eax ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i16 %a, %b ret i16 %and } define i32 @and32rr(i32 noundef %a, i32 noundef %b) { ; CHECK-LABEL: and32rr: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andl %esi, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x21,0xf7] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and32rr: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andl %esi, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x21,0xf7] ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i32 %a, %b ret i32 %and } define i64 @and64rr(i64 noundef %a, i64 noundef %b) { ; CHECK-LABEL: and64rr: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andq %rsi, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x21,0xf7] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and64rr: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andq %rsi, %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x21,0xf7] ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i64 %a, %b ret i64 %and } define i8 @and8rm(i8 noundef %a, ptr %b) { ; NDD-LABEL: and8rm: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; NDD-NEXT: andb (%rsi), %al # encoding: [0x22,0x06] ; NDD-NEXT: # kill: def $al killed $al killed $eax ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and8rm: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; IMMONLY-NEXT: andb (%rsi), %al # encoding: [0x22,0x06] ; IMMONLY-NEXT: # kill: def $al killed $al killed $eax ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and8rm: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andb (%rsi), %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0x22,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and8rm: ; NF: # %bb.0: # %entry ; NF-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; NF-NEXT: andb (%rsi), %al # encoding: [0x22,0x06] ; NF-NEXT: # kill: def $al killed $al killed $eax ; NF-NEXT: retq # encoding: [0xc3] entry: %t = load i8, ptr %b %and = and i8 %a, %t ret i8 %and } define i16 @and16rm(i16 noundef %a, ptr %b) { ; NDD-LABEL: and16rm: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; NDD-NEXT: andw (%rsi), %ax # encoding: [0x66,0x23,0x06] ; NDD-NEXT: # kill: def $ax killed $ax killed $eax ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and16rm: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; IMMONLY-NEXT: andw (%rsi), %ax # encoding: [0x66,0x23,0x06] ; IMMONLY-NEXT: # kill: def $ax killed $ax killed $eax ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and16rm: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andw (%rsi), %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x23,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and16rm: ; NF: # %bb.0: # %entry ; NF-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; NF-NEXT: andw (%rsi), %ax # encoding: [0x66,0x23,0x06] ; NF-NEXT: # kill: def $ax killed $ax killed $eax ; NF-NEXT: retq # encoding: [0xc3] entry: %t = load i16, ptr %b %and = and i16 %a, %t ret i16 %and } define i32 @and32rm(i32 noundef %a, ptr %b) { ; NDD-LABEL: and32rm: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; NDD-NEXT: andl (%rsi), %eax # encoding: [0x23,0x06] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and32rm: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; IMMONLY-NEXT: andl (%rsi), %eax # encoding: [0x23,0x06] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and32rm: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andl (%rsi), %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x23,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and32rm: ; NF: # %bb.0: # %entry ; NF-NEXT: movl %edi, %eax # encoding: [0x89,0xf8] ; NF-NEXT: andl (%rsi), %eax # encoding: [0x23,0x06] ; NF-NEXT: retq # encoding: [0xc3] entry: %t = load i32, ptr %b %and = and i32 %a, %t ret i32 %and } define i64 @and64rm(i64 noundef %a, ptr %b) { ; NDD-LABEL: and64rm: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movq %rdi, %rax # encoding: [0x48,0x89,0xf8] ; NDD-NEXT: andq (%rsi), %rax # encoding: [0x48,0x23,0x06] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and64rm: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movq %rdi, %rax # encoding: [0x48,0x89,0xf8] ; IMMONLY-NEXT: andq (%rsi), %rax # encoding: [0x48,0x23,0x06] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and64rm: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andq (%rsi), %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x23,0x3e] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and64rm: ; NF: # %bb.0: # %entry ; NF-NEXT: movq %rdi, %rax # encoding: [0x48,0x89,0xf8] ; NF-NEXT: andq (%rsi), %rax # encoding: [0x48,0x23,0x06] ; NF-NEXT: retq # encoding: [0xc3] entry: %t = load i64, ptr %b %and = and i64 %a, %t ret i64 %and } define i16 @and16ri8(i16 noundef %a) { ; CHECK-LABEL: and16ri8: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andw $123, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x83,0xe7,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and16ri8: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andw $123, %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0x83,0xe7,0x7b] ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i16 %a, 123 ret i16 %and } define i32 @and32ri8(i32 noundef %a) { ; CHECK-LABEL: and32ri8: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andl $123, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x83,0xe7,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and32ri8: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andl $123, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x83,0xe7,0x7b] ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i32 %a, 123 ret i32 %and } define i64 @and64ri8(i64 noundef %a) { ; CHECK-LABEL: and64ri8: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andl $123, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x83,0xe7,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and64ri8: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andl $123, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x83,0xe7,0x7b] ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i64 %a, 123 ret i64 %and } define i8 @and8ri(i8 noundef %a) { ; CHECK-LABEL: and8ri: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andb $123, %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0x80,0xe7,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and8ri: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andb $123, %dil, %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x80,0xe7,0x7b] ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i8 %a, 123 ret i8 %and } define i16 @and16ri(i16 noundef %a) { ; CHECK-LABEL: and16ri: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andw $1234, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x81,0xe7,0xd2,0x04] ; CHECK-NEXT: # imm = 0x4D2 ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and16ri: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andw $1234, %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0x81,0xe7,0xd2,0x04] ; NF-NEXT: # imm = 0x4D2 ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i16 %a, 1234 ret i16 %and } define i32 @and32ri(i32 noundef %a) { ; CHECK-LABEL: and32ri: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andl $123456, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x81,0xe7,0x40,0xe2,0x01,0x00] ; CHECK-NEXT: # imm = 0x1E240 ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and32ri: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andl $123456, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x81,0xe7,0x40,0xe2,0x01,0x00] ; NF-NEXT: # imm = 0x1E240 ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i32 %a, 123456 ret i32 %and } define i64 @and64ri(i64 noundef %a) { ; CHECK-LABEL: and64ri: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andl $123456, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x81,0xe7,0x40,0xe2,0x01,0x00] ; CHECK-NEXT: # imm = 0x1E240 ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and64ri: ; NF: # %bb.0: # %entry ; NF-NEXT: {nf} andl $123456, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x81,0xe7,0x40,0xe2,0x01,0x00] ; NF-NEXT: # imm = 0x1E240 ; NF-NEXT: retq # encoding: [0xc3] entry: %and = and i64 %a, 123456 ret i64 %and } define i8 @and8mr(ptr %a, i8 noundef %b) { ; NDD-LABEL: and8mr: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movl %esi, %eax # encoding: [0x89,0xf0] ; NDD-NEXT: andb (%rdi), %al # encoding: [0x22,0x07] ; NDD-NEXT: # kill: def $al killed $al killed $eax ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and8mr: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movl %esi, %eax # encoding: [0x89,0xf0] ; IMMONLY-NEXT: andb (%rdi), %al # encoding: [0x22,0x07] ; IMMONLY-NEXT: # kill: def $al killed $al killed $eax ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and8mr: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andb (%rdi), %sil, %al # encoding: [0x62,0xf4,0x7c,0x18,0x22,0x37] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and8mr: ; NF: # %bb.0: # %entry ; NF-NEXT: movl %esi, %eax # encoding: [0x89,0xf0] ; NF-NEXT: andb (%rdi), %al # encoding: [0x22,0x07] ; NF-NEXT: # kill: def $al killed $al killed $eax ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i8, ptr %a %and = and i8 %t, %b ret i8 %and } define i16 @and16mr(ptr %a, i16 noundef %b) { ; NDD-LABEL: and16mr: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movl %esi, %eax # encoding: [0x89,0xf0] ; NDD-NEXT: andw (%rdi), %ax # encoding: [0x66,0x23,0x07] ; NDD-NEXT: # kill: def $ax killed $ax killed $eax ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and16mr: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movl %esi, %eax # encoding: [0x89,0xf0] ; IMMONLY-NEXT: andw (%rdi), %ax # encoding: [0x66,0x23,0x07] ; IMMONLY-NEXT: # kill: def $ax killed $ax killed $eax ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and16mr: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andw (%rdi), %si, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x23,0x37] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and16mr: ; NF: # %bb.0: # %entry ; NF-NEXT: movl %esi, %eax # encoding: [0x89,0xf0] ; NF-NEXT: andw (%rdi), %ax # encoding: [0x66,0x23,0x07] ; NF-NEXT: # kill: def $ax killed $ax killed $eax ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i16, ptr %a %and = and i16 %t, %b ret i16 %and } define i32 @and32mr(ptr %a, i32 noundef %b) { ; NDD-LABEL: and32mr: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movl %esi, %eax # encoding: [0x89,0xf0] ; NDD-NEXT: andl (%rdi), %eax # encoding: [0x23,0x07] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and32mr: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movl %esi, %eax # encoding: [0x89,0xf0] ; IMMONLY-NEXT: andl (%rdi), %eax # encoding: [0x23,0x07] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and32mr: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andl (%rdi), %esi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x23,0x37] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and32mr: ; NF: # %bb.0: # %entry ; NF-NEXT: movl %esi, %eax # encoding: [0x89,0xf0] ; NF-NEXT: andl (%rdi), %eax # encoding: [0x23,0x07] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i32, ptr %a %and = and i32 %t, %b ret i32 %and } define i64 @and64mr(ptr %a, i64 noundef %b) { ; NDD-LABEL: and64mr: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0] ; NDD-NEXT: andq (%rdi), %rax # encoding: [0x48,0x23,0x07] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and64mr: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0] ; IMMONLY-NEXT: andq (%rdi), %rax # encoding: [0x48,0x23,0x07] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and64mr: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andq (%rdi), %rsi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x23,0x37] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and64mr: ; NF: # %bb.0: # %entry ; NF-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0] ; NF-NEXT: andq (%rdi), %rax # encoding: [0x48,0x23,0x07] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i64, ptr %a %and = and i64 %t, %b ret i64 %and } define i16 @and16mi8(ptr %a) { ; NDD-LABEL: and16mi8: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; NDD-NEXT: andw $123, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x83,0xe0,0x7b] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and16mi8: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; IMMONLY-NEXT: andw $123, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x83,0xe0,0x7b] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and16mi8: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andw $123, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0x83,0x27,0x7b] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and16mi8: ; NF: # %bb.0: # %entry ; NF-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; NF-NEXT: andw $123, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x83,0xe0,0x7b] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i16, ptr %a %and = and i16 %t, 123 ret i16 %and } define i32 @and32mi8(ptr %a) { ; NDD-LABEL: and32mi8: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; NDD-NEXT: andl $123, %eax # EVEX TO LEGACY Compression encoding: [0x83,0xe0,0x7b] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and32mi8: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; IMMONLY-NEXT: andl $123, %eax # EVEX TO LEGACY Compression encoding: [0x83,0xe0,0x7b] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and32mi8: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andl $123, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0x83,0x27,0x7b] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and32mi8: ; NF: # %bb.0: # %entry ; NF-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; NF-NEXT: andl $123, %eax # EVEX TO LEGACY Compression encoding: [0x83,0xe0,0x7b] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i32, ptr %a %and = and i32 %t, 123 ret i32 %and } define i64 @and64mi8(ptr %a) { ; CHECK-LABEL: and64mi8: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07] ; CHECK-NEXT: andl $123, %eax # EVEX TO LEGACY Compression encoding: [0x83,0xe0,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and64mi8: ; NF: # %bb.0: # %entry ; NF-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07] ; NF-NEXT: andl $123, %eax # EVEX TO LEGACY Compression encoding: [0x83,0xe0,0x7b] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i64, ptr %a %and = and i64 %t, 123 ret i64 %and } define i8 @and8mi(ptr %a) { ; NDD-LABEL: and8mi: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07] ; NDD-NEXT: andb $123, %al # EVEX TO LEGACY Compression encoding: [0x24,0x7b] ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and8mi: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07] ; IMMONLY-NEXT: andb $123, %al # EVEX TO LEGACY Compression encoding: [0x24,0x7b] ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and8mi: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andb $123, (%rdi), %al # encoding: [0x62,0xf4,0x7c,0x18,0x80,0x27,0x7b] ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and8mi: ; NF: # %bb.0: # %entry ; NF-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07] ; NF-NEXT: andb $123, %al # EVEX TO LEGACY Compression encoding: [0x24,0x7b] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i8, ptr %a %and = and i8 %t, 123 ret i8 %and } define i16 @and16mi(ptr %a) { ; NDD-LABEL: and16mi: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; NDD-NEXT: andw $1234, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x25,0xd2,0x04] ; NDD-NEXT: # imm = 0x4D2 ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and16mi: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; IMMONLY-NEXT: andw $1234, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x25,0xd2,0x04] ; IMMONLY-NEXT: # imm = 0x4D2 ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and16mi: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andw $1234, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0x81,0x27,0xd2,0x04] ; MEM-NEXT: # imm = 0x4D2 ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and16mi: ; NF: # %bb.0: # %entry ; NF-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07] ; NF-NEXT: andw $1234, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x25,0xd2,0x04] ; NF-NEXT: # imm = 0x4D2 ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i16, ptr %a %and = and i16 %t, 1234 ret i16 %and } define i32 @and32mi(ptr %a) { ; NDD-LABEL: and32mi: ; NDD: # %bb.0: # %entry ; NDD-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; NDD-NEXT: andl $123456, %eax # EVEX TO LEGACY Compression encoding: [0x25,0x40,0xe2,0x01,0x00] ; NDD-NEXT: # imm = 0x1E240 ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: and32mi: ; IMMONLY: # %bb.0: # %entry ; IMMONLY-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; IMMONLY-NEXT: andl $123456, %eax # EVEX TO LEGACY Compression encoding: [0x25,0x40,0xe2,0x01,0x00] ; IMMONLY-NEXT: # imm = 0x1E240 ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: and32mi: ; MEM: # %bb.0: # %entry ; MEM-NEXT: andl $123456, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0x81,0x27,0x40,0xe2,0x01,0x00] ; MEM-NEXT: # imm = 0x1E240 ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and32mi: ; NF: # %bb.0: # %entry ; NF-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07] ; NF-NEXT: andl $123456, %eax # EVEX TO LEGACY Compression encoding: [0x25,0x40,0xe2,0x01,0x00] ; NF-NEXT: # imm = 0x1E240 ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i32, ptr %a %and = and i32 %t, 123456 ret i32 %and } define i64 @and64mi(ptr %a) { ; CHECK-LABEL: and64mi: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07] ; CHECK-NEXT: andl $123456, %eax # EVEX TO LEGACY Compression encoding: [0x25,0x40,0xe2,0x01,0x00] ; CHECK-NEXT: # imm = 0x1E240 ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and64mi: ; NF: # %bb.0: # %entry ; NF-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07] ; NF-NEXT: andl $123456, %eax # EVEX TO LEGACY Compression encoding: [0x25,0x40,0xe2,0x01,0x00] ; NF-NEXT: # imm = 0x1E240 ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i64, ptr %a %and = and i64 %t, 123456 ret i64 %and } @d64 = dso_local global i64 0 define i1 @andflag8rr(i8 %a, i8 %b) { ; CHECK-LABEL: andflag8rr: ; CHECK: # %bb.0: ; CHECK-NEXT: notb %sil, %al # encoding: [0x62,0xf4,0x7c,0x18,0xf6,0xd6] ; CHECK-NEXT: andb %al, %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x20,0xc7] ; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; CHECK-NEXT: movb %cl, d64(%rip) # encoding: [0x88,0x0d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag8rr: ; NF: # %bb.0: ; NF-NEXT: notb %sil, %al # encoding: [0x62,0xf4,0x7c,0x18,0xf6,0xd6] ; NF-NEXT: andb %al, %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x20,0xc7] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movb %cl, d64(%rip) # encoding: [0x88,0x0d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %xor = xor i8 %b, -1 %v0 = and i8 %a, %xor ; 0xff << 50 %v1 = icmp eq i8 %v0, 0 store i8 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag16rr(i16 %a, i16 %b) { ; CHECK-LABEL: andflag16rr: ; CHECK: # %bb.0: ; CHECK-NEXT: notw %si, %ax # encoding: [0x62,0xf4,0x7d,0x18,0xf7,0xd6] ; CHECK-NEXT: andw %ax, %di, %cx # encoding: [0x62,0xf4,0x75,0x18,0x21,0xc7] ; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; CHECK-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag16rr: ; NF: # %bb.0: ; NF-NEXT: notw %si, %ax # encoding: [0x62,0xf4,0x7d,0x18,0xf7,0xd6] ; NF-NEXT: andw %ax, %di, %cx # encoding: [0x62,0xf4,0x75,0x18,0x21,0xc7] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %xor = xor i16 %b, -1 %v0 = and i16 %a, %xor ; 0xff << 50 %v1 = icmp eq i16 %v0, 0 store i16 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag32rr(i32 %a, i32 %b) { ; CHECK-LABEL: andflag32rr: ; CHECK: # %bb.0: ; CHECK-NEXT: andl %edi, %esi # EVEX TO LEGACY Compression encoding: [0x21,0xfe] ; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; CHECK-NEXT: movl %esi, d64(%rip) # encoding: [0x89,0x35,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag32rr: ; NF: # %bb.0: ; NF-NEXT: andl %edi, %esi # EVEX TO LEGACY Compression encoding: [0x21,0xfe] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movl %esi, d64(%rip) # encoding: [0x89,0x35,A,A,A,A] ; NF-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %v0 = and i32 %a, %b ; 0xff << 50 %v1 = icmp eq i32 %v0, 0 store i32 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag64rr(i64 %a, i64 %b) { ; CHECK-LABEL: andflag64rr: ; CHECK: # %bb.0: ; CHECK-NEXT: andq %rdi, %rsi # EVEX TO LEGACY Compression encoding: [0x48,0x21,0xfe] ; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; CHECK-NEXT: movq %rsi, d64(%rip) # encoding: [0x48,0x89,0x35,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag64rr: ; NF: # %bb.0: ; NF-NEXT: andq %rdi, %rsi # EVEX TO LEGACY Compression encoding: [0x48,0x21,0xfe] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movq %rsi, d64(%rip) # encoding: [0x48,0x89,0x35,A,A,A,A] ; NF-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %v0 = and i64 %a, %b ; 0xff << 50 %v1 = icmp eq i64 %v0, 0 store i64 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag8rm(ptr %ptr, i8 %b) { ; NDD-LABEL: andflag8rm: ; NDD: # %bb.0: ; NDD-NEXT: notb %sil, %cl # encoding: [0x62,0xf4,0x74,0x18,0xf6,0xd6] ; NDD-NEXT: andb (%rdi), %cl # encoding: [0x22,0x0f] ; NDD-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NDD-NEXT: movb %cl, d64(%rip) # encoding: [0x88,0x0d,A,A,A,A] ; NDD-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: andflag8rm: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: notb %sil, %cl # encoding: [0x62,0xf4,0x74,0x18,0xf6,0xd6] ; IMMONLY-NEXT: andb (%rdi), %cl # encoding: [0x22,0x0f] ; IMMONLY-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; IMMONLY-NEXT: movb %cl, d64(%rip) # encoding: [0x88,0x0d,A,A,A,A] ; IMMONLY-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: andflag8rm: ; MEM: # %bb.0: ; MEM-NEXT: notb %sil, %al # encoding: [0x62,0xf4,0x7c,0x18,0xf6,0xd6] ; MEM-NEXT: andb (%rdi), %al, %cl # encoding: [0x62,0xf4,0x74,0x18,0x22,0x07] ; MEM-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; MEM-NEXT: movb %cl, d64(%rip) # encoding: [0x88,0x0d,A,A,A,A] ; MEM-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag8rm: ; NF: # %bb.0: ; NF-NEXT: notb %sil, %cl # encoding: [0x62,0xf4,0x74,0x18,0xf6,0xd6] ; NF-NEXT: andb (%rdi), %cl # encoding: [0x22,0x0f] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movb %cl, d64(%rip) # encoding: [0x88,0x0d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %a = load i8, ptr %ptr %xor = xor i8 %b, -1 %v0 = and i8 %a, %xor ; 0xff << 50 %v1 = icmp eq i8 %v0, 0 store i8 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag16rm(ptr %ptr, i16 %b) { ; NDD-LABEL: andflag16rm: ; NDD: # %bb.0: ; NDD-NEXT: notw %si, %cx # encoding: [0x62,0xf4,0x75,0x18,0xf7,0xd6] ; NDD-NEXT: andw (%rdi), %cx # encoding: [0x66,0x23,0x0f] ; NDD-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NDD-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; NDD-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: andflag16rm: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: notw %si, %cx # encoding: [0x62,0xf4,0x75,0x18,0xf7,0xd6] ; IMMONLY-NEXT: andw (%rdi), %cx # encoding: [0x66,0x23,0x0f] ; IMMONLY-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; IMMONLY-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; IMMONLY-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: andflag16rm: ; MEM: # %bb.0: ; MEM-NEXT: notw %si, %ax # encoding: [0x62,0xf4,0x7d,0x18,0xf7,0xd6] ; MEM-NEXT: andw (%rdi), %ax, %cx # encoding: [0x62,0xf4,0x75,0x18,0x23,0x07] ; MEM-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; MEM-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; MEM-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag16rm: ; NF: # %bb.0: ; NF-NEXT: notw %si, %cx # encoding: [0x62,0xf4,0x75,0x18,0xf7,0xd6] ; NF-NEXT: andw (%rdi), %cx # encoding: [0x66,0x23,0x0f] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %a = load i16, ptr %ptr %xor = xor i16 %b, -1 %v0 = and i16 %a, %xor ; 0xff << 50 %v1 = icmp eq i16 %v0, 0 store i16 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag32rm(ptr %ptr, i32 %b) { ; NDD-LABEL: andflag32rm: ; NDD: # %bb.0: ; NDD-NEXT: andl (%rdi), %esi # encoding: [0x23,0x37] ; NDD-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NDD-NEXT: movl %esi, d64(%rip) # encoding: [0x89,0x35,A,A,A,A] ; NDD-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: andflag32rm: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: andl (%rdi), %esi # encoding: [0x23,0x37] ; IMMONLY-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; IMMONLY-NEXT: movl %esi, d64(%rip) # encoding: [0x89,0x35,A,A,A,A] ; IMMONLY-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: andflag32rm: ; MEM: # %bb.0: ; MEM-NEXT: andl (%rdi), %esi # EVEX TO LEGACY Compression encoding: [0x23,0x37] ; MEM-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; MEM-NEXT: movl %esi, d64(%rip) # encoding: [0x89,0x35,A,A,A,A] ; MEM-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag32rm: ; NF: # %bb.0: ; NF-NEXT: andl (%rdi), %esi # encoding: [0x23,0x37] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movl %esi, d64(%rip) # encoding: [0x89,0x35,A,A,A,A] ; NF-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %a = load i32, ptr %ptr %v0 = and i32 %a, %b ; 0xff << 50 %v1 = icmp eq i32 %v0, 0 store i32 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag64rm(ptr %ptr, i64 %b) { ; NDD-LABEL: andflag64rm: ; NDD: # %bb.0: ; NDD-NEXT: andq (%rdi), %rsi # encoding: [0x48,0x23,0x37] ; NDD-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NDD-NEXT: movq %rsi, d64(%rip) # encoding: [0x48,0x89,0x35,A,A,A,A] ; NDD-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMMONLY-LABEL: andflag64rm: ; IMMONLY: # %bb.0: ; IMMONLY-NEXT: andq (%rdi), %rsi # encoding: [0x48,0x23,0x37] ; IMMONLY-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; IMMONLY-NEXT: movq %rsi, d64(%rip) # encoding: [0x48,0x89,0x35,A,A,A,A] ; IMMONLY-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; IMMONLY-NEXT: retq # encoding: [0xc3] ; ; MEM-LABEL: andflag64rm: ; MEM: # %bb.0: ; MEM-NEXT: andq (%rdi), %rsi # EVEX TO LEGACY Compression encoding: [0x48,0x23,0x37] ; MEM-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; MEM-NEXT: movq %rsi, d64(%rip) # encoding: [0x48,0x89,0x35,A,A,A,A] ; MEM-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; MEM-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag64rm: ; NF: # %bb.0: ; NF-NEXT: andq (%rdi), %rsi # encoding: [0x48,0x23,0x37] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movq %rsi, d64(%rip) # encoding: [0x48,0x89,0x35,A,A,A,A] ; NF-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %a = load i64, ptr %ptr %v0 = and i64 %a, %b ; 0xff << 50 %v1 = icmp eq i64 %v0, 0 store i64 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag8ri(i8 %a) { ; CHECK-LABEL: andflag8ri: ; CHECK: # %bb.0: ; CHECK-NEXT: andb $-124, %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x80,0xe7,0x84] ; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; CHECK-NEXT: movb %cl, d64(%rip) # encoding: [0x88,0x0d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag8ri: ; NF: # %bb.0: ; NF-NEXT: andb $-124, %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x80,0xe7,0x84] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movb %cl, d64(%rip) # encoding: [0x88,0x0d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %xor = xor i8 123, -1 %v0 = and i8 %a, %xor ; 0xff << 50 %v1 = icmp eq i8 %v0, 0 store i8 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag16ri(i16 %a) { ; CHECK-LABEL: andflag16ri: ; CHECK: # %bb.0: ; CHECK-NEXT: andw $-1235, %di, %cx # encoding: [0x62,0xf4,0x75,0x18,0x81,0xe7,0x2d,0xfb] ; CHECK-NEXT: # imm = 0xFB2D ; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; CHECK-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag16ri: ; NF: # %bb.0: ; NF-NEXT: andw $-1235, %di, %cx # encoding: [0x62,0xf4,0x75,0x18,0x81,0xe7,0x2d,0xfb] ; NF-NEXT: # imm = 0xFB2D ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %xor = xor i16 1234, -1 %v0 = and i16 %a, %xor ; 0xff << 50 %v1 = icmp eq i16 %v0, 0 store i16 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag32ri(i32 %a) { ; CHECK-LABEL: andflag32ri: ; CHECK: # %bb.0: ; CHECK-NEXT: andl $123456, %edi # EVEX TO LEGACY Compression encoding: [0x81,0xe7,0x40,0xe2,0x01,0x00] ; CHECK-NEXT: # imm = 0x1E240 ; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; CHECK-NEXT: movl %edi, d64(%rip) # encoding: [0x89,0x3d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag32ri: ; NF: # %bb.0: ; NF-NEXT: andl $123456, %edi # EVEX TO LEGACY Compression encoding: [0x81,0xe7,0x40,0xe2,0x01,0x00] ; NF-NEXT: # imm = 0x1E240 ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movl %edi, d64(%rip) # encoding: [0x89,0x3d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %v0 = and i32 %a, 123456 ; 0xff << 50 %v1 = icmp eq i32 %v0, 0 store i32 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag64ri(i64 %a) { ; NDD-LABEL: andflag64ri: ; NDD: # %bb.0: ; NDD-NEXT: andq $123456, %rdi # encoding: [0x48,0x81,0xe7,0x40,0xe2,0x01,0x00] ; NDD-NEXT: # imm = 0x1E240 ; NDD-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NDD-NEXT: movq %rdi, d64(%rip) # encoding: [0x48,0x89,0x3d,A,A,A,A] ; NDD-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMM-LABEL: andflag64ri: ; IMM: # %bb.0: ; IMM-NEXT: andq $123456, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x81,0xe7,0x40,0xe2,0x01,0x00] ; IMM-NEXT: # imm = 0x1E240 ; IMM-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; IMM-NEXT: movq %rdi, d64(%rip) # encoding: [0x48,0x89,0x3d,A,A,A,A] ; IMM-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; IMM-NEXT: retq # encoding: [0xc3] ; ; MEMONLY-LABEL: andflag64ri: ; MEMONLY: # %bb.0: ; MEMONLY-NEXT: andq $123456, %rdi # encoding: [0x48,0x81,0xe7,0x40,0xe2,0x01,0x00] ; MEMONLY-NEXT: # imm = 0x1E240 ; MEMONLY-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; MEMONLY-NEXT: movq %rdi, d64(%rip) # encoding: [0x48,0x89,0x3d,A,A,A,A] ; MEMONLY-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; MEMONLY-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag64ri: ; NF: # %bb.0: ; NF-NEXT: andq $123456, %rdi # encoding: [0x48,0x81,0xe7,0x40,0xe2,0x01,0x00] ; NF-NEXT: # imm = 0x1E240 ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movq %rdi, d64(%rip) # encoding: [0x48,0x89,0x3d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %v0 = and i64 %a, 123456 ; 0xff << 50 %v1 = icmp eq i64 %v0, 0 store i64 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag16ri8(i16 %a) { ; CHECK-LABEL: andflag16ri8: ; CHECK: # %bb.0: ; CHECK-NEXT: andw $-124, %di, %cx # encoding: [0x62,0xf4,0x75,0x18,0x83,0xe7,0x84] ; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; CHECK-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag16ri8: ; NF: # %bb.0: ; NF-NEXT: andw $-124, %di, %cx # encoding: [0x62,0xf4,0x75,0x18,0x83,0xe7,0x84] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movw %cx, d64(%rip) # encoding: [0x66,0x89,0x0d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %xor = xor i16 123, -1 %v0 = and i16 %a, %xor ; 0xff << 50 %v1 = icmp eq i16 %v0, 0 store i16 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag32ri8(i32 %a) { ; CHECK-LABEL: andflag32ri8: ; CHECK: # %bb.0: ; CHECK-NEXT: andl $123, %edi # EVEX TO LEGACY Compression encoding: [0x83,0xe7,0x7b] ; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; CHECK-NEXT: movl %edi, d64(%rip) # encoding: [0x89,0x3d,A,A,A,A] ; CHECK-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag32ri8: ; NF: # %bb.0: ; NF-NEXT: andl $123, %edi # EVEX TO LEGACY Compression encoding: [0x83,0xe7,0x7b] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movl %edi, d64(%rip) # encoding: [0x89,0x3d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 2, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %v0 = and i32 %a, 123 ; 0xff << 50 %v1 = icmp eq i32 %v0, 0 store i32 %v0, ptr @d64 ret i1 %v1 } define i1 @andflag64ri8(i64 %a) { ; NDD-LABEL: andflag64ri8: ; NDD: # %bb.0: ; NDD-NEXT: andq $123, %rdi # encoding: [0x48,0x83,0xe7,0x7b] ; NDD-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NDD-NEXT: movq %rdi, d64(%rip) # encoding: [0x48,0x89,0x3d,A,A,A,A] ; NDD-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NDD-NEXT: retq # encoding: [0xc3] ; ; IMM-LABEL: andflag64ri8: ; IMM: # %bb.0: ; IMM-NEXT: andq $123, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x83,0xe7,0x7b] ; IMM-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; IMM-NEXT: movq %rdi, d64(%rip) # encoding: [0x48,0x89,0x3d,A,A,A,A] ; IMM-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; IMM-NEXT: retq # encoding: [0xc3] ; ; MEMONLY-LABEL: andflag64ri8: ; MEMONLY: # %bb.0: ; MEMONLY-NEXT: andq $123, %rdi # encoding: [0x48,0x83,0xe7,0x7b] ; MEMONLY-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; MEMONLY-NEXT: movq %rdi, d64(%rip) # encoding: [0x48,0x89,0x3d,A,A,A,A] ; MEMONLY-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; MEMONLY-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: andflag64ri8: ; NF: # %bb.0: ; NF-NEXT: andq $123, %rdi # encoding: [0x48,0x83,0xe7,0x7b] ; NF-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] ; NF-NEXT: movq %rdi, d64(%rip) # encoding: [0x48,0x89,0x3d,A,A,A,A] ; NF-NEXT: # fixup A - offset: 3, value: d64, kind: reloc_riprel_4byte ; NF-NEXT: retq # encoding: [0xc3] %v0 = and i64 %a, 123 ; 0xff << 50 %v1 = icmp eq i64 %v0, 0 store i64 %v0, ptr @d64 ret i1 %v1 } define void @and8mr_legacy(ptr %a, i8 noundef %b) { ; CHECK-LABEL: and8mr_legacy: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andb %sil, (%rdi) # encoding: [0x40,0x20,0x37] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and8mr_legacy: ; NF: # %bb.0: # %entry ; NF-NEXT: andb %sil, (%rdi) # encoding: [0x40,0x20,0x37] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i8, ptr %a %and = and i8 %t, %b store i8 %and, ptr %a ret void } define void @and16mr_legacy(ptr %a, i16 noundef %b) { ; CHECK-LABEL: and16mr_legacy: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andw %si, (%rdi) # encoding: [0x66,0x21,0x37] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and16mr_legacy: ; NF: # %bb.0: # %entry ; NF-NEXT: andw %si, (%rdi) # encoding: [0x66,0x21,0x37] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i16, ptr %a %and = and i16 %t, %b store i16 %and, ptr %a ret void } define void @and32mr_legacy(ptr %a, i32 noundef %b) { ; CHECK-LABEL: and32mr_legacy: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andl %esi, (%rdi) # encoding: [0x21,0x37] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and32mr_legacy: ; NF: # %bb.0: # %entry ; NF-NEXT: andl %esi, (%rdi) # encoding: [0x21,0x37] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i32, ptr %a %and = and i32 %t, %b store i32 %and, ptr %a ret void } define void @and64mr_legacy(ptr %a, i64 noundef %b) { ; CHECK-LABEL: and64mr_legacy: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andq %rsi, (%rdi) # encoding: [0x48,0x21,0x37] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and64mr_legacy: ; NF: # %bb.0: # %entry ; NF-NEXT: andq %rsi, (%rdi) # encoding: [0x48,0x21,0x37] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i64, ptr %a %and = and i64 %t, %b store i64 %and, ptr %a ret void } define void @and8mi_legacy(ptr %a) { ; CHECK-LABEL: and8mi_legacy: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andb $123, (%rdi) # encoding: [0x80,0x27,0x7b] ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and8mi_legacy: ; NF: # %bb.0: # %entry ; NF-NEXT: andb $123, (%rdi) # encoding: [0x80,0x27,0x7b] ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i8, ptr %a %and = and i8 %t, 123 store i8 %and, ptr %a ret void } define void @and16mi_legacy(ptr %a) { ; CHECK-LABEL: and16mi_legacy: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andw $1234, (%rdi) # encoding: [0x66,0x81,0x27,0xd2,0x04] ; CHECK-NEXT: # imm = 0x4D2 ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and16mi_legacy: ; NF: # %bb.0: # %entry ; NF-NEXT: andw $1234, (%rdi) # encoding: [0x66,0x81,0x27,0xd2,0x04] ; NF-NEXT: # imm = 0x4D2 ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i16, ptr %a %and = and i16 %t, 1234 store i16 %and, ptr %a ret void } define void @and32mi_legacy(ptr %a) { ; CHECK-LABEL: and32mi_legacy: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andl $123456, (%rdi) # encoding: [0x81,0x27,0x40,0xe2,0x01,0x00] ; CHECK-NEXT: # imm = 0x1E240 ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and32mi_legacy: ; NF: # %bb.0: # %entry ; NF-NEXT: andl $123456, (%rdi) # encoding: [0x81,0x27,0x40,0xe2,0x01,0x00] ; NF-NEXT: # imm = 0x1E240 ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i32, ptr %a %and = and i32 %t, 123456 store i32 %and, ptr %a ret void } define void @and64mi_legacy(ptr %a) { ; CHECK-LABEL: and64mi_legacy: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: andq $123456, (%rdi) # encoding: [0x48,0x81,0x27,0x40,0xe2,0x01,0x00] ; CHECK-NEXT: # imm = 0x1E240 ; CHECK-NEXT: retq # encoding: [0xc3] ; ; NF-LABEL: and64mi_legacy: ; NF: # %bb.0: # %entry ; NF-NEXT: andq $123456, (%rdi) # encoding: [0x48,0x81,0x27,0x40,0xe2,0x01,0x00] ; NF-NEXT: # imm = 0x1E240 ; NF-NEXT: retq # encoding: [0xc3] entry: %t= load i64, ptr %a %and = and i64 %t, 123456 store i64 %and, ptr %a ret void }