llvm-6502/test/CodeGen/Mips/buildpairextractelementf64.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

35 lines
874 B
LLVM

; RUN: llc -march=mipsel < %s | FileCheck %s -check-prefix=FP32 -check-prefix=CHECK
; RUN: llc -march=mips < %s | FileCheck %s -check-prefix=FP32 -check-prefix=CHECK
; RUN: llc -march=mipsel -mcpu=mips32r2 -mattr=+fp64 < %s | FileCheck %s -check-prefix=FP64 -check-prefix=CHECK
; RUN: llc -march=mips -mcpu=mips32r2 -mattr=+fp64 < %s | FileCheck %s -check-prefix=FP64 -check-prefix=CHECK
@a = external global i32
; CHECK-LABEL: f:
; FP32: mtc1
; FP32: mtc1
; FP64-DAG: mtc1
; FP64-DAG: mthc1
define double @f(i32 %a1, double %d) nounwind {
entry:
store i32 %a1, i32* @a, align 4
%add = fadd double %d, 2.000000e+00
ret double %add
}
; CHECK-LABEL: f3:
; FP32: mfc1
; FP32: mfc1
; FP64-DAG: mfc1
; FP64-DAG: mfhc1
define void @f3(double %d, i32 %a1) nounwind {
entry:
tail call void @f2(i32 %a1, double %d) nounwind
ret void
}
declare void @f2(i32, double)