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: movl %esi, %eax 23; ALL-NEXT: andb %dil, %al 24; ALL-NEXT: # kill: def $al killed $al killed $eax 25; ALL-NEXT: retq 26 %ret = and i8 %arg1, %arg2 27 ret i8 %ret 28} 29 30define i16 @test_and_i16(i16 %arg1, i16 %arg2) { 31; ALL-LABEL: test_and_i16: 32; ALL: # %bb.0: 33; ALL-NEXT: movl %esi, %eax 34; ALL-NEXT: andw %di, %ax 35; ALL-NEXT: # kill: def $ax killed $ax killed $eax 36; ALL-NEXT: retq 37 %ret = and i16 %arg1, %arg2 38 ret i16 %ret 39} 40 41define i32 @test_and_i32(i32 %arg1, i32 %arg2) { 42; ALL-LABEL: test_and_i32: 43; ALL: # %bb.0: 44; ALL-NEXT: movl %esi, %eax 45; ALL-NEXT: andl %edi, %eax 46; ALL-NEXT: retq 47 %ret = and i32 %arg1, %arg2 48 ret i32 %ret 49} 50 51define i64 @test_and_i64(i64 %arg1, i64 %arg2) { 52; ALL-LABEL: test_and_i64: 53; ALL: # %bb.0: 54; ALL-NEXT: movq %rsi, %rax 55; ALL-NEXT: andq %rdi, %rax 56; ALL-NEXT: retq 57 %ret = and i64 %arg1, %arg2 58 ret i64 %ret 59} 60 61