mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-18 10:31:57 +00:00
760a46522a
The FPv4-SP floating-point unit is generally referred to as single-precision only, but it does have double-precision registers and load, store and GPR<->DPR move instructions which operate on them. This patch enables the use of these registers, the main advantage of which is that we now comply with the AAPCS-VFP calling convention. This partially reverts r209650, which added some AAPCS-VFP support, but did not handle return values or alignment of double arguments in registers. This patch also adds tests for Thumb2 code generation for floating-point instructions and intrinsics, which previously only existed for ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216172 91177308-0d34-0410-b5e6-96231b3b80d8
25 lines
786 B
LLVM
25 lines
786 B
LLVM
; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -march=thumb -mcpu=cortex-m3 | FileCheck %s -check-prefix=CHECK -check-prefix=CORTEXM3
|
|
; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -march=thumb -mcpu=cortex-m4 | FileCheck %s -check-prefix=CHECK -check-prefix=CORTEXM4
|
|
; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -march=thumb -mcpu=cortex-a8 | FileCheck %s -check-prefix=CHECK -check-prefix=CORTEXA8
|
|
|
|
|
|
define float @foo(float %a, float %b) {
|
|
entry:
|
|
; CHECK-LABEL: foo:
|
|
; CORTEXM3: bl ___mulsf3
|
|
; CORTEXM4: vmul.f32 s
|
|
; CORTEXA8: vmul.f32 d
|
|
%0 = fmul float %a, %b
|
|
ret float %0
|
|
}
|
|
|
|
define double @bar(double %a, double %b) {
|
|
entry:
|
|
; CHECK-LABEL: bar:
|
|
%0 = fmul double %a, %b
|
|
; CORTEXM3: bl ___muldf3
|
|
; CORTEXM4: {{bl|b.w}} ___muldf3
|
|
; CORTEXA8: vmul.f64 d
|
|
ret double %0
|
|
}
|