llvm.org GIT mirror llvm / a2b4e9a
[mips][microMIPS] Make usage of NOT16 by code generator Differential Revision: http://reviews.llvm.org/D7748 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231963 91177308-0d34-0410-b5e6-96231b3b80d8 Jozef Kolek 5 years ago
3 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
884884 (ADDiu_MM ZERO, immSExt16:$imm)>;
885885 def : MipsPat<(i32 immZExt16:$imm),
886886 (ORi_MM ZERO, immZExt16:$imm)>;
887 def : MipsPat<(not GPR32:$in),
888 (NOR_MM GPR32Opnd:$in, ZERO)>;
887889
888890 def : MipsPat<(add GPRMM16:$src, immSExtAddiur2:$imm),
889891 (ADDIUR2_MM GPRMM16:$src, immSExtAddiur2:$imm)>;
17621762 def : WrapperPat;
17631763 def : WrapperPat;
17641764
1765 let AdditionalPredicates = [NotInMicroMips] in {
17651766 // Mips does not have "not", so we expand our way
17661767 def : MipsPat<(not GPR32:$in),
17671768 (NOR GPR32Opnd:$in, ZERO)>;
1769 }
17681770
17691771 // extended loads
17701772 def : MipsPat<(i32 (extloadi1 addr:$src)), (LBu addr:$src)>;
0 ; RUN: llc -march=mipsel -mcpu=mips32r2 -mattr=+micromips \
1 ; RUN: -relocation-model=pic -O3 < %s | FileCheck %s
2
3 define i32 @main() {
4 entry:
5 %retval = alloca i32, align 4
6 %x = alloca i64, align 8
7 store i32 0, i32* %retval
8 %0 = load i64, i64* %x, align 8
9 %cmp = icmp ne i64 %0, 9223372036854775807
10 br i1 %cmp, label %if.then, label %if.end
11
12 if.then:
13 store i32 1, i32* %retval
14 br label %return
15
16 if.end:
17 store i32 0, i32* %retval
18 br label %return
19
20 return:
21 %1 = load i32, i32* %retval
22 ret i32 %1
23 }
24
25 ; CHECK: not16