| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 | |
| ; RUN: llc -mtriple=mips-linux-gnu -mcpu=mips32r2 < %s | FileCheck %s --check-prefix=MIPS32R2 | |
| ; RUN: llc -mtriple=mips-linux-gnu -mcpu=mips32r6 < %s | FileCheck %s --check-prefix=MIPS32R6 | |
| ; RUN: llc -mtriple=mips64el-linux-gnuabi64 -mcpu=mips64r6 < %s | FileCheck %s --check-prefix=MIPS64R6 | |
| ; On MIPS R6 FP compares produce 0/-1, so xor with 1 is not a logical not and | |
| ; must not be folded into an inverted compare. | |
| define <2 x i32> @v2f32_ogt_xor1(<2 x float> %a, <2 x float> %b) { | |
| ; MIPS32R2-LABEL: v2f32_ogt_xor1: | |
| ; MIPS32R2: # %bb.0: | |
| ; MIPS32R2-NEXT: mtc1 $6, $f0 | |
| ; MIPS32R2-NEXT: mtc1 $4, $f1 | |
| ; MIPS32R2-NEXT: addiu $1, $zero, 1 | |
| ; MIPS32R2-NEXT: c.ule.s $f1, $f0 | |
| ; MIPS32R2-NEXT: addiu $2, $zero, 1 | |
| ; MIPS32R2-NEXT: movt $2, $zero, $fcc0 | |
| ; MIPS32R2-NEXT: andi $2, $2, 1 | |
| ; MIPS32R2-NEXT: negu $2, $2 | |
| ; MIPS32R2-NEXT: xori $2, $2, 1 | |
| ; MIPS32R2-NEXT: mtc1 $7, $f0 | |
| ; MIPS32R2-NEXT: mtc1 $5, $f1 | |
| ; MIPS32R2-NEXT: c.ule.s $f1, $f0 | |
| ; MIPS32R2-NEXT: movt $1, $zero, $fcc0 | |
| ; MIPS32R2-NEXT: andi $1, $1, 1 | |
| ; MIPS32R2-NEXT: negu $1, $1 | |
| ; MIPS32R2-NEXT: jr $ra | |
| ; MIPS32R2-NEXT: xori $3, $1, 1 | |
| ; | |
| ; MIPS32R6-LABEL: v2f32_ogt_xor1: | |
| ; MIPS32R6: # %bb.0: | |
| ; MIPS32R6-NEXT: mtc1 $4, $f0 | |
| ; MIPS32R6-NEXT: mtc1 $6, $f1 | |
| ; MIPS32R6-NEXT: cmp.lt.s $f0, $f1, $f0 | |
| ; MIPS32R6-NEXT: mfc1 $1, $f0 | |
| ; MIPS32R6-NEXT: xori $2, $1, 1 | |
| ; MIPS32R6-NEXT: mtc1 $5, $f0 | |
| ; MIPS32R6-NEXT: mtc1 $7, $f1 | |
| ; MIPS32R6-NEXT: cmp.lt.s $f0, $f1, $f0 | |
| ; MIPS32R6-NEXT: mfc1 $1, $f0 | |
| ; MIPS32R6-NEXT: jr $ra | |
| ; MIPS32R6-NEXT: xori $3, $1, 1 | |
| ; | |
| ; MIPS64R6-LABEL: v2f32_ogt_xor1: | |
| ; MIPS64R6: # %bb.0: | |
| ; MIPS64R6-NEXT: sll $1, $4, 0 | |
| ; MIPS64R6-NEXT: mtc1 $1, $f0 | |
| ; MIPS64R6-NEXT: sll $1, $5, 0 | |
| ; MIPS64R6-NEXT: mtc1 $1, $f1 | |
| ; MIPS64R6-NEXT: cmp.lt.s $f0, $f1, $f0 | |
| ; MIPS64R6-NEXT: mfc1 $1, $f0 | |
| ; MIPS64R6-NEXT: xori $1, $1, 1 | |
| ; MIPS64R6-NEXT: dsrl $2, $4, 32 | |
| ; MIPS64R6-NEXT: sll $2, $2, 0 | |
| ; MIPS64R6-NEXT: dext $1, $1, 0, 32 | |
| ; MIPS64R6-NEXT: mtc1 $2, $f0 | |
| ; MIPS64R6-NEXT: dsrl $2, $5, 32 | |
| ; MIPS64R6-NEXT: sll $2, $2, 0 | |
| ; MIPS64R6-NEXT: mtc1 $2, $f1 | |
| ; MIPS64R6-NEXT: cmp.lt.s $f0, $f1, $f0 | |
| ; MIPS64R6-NEXT: mfc1 $2, $f0 | |
| ; MIPS64R6-NEXT: xori $2, $2, 1 | |
| ; MIPS64R6-NEXT: dsll $2, $2, 32 | |
| ; MIPS64R6-NEXT: jr $ra | |
| ; MIPS64R6-NEXT: or $2, $1, $2 | |
| %c = fcmp ogt <2 x float> %a, %b | |
| %s = sext <2 x i1> %c to <2 x i32> | |
| %x = xor <2 x i32> %s, <i32 1, i32 1> | |
| ret <2 x i32> %x | |
| } |