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
3 ; RUN: llc -mtriple=i686-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X86
5 define i8 @test_mul_i8(i8 %arg1, i8 %arg2) nounwind {
6 ; X64-LABEL: test_mul_i8:
8 ; X64-NEXT: movsbl %dil, %eax
12 ; X86-LABEL: test_mul_i8:
14 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
15 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
19 %ret = mul i8 %arg1, %arg2
23 define i16 @test_mul_i16(i16 %arg1, i16 %arg2) nounwind {
24 ; X64-LABEL: test_mul_i16:
26 ; X64-NEXT: movl %esi, %eax
27 ; X64-NEXT: imulw %di, %ax
28 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
31 ; X86-LABEL: test_mul_i16:
33 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
34 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
35 ; X86-NEXT: imulw %cx, %ax
36 ; X86-NEXT: # kill: def $ax killed $ax killed $eax
38 %ret = mul i16 %arg1, %arg2
42 define i32 @test_mul_i32(i32 %arg1, i32 %arg2) nounwind {
43 ; X64-LABEL: test_mul_i32:
45 ; X64-NEXT: movl %esi, %eax
46 ; X64-NEXT: imull %edi, %eax
49 ; X86-LABEL: test_mul_i32:
51 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
52 ; X86-NEXT: imull {{[0-9]+}}(%esp), %eax
54 %ret = mul i32 %arg1, %arg2
58 define i64 @test_mul_i64(i64 %arg1, i64 %arg2) nounwind {
59 ; X64-LABEL: test_mul_i64:
61 ; X64-NEXT: movq %rsi, %rax
62 ; X64-NEXT: imulq %rdi, %rax
65 ; X86-LABEL: test_mul_i64:
67 ; X86-NEXT: pushl %edi
68 ; X86-NEXT: pushl %esi
69 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
70 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
71 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
72 ; X86-NEXT: imull %eax, %esi
73 ; X86-NEXT: movl %eax, %ecx
74 ; X86-NEXT: imull %edx, %ecx
75 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
76 ; X86-NEXT: imull %edx, %edi
77 ; X86-NEXT: addl %edi, %esi
79 ; X86-NEXT: addl %esi, %edx
80 ; X86-NEXT: movl %ecx, %eax
84 %ret = mul i64 %arg1, %arg2
88 ;TODO: instruction selection not supported yet
89 ;define i128 @test_mul_i128(i128 %arg1, i128 %arg2) nounwind {
90 ; %ret = mul i128 %arg1, %arg2