aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips/llvm-ir/shl.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/Mips/llvm-ir/shl.ll')
-rw-r--r--test/CodeGen/Mips/llvm-ir/shl.ll102
1 files changed, 63 insertions, 39 deletions
diff --git a/test/CodeGen/Mips/llvm-ir/shl.ll b/test/CodeGen/Mips/llvm-ir/shl.ll
index bba34c47ea82..fa43840a8b7b 100644
--- a/test/CodeGen/Mips/llvm-ir/shl.ll
+++ b/test/CodeGen/Mips/llvm-ir/shl.ll
@@ -1,42 +1,33 @@
-; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP32 \
-; RUN: -check-prefix=M2 -check-prefix=NOT-R2-R6
-; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP32 -check-prefix=NOT-R2-R6 \
-; RUN: -check-prefix=32R1-R5
-; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP32 \
-; RUN: -check-prefix=32R1-R5 -check-prefix=R2-R6
-; RUN: llc < %s -march=mips -mcpu=mips32r3 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP32 \
-; RUN: -check-prefix=32R1-R5 -check-prefix=R2-R6
-; RUN: llc < %s -march=mips -mcpu=mips32r5 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP32 \
-; RUN: -check-prefix=32R1-R5 -check-prefix=R2-R6
-; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP32 \
-; RUN: -check-prefix=32R6 -check-prefix=R2-R6
-; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP64 \
-; RUN: -check-prefix=M3 -check-prefix=NOT-R2-R6
-; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP64 \
-; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R2-R6
-; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP64 \
-; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R2-R6
-; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP64 \
-; RUN: -check-prefix=GP64-NOT-R6 -check-prefix R2-R6
-; RUN: llc < %s -march=mips64 -mcpu=mips64r3 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP64 \
-; RUN: -check-prefix=GP64-NOT-R6 -check-prefix R2-R6
-; RUN: llc < %s -march=mips64 -mcpu=mips64r5 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP64 \
-; RUN: -check-prefix=GP64-NOT-R6 -check-prefix R2-R6
-; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-; RUN: -check-prefix=ALL -check-prefix=GP64 \
-; RUN: -check-prefix=64R6 -check-prefix=R2-R6
+; RUN: llc < %s -march=mips -mcpu=mips2 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP32,M2,NOT-R2-R6
+; RUN: llc < %s -march=mips -mcpu=mips32 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP32,NOT-R2-R6,32R1-R5
+; RUN: llc < %s -march=mips -mcpu=mips32r2 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP32,32R1-R5,R2-R6
+; RUN: llc < %s -march=mips -mcpu=mips32r3 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP32,32R1-R5,R2-R6
+; RUN: llc < %s -march=mips -mcpu=mips32r5 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP32,32R1-R5,R2-R6
+; RUN: llc < %s -march=mips -mcpu=mips32r6 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP32,32R6,R2-R6
+; RUN: llc < %s -march=mips64 -mcpu=mips3 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP64,M3,NOT-R2-R6
+; RUN: llc < %s -march=mips64 -mcpu=mips4 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP64,GP64-NOT-R6,NOT-R2-R6
+; RUN: llc < %s -march=mips64 -mcpu=mips64 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP64,GP64-NOT-R6,NOT-R2-R6
+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP64,GP64-NOT-R6,R2-R6
+; RUN: llc < %s -march=mips64 -mcpu=mips64r3 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP64,GP64-NOT-R6,R2-R6
+; RUN: llc < %s -march=mips64 -mcpu=mips64r5 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP64,GP64-NOT-R6,R2-R6
+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,GP64,64R6,R2-R6
+; RUN: llc < %s -march=mips -mcpu=mips32r3 -mattr=+micromips -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,MM,MMR3
+; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips -relocation-model=pic | FileCheck %s \
+; RUN: -check-prefixes=ALL,MM,MMR6
define signext i1 @shl_i1(i1 signext %a, i1 signext %b) {
entry:
@@ -61,6 +52,10 @@ entry:
; R2-R6: sllv $[[T1:[0-9]+]], $4, $[[T0]]
; R2-R6: seb $2, $[[T1]]
+ ; MM: andi16 $[[T0:[0-9]+]], $5, 255
+ ; MM: sllv $[[T1:[0-9]+]], $4, $[[T0]]
+ ; MM: seb $2, $[[T1]]
+
%r = shl i8 %a, %b
ret i8 %r
}
@@ -78,6 +73,10 @@ entry:
; R2-R6: sllv $[[T1:[0-9]+]], $4, $[[T0]]
; R2-R6: seh $2, $[[T1]]
+ ; MM: andi16 $[[T0:[0-9]+]], $5, 65535
+ ; MM: sllv $[[T1:[0-9]+]], $4, $[[T0]]
+ ; MM: seh $2, $[[T1]]
+
%r = shl i16 %a, %b
ret i16 %r
}
@@ -139,6 +138,29 @@ entry:
; GP64: dsllv $2, $4, $5
+ ; MMR3: sllv $[[T0:[0-9]+]], $4, $7
+ ; MMR3: srl16 $[[T1:[0-9]+]], $5, 1
+ ; MMR3: not16 $[[T2:[0-9]+]], $7
+ ; MMR3: srlv $[[T3:[0-9]+]], $[[T1]], $[[T2]]
+ ; MMR3: or16 $[[T4:[0-9]+]], $[[T0]]
+ ; MMR3: sllv $[[T5:[0-9]+]], $5, $7
+ ; MMR3: andi16 $[[T6:[0-9]+]], $7, 32
+ ; MMR3: movn $[[T7:[0-9]+]], $[[T5]], $[[T6]]
+ ; MMR3: lui $[[T8:[0-9]+]], 0
+ ; MMR3: movn $3, $[[T8]], $[[T6]]
+
+ ; MMR6: sllv $[[T0:[0-9]+]], $4, $7
+ ; MMR6: srl16 $[[T1:[0-9]+]], $5, 1
+ ; MMR6: not16 $[[T2:[0-9]+]], $7
+ ; MMR6: srlv $[[T3:[0-9]+]], $[[T1]], $[[T2]]
+ ; MMR6: or16 $[[T4:[0-9]+]], $[[T0]]
+ ; MMR6: andi16 $[[T5:[0-9]+]], $7, 32
+ ; MMR6: seleqz $[[T6:[0-9]+]], $[[T4]], $[[T5]]
+ ; MMR6: sllv $[[T7:[0-9]+]], $5, $7
+ ; MMR6: selnez $[[T8:[0-9]+]], $[[T7]], $[[T5]]
+ ; MMR6: or $2, $[[T8]], $[[T6]]
+ ; MMR6: seleqz $3, $[[T7]], $[[T5]]
+
%r = shl i64 %a, %b
ret i64 %r
}
@@ -194,6 +216,8 @@ entry:
; 64R6: jr $ra
; 64R6: seleqz $3, $[[T9]], $[[T7]]
+ ; MM: lw $25, %call16(__ashlti3)($2)
+
%r = shl i128 %a, %b
ret i128 %r
}