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=X64
4 define i64 @test_sub_i64(i64 %arg1, i64 %arg2) {
5 ; X64-LABEL: test_sub_i64:
7 ; X64-NEXT: movq %rdi, %rax
8 ; X64-NEXT: subq %rsi, %rax
10 %ret = sub i64 %arg1, %arg2
14 define i32 @test_sub_i32(i32 %arg1, i32 %arg2) {
15 ; X64-LABEL: test_sub_i32:
17 ; X64-NEXT: movl %edi, %eax
18 ; X64-NEXT: subl %esi, %eax
20 %ret = sub i32 %arg1, %arg2
24 define i16 @test_sub_i16(i16 %arg1, i16 %arg2) {
25 ; X64-LABEL: test_sub_i16:
27 ; X64-NEXT: movl %edi, %eax
28 ; X64-NEXT: subw %si, %ax
29 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
31 %ret = sub i16 %arg1, %arg2
35 define i8 @test_sub_i8(i8 %arg1, i8 %arg2) {
36 ; X64-LABEL: test_sub_i8:
38 ; X64-NEXT: movl %edi, %eax
39 ; X64-NEXT: subb %sil, %al
40 ; X64-NEXT: # kill: def $al killed $al killed $eax
42 %ret = sub i8 %arg1, %arg2
46 define i32 @test_sub_i1(i32 %arg1, i32 %arg2) {
47 ; X64-LABEL: test_sub_i1:
49 ; X64-NEXT: subb %sil, %dil
50 ; X64-NEXT: movzbl %dil, %eax
51 ; X64-NEXT: andl $1, %eax
53 %a1 = trunc i32 %arg1 to i1
54 %a2 = trunc i32 %arg2 to i1
56 %ret = zext i1 %x to i32