llvm-6502/test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll
Daniel Sanders 14e97c4f51 [mips] Use MTHC1 when it is available (MIPS32r2 and later) for both FP32 and FP64
Summary:
To make this work for both AFGR64 and FGR64 register sets, I've had to make the
instruction definition consistent with the white lie (that it reads the lower
32-bits of the register) when they are generated by expandBuildPairF64().

Corrected the definition of hasMips32r2() and hasMips64r2() to include
MIPS32r6 and MIPS64r6.

Depends on D3956

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

Differential Revision: http://reviews.llvm.org/D3957

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210771 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-12 11:55:58 +00:00

39 lines
1.3 KiB
LLVM

; RUN: llc -march=mipsel -relocation-model=pic -O0 -mips-fast-isel -fast-isel-abort -mcpu=mips32r2 \
; RUN: < %s | FileCheck %s
@f = common global float 0.000000e+00, align 4
@de = common global double 0.000000e+00, align 8
; Function Attrs: nounwind
define void @f1() #0 {
entry:
store float 0x3FFA76C8C0000000, float* @f, align 4
ret void
; CHECK: .ent f1
; CHECK: lui $[[REG1:[0-9]+]], 16339
; CHECK: ori $[[REG2:[0-9]+]], $[[REG1]], 46662
; CHECK: mtc1 $[[REG2]], $f[[REG3:[0-9]+]]
; CHECK: lw $[[REG4:[0-9]+]], %got(f)(${{[0-9]+}})
; CHECK: swc1 $f[[REG3]], 0($[[REG4]])
; CHECK: .end f1
}
; Function Attrs: nounwind
define void @d1() #0 {
entry:
store double 1.234567e+00, double* @de, align 8
; CHECK: .ent d1
; CHECK: lui $[[REG1a:[0-9]+]], 16371
; CHECK: ori $[[REG2a:[0-9]+]], $[[REG1a]], 49353
; CHECK: lui $[[REG1b:[0-9]+]], 21403
; CHECK: ori $[[REG2b:[0-9]+]], $[[REG1b]], 34951
; CHECK: mtc1 $[[REG2b]], $f[[REG3:[0-9]+]]
; CHECK: mthc1 $[[REG2a]], $f[[REG3]]
; CHECK: sdc1 $f[[REG3]], 0(${{[0-9]+}})
; CHECK: .end d1
ret void
}
attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }