llvm.org GIT mirror llvm / 6b0ac2a
AArch64: correctly fast-isel i8 & i16 multiplies We were asking for a register for type i8 or i16 which caused an assert. rdar://problem/17620015 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212718 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Northover 6 years ago
2 changed file(s) with 41 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
19061906 case MVT::i32:
19071907 ZReg = AArch64::WZR;
19081908 Opc = AArch64::MADDWrrr;
1909 SrcVT = MVT::i32;
19091910 break;
19101911 case MVT::i64:
19111912 ZReg = AArch64::XZR;
0 ; RUN: llc -fast-isel -fast-isel-abort -mtriple=aarch64 -o - %s | FileCheck %s
1
2 @var8 = global i8 0
3 @var16 = global i16 0
4 @var32 = global i32 0
5 @var64 = global i64 0
6
7 define void @test_mul8(i8 %lhs, i8 %rhs) {
8 ; CHECK-LABEL: test_mul8:
9 ; CHECK: mul w0, w0, w1
10 ; %lhs = load i8* @var8
11 ; %rhs = load i8* @var8
12 %prod = mul i8 %lhs, %rhs
13 store i8 %prod, i8* @var8
14 ret void
15 }
16
17 define void @test_mul16(i16 %lhs, i16 %rhs) {
18 ; CHECK-LABEL: test_mul16:
19 ; CHECK: mul w0, w0, w1
20 %prod = mul i16 %lhs, %rhs
21 store i16 %prod, i16* @var16
22 ret void
23 }
24
25 define void @test_mul32(i32 %lhs, i32 %rhs) {
26 ; CHECK-LABEL: test_mul32:
27 ; CHECK: mul w0, w0, w1
28 %prod = mul i32 %lhs, %rhs
29 store i32 %prod, i32* @var32
30 ret void
31 }
32
33 define void @test_mul64(i64 %lhs, i64 %rhs) {
34 ; CHECK-LABEL: test_mul64:
35 ; CHECK: mul x0, x0, x1
36 %prod = mul i64 %lhs, %rhs
37 store i64 %prod, i64* @var64
38 ret void
39 }