307 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS323 4define i1 @eq_i32(i32 %a, i32 %b){5; MIPS32-LABEL: eq_i32:6; MIPS32: # %bb.0: # %entry7; MIPS32-NEXT: xor $1, $4, $58; MIPS32-NEXT: sltiu $2, $1, 19; MIPS32-NEXT: jr $ra10; MIPS32-NEXT: nop11entry:12 %cmp = icmp eq i32 %a, %b13 ret i1 %cmp14}15 16define i1 @ne_i32(i32 %a, i32 %b) {17; MIPS32-LABEL: ne_i32:18; MIPS32: # %bb.0: # %entry19; MIPS32-NEXT: xor $1, $4, $520; MIPS32-NEXT: sltu $2, $zero, $121; MIPS32-NEXT: jr $ra22; MIPS32-NEXT: nop23entry:24 %cmp = icmp ne i32 %a, %b25 ret i1 %cmp26}27 28define i1 @sgt_i32(i32 %a, i32 %b) {29; MIPS32-LABEL: sgt_i32:30; MIPS32: # %bb.0: # %entry31; MIPS32-NEXT: slt $2, $5, $432; MIPS32-NEXT: jr $ra33; MIPS32-NEXT: nop34entry:35 %cmp = icmp sgt i32 %a, %b36 ret i1 %cmp37}38 39define i1 @sge_i32(i32 %a, i32 %b) {40; MIPS32-LABEL: sge_i32:41; MIPS32: # %bb.0: # %entry42; MIPS32-NEXT: slt $1, $4, $543; MIPS32-NEXT: xori $2, $1, 144; MIPS32-NEXT: jr $ra45; MIPS32-NEXT: nop46entry:47 %cmp = icmp sge i32 %a, %b48 ret i1 %cmp49}50 51define i1 @slt_i32(i32 %a, i32 %b) {52; MIPS32-LABEL: slt_i32:53; MIPS32: # %bb.0: # %entry54; MIPS32-NEXT: slt $2, $4, $555; MIPS32-NEXT: jr $ra56; MIPS32-NEXT: nop57entry:58 %cmp = icmp slt i32 %a, %b59 ret i1 %cmp60}61 62define i1 @sle_i32(i32 %a, i32 %b) {63; MIPS32-LABEL: sle_i32:64; MIPS32: # %bb.0: # %entry65; MIPS32-NEXT: slt $1, $5, $466; MIPS32-NEXT: xori $2, $1, 167; MIPS32-NEXT: jr $ra68; MIPS32-NEXT: nop69entry:70 %cmp = icmp sle i32 %a, %b71 ret i1 %cmp72}73 74define i1 @ugt_i32(i32 %a, i32 %b) {75; MIPS32-LABEL: ugt_i32:76; MIPS32: # %bb.0: # %entry77; MIPS32-NEXT: sltu $2, $5, $478; MIPS32-NEXT: jr $ra79; MIPS32-NEXT: nop80entry:81 %cmp = icmp ugt i32 %a, %b82 ret i1 %cmp83}84 85define i1 @uge_i32(i32 %a, i32 %b) {86; MIPS32-LABEL: uge_i32:87; MIPS32: # %bb.0: # %entry88; MIPS32-NEXT: sltu $1, $4, $589; MIPS32-NEXT: xori $2, $1, 190; MIPS32-NEXT: jr $ra91; MIPS32-NEXT: nop92entry:93 %cmp = icmp uge i32 %a, %b94 ret i1 %cmp95}96 97define i1 @ult_i32(i32 %a, i32 %b) {98; MIPS32-LABEL: ult_i32:99; MIPS32: # %bb.0: # %entry100; MIPS32-NEXT: sltu $2, $4, $5101; MIPS32-NEXT: jr $ra102; MIPS32-NEXT: nop103entry:104 %cmp = icmp ult i32 %a, %b105 ret i1 %cmp106}107 108define i1 @ule_i32(i32 %a, i32 %b) {109; MIPS32-LABEL: ule_i32:110; MIPS32: # %bb.0: # %entry111; MIPS32-NEXT: sltu $1, $5, $4112; MIPS32-NEXT: xori $2, $1, 1113; MIPS32-NEXT: jr $ra114; MIPS32-NEXT: nop115entry:116 %cmp = icmp ule i32 %a, %b117 ret i1 %cmp118}119 120define i1 @eq_ptr(ptr %a, ptr %b){121; MIPS32-LABEL: eq_ptr:122; MIPS32: # %bb.0: # %entry123; MIPS32-NEXT: xor $1, $4, $5124; MIPS32-NEXT: sltiu $2, $1, 1125; MIPS32-NEXT: jr $ra126; MIPS32-NEXT: nop127entry:128 %cmp = icmp eq ptr %a, %b129 ret i1 %cmp130}131 132define i1 @ult_i8(i8 %a, i8 %b) {133; MIPS32-LABEL: ult_i8:134; MIPS32: # %bb.0: # %entry135; MIPS32-NEXT: andi $1, $4, 255136; MIPS32-NEXT: andi $2, $5, 255137; MIPS32-NEXT: sltu $2, $1, $2138; MIPS32-NEXT: jr $ra139; MIPS32-NEXT: nop140entry:141 %cmp = icmp ult i8 %a, %b142 ret i1 %cmp143}144 145define i1 @slt_i16(i16 %a, i16 %b) {146; MIPS32-LABEL: slt_i16:147; MIPS32: # %bb.0: # %entry148; MIPS32-NEXT: sll $1, $4, 16149; MIPS32-NEXT: sra $1, $1, 16150; MIPS32-NEXT: sll $2, $5, 16151; MIPS32-NEXT: sra $2, $2, 16152; MIPS32-NEXT: slt $2, $1, $2153; MIPS32-NEXT: jr $ra154; MIPS32-NEXT: nop155entry:156 %cmp = icmp slt i16 %a, %b157 ret i1 %cmp158}159 160define i1 @eq_i64(i64 %a, i64 %b){161; MIPS32-LABEL: eq_i64:162; MIPS32: # %bb.0: # %entry163; MIPS32-NEXT: xor $1, $4, $6164; MIPS32-NEXT: xor $2, $5, $7165; MIPS32-NEXT: or $1, $1, $2166; MIPS32-NEXT: sltiu $2, $1, 1167; MIPS32-NEXT: jr $ra168; MIPS32-NEXT: nop169entry:170 %cmp = icmp eq i64 %a, %b171 ret i1 %cmp172}173 174define i1 @ne_i64(i64 %a, i64 %b) {175; MIPS32-LABEL: ne_i64:176; MIPS32: # %bb.0: # %entry177; MIPS32-NEXT: xor $1, $4, $6178; MIPS32-NEXT: xor $2, $5, $7179; MIPS32-NEXT: or $1, $1, $2180; MIPS32-NEXT: sltu $2, $zero, $1181; MIPS32-NEXT: jr $ra182; MIPS32-NEXT: nop183entry:184 %cmp = icmp ne i64 %a, %b185 ret i1 %cmp186}187 188define i1 @sgt_i64(i64 %a, i64 %b) {189; MIPS32-LABEL: sgt_i64:190; MIPS32: # %bb.0: # %entry191; MIPS32-NEXT: sltu $1, $6, $4192; MIPS32-NEXT: slt $2, $7, $5193; MIPS32-NEXT: xor $3, $5, $7194; MIPS32-NEXT: movz $2, $1, $3195; MIPS32-NEXT: jr $ra196; MIPS32-NEXT: nop197entry:198 %cmp = icmp sgt i64 %a, %b199 ret i1 %cmp200}201 202define i1 @sge_i64(i64 %a, i64 %b) {203; MIPS32-LABEL: sge_i64:204; MIPS32: # %bb.0: # %entry205; MIPS32-NEXT: sltu $1, $4, $6206; MIPS32-NEXT: xori $1, $1, 1207; MIPS32-NEXT: slt $2, $5, $7208; MIPS32-NEXT: xori $2, $2, 1209; MIPS32-NEXT: xor $3, $5, $7210; MIPS32-NEXT: movz $2, $1, $3211; MIPS32-NEXT: jr $ra212; MIPS32-NEXT: nop213entry:214 %cmp = icmp sge i64 %a, %b215 ret i1 %cmp216}217 218define i1 @slt_i64(i64 %a, i64 %b) {219; MIPS32-LABEL: slt_i64:220; MIPS32: # %bb.0: # %entry221; MIPS32-NEXT: sltu $1, $4, $6222; MIPS32-NEXT: slt $2, $5, $7223; MIPS32-NEXT: xor $3, $5, $7224; MIPS32-NEXT: movz $2, $1, $3225; MIPS32-NEXT: jr $ra226; MIPS32-NEXT: nop227entry:228 %cmp = icmp slt i64 %a, %b229 ret i1 %cmp230}231 232define i1 @sle_i64(i64 %a, i64 %b) {233; MIPS32-LABEL: sle_i64:234; MIPS32: # %bb.0: # %entry235; MIPS32-NEXT: sltu $1, $6, $4236; MIPS32-NEXT: xori $1, $1, 1237; MIPS32-NEXT: slt $2, $7, $5238; MIPS32-NEXT: xori $2, $2, 1239; MIPS32-NEXT: xor $3, $5, $7240; MIPS32-NEXT: movz $2, $1, $3241; MIPS32-NEXT: jr $ra242; MIPS32-NEXT: nop243entry:244 %cmp = icmp sle i64 %a, %b245 ret i1 %cmp246}247 248define i1 @ugt_i64(i64 %a, i64 %b) {249; MIPS32-LABEL: ugt_i64:250; MIPS32: # %bb.0: # %entry251; MIPS32-NEXT: sltu $1, $6, $4252; MIPS32-NEXT: sltu $2, $7, $5253; MIPS32-NEXT: xor $3, $5, $7254; MIPS32-NEXT: movz $2, $1, $3255; MIPS32-NEXT: jr $ra256; MIPS32-NEXT: nop257entry:258 %cmp = icmp ugt i64 %a, %b259 ret i1 %cmp260}261 262define i1 @uge_i64(i64 %a, i64 %b) {263; MIPS32-LABEL: uge_i64:264; MIPS32: # %bb.0: # %entry265; MIPS32-NEXT: sltu $1, $4, $6266; MIPS32-NEXT: xori $1, $1, 1267; MIPS32-NEXT: sltu $2, $5, $7268; MIPS32-NEXT: xori $2, $2, 1269; MIPS32-NEXT: xor $3, $5, $7270; MIPS32-NEXT: movz $2, $1, $3271; MIPS32-NEXT: jr $ra272; MIPS32-NEXT: nop273entry:274 %cmp = icmp uge i64 %a, %b275 ret i1 %cmp276}277 278define i1 @ult_i64(i64 %a, i64 %b) {279; MIPS32-LABEL: ult_i64:280; MIPS32: # %bb.0: # %entry281; MIPS32-NEXT: sltu $1, $4, $6282; MIPS32-NEXT: sltu $2, $5, $7283; MIPS32-NEXT: xor $3, $5, $7284; MIPS32-NEXT: movz $2, $1, $3285; MIPS32-NEXT: jr $ra286; MIPS32-NEXT: nop287entry:288 %cmp = icmp ult i64 %a, %b289 ret i1 %cmp290}291 292define i1 @ule_i64(i64 %a, i64 %b) {293; MIPS32-LABEL: ule_i64:294; MIPS32: # %bb.0: # %entry295; MIPS32-NEXT: sltu $1, $6, $4296; MIPS32-NEXT: xori $1, $1, 1297; MIPS32-NEXT: sltu $2, $7, $5298; MIPS32-NEXT: xori $2, $2, 1299; MIPS32-NEXT: xor $3, $5, $7300; MIPS32-NEXT: movz $2, $1, $3301; MIPS32-NEXT: jr $ra302; MIPS32-NEXT: nop303entry:304 %cmp = icmp ule i64 %a, %b305 ret i1 %cmp306}307