1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL 3 4define i32 @test_and_i1(i32 %arg1, i32 %arg2) { 5; ALL-LABEL: test_and_i1: 6; ALL: # %bb.0: 7; ALL-NEXT: cmpl %esi, %edi 8; ALL-NEXT: sete %al 9; ALL-NEXT: andb %al, %al 10; ALL-NEXT: movzbl %al, %eax 11; ALL-NEXT: andl $1, %eax 12; ALL-NEXT: retq 13 %c = icmp eq i32 %arg1, %arg2 14 %x = and i1 %c , %c 15 %ret = zext i1 %x to i32 16 ret i32 %ret 17} 18 19define i8 @test_and_i8(i8 %arg1, i8 %arg2) { 20; ALL-LABEL: test_and_i8: 21; ALL: # %bb.0: 22; ALL-NEXT: andb %dil, %sil 23; ALL-NEXT: movl %esi, %eax 24; ALL-NEXT: retq 25 %ret = and i8 %arg1, %arg2 26 ret i8 %ret 27} 28 29define i16 @test_and_i16(i16 %arg1, i16 %arg2) { 30; ALL-LABEL: test_and_i16: 31; ALL: # %bb.0: 32; ALL-NEXT: andw %di, %si 33; ALL-NEXT: movl %esi, %eax 34; ALL-NEXT: retq 35 %ret = and i16 %arg1, %arg2 36 ret i16 %ret 37} 38 39define i32 @test_and_i32(i32 %arg1, i32 %arg2) { 40; ALL-LABEL: test_and_i32: 41; ALL: # %bb.0: 42; ALL-NEXT: andl %edi, %esi 43; ALL-NEXT: movl %esi, %eax 44; ALL-NEXT: retq 45 %ret = and i32 %arg1, %arg2 46 ret i32 %ret 47} 48 49define i64 @test_and_i64(i64 %arg1, i64 %arg2) { 50; ALL-LABEL: test_and_i64: 51; ALL: # %bb.0: 52; ALL-NEXT: andq %rdi, %rsi 53; ALL-NEXT: movq %rsi, %rax 54; ALL-NEXT: retq 55 %ret = and i64 %arg1, %arg2 56 ret i64 %ret 57} 58 59