xref: /aosp_15_r20/external/llvm/test/CodeGen/Mips/Fast-ISel/shift.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mipsel -mcpu=mips32r2 -O0 -fast-isel=true -filetype=obj %s -o - \
2*9880d681SAndroid Build Coastguard Worker; RUN:   | llvm-objdump -d - | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; This test checks that encoding for srl is correct when fast-isel for mips32r2 is used.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker%struct.s = type { [4 x i8], i32 }
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Workerdefine i32 @main() nounwind uwtable {
9*9880d681SAndroid Build Coastguard Workerentry:
10*9880d681SAndroid Build Coastguard Worker  %foo = alloca %struct.s, align 4
11*9880d681SAndroid Build Coastguard Worker  %0 = bitcast %struct.s* %foo to i32*
12*9880d681SAndroid Build Coastguard Worker  %bf.load = load i32, i32* %0, align 4
13*9880d681SAndroid Build Coastguard Worker  %bf.lshr = lshr i32 %bf.load, 2
14*9880d681SAndroid Build Coastguard Worker  %cmp = icmp ne i32 %bf.lshr, 2
15*9880d681SAndroid Build Coastguard Worker  br i1 %cmp, label %if.then, label %if.end
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerif.then:
18*9880d681SAndroid Build Coastguard Worker  unreachable
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerif.end:
21*9880d681SAndroid Build Coastguard Worker  ret i32 0
22*9880d681SAndroid Build Coastguard Worker}
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker; CHECK: srl    ${{[0-9]+}}, ${{[0-9]+}}, {{[0-9]+}}
25