mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Add soft float support for a bunch more operations. Original
patch by Richard Osborne, tweaked and extended by your humble servant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl cosf" %t1.s | count 1
|
||||
; RUN: grep "bl cos" %t1.s | count 2
|
||||
declare double @llvm.cos.f64(double)
|
||||
|
||||
define double @test(double %F) {
|
||||
%result = call double @llvm.cos.f64(double %F)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.cos.f32(float)
|
||||
|
||||
define float @testf(float %F) {
|
||||
%result = call float @llvm.cos.f32(float %F)
|
||||
ret float %result
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl expf" %t1.s | count 1
|
||||
; RUN: grep "bl exp" %t1.s | count 2
|
||||
declare double @llvm.exp.f64(double)
|
||||
|
||||
define double @test(double %F) {
|
||||
%result = call double @llvm.exp.f64(double %F)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.exp.f32(float)
|
||||
|
||||
define float @testf(float %F) {
|
||||
%result = call float @llvm.exp.f32(float %F)
|
||||
ret float %result
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl exp2f" %t1.s | count 1
|
||||
; RUN: grep "bl exp2" %t1.s | count 2
|
||||
declare double @llvm.exp2.f64(double)
|
||||
|
||||
define double @test(double %F) {
|
||||
%result = call double @llvm.exp2.f64(double %F)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.exp2.f32(float)
|
||||
|
||||
define float @testf(float %F) {
|
||||
%result = call float @llvm.exp2.f32(float %F)
|
||||
ret float %result
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl __subdf3" %t1.s | count 1
|
||||
define i1 @test(double %F) nounwind {
|
||||
entry:
|
||||
%0 = sub double -0.000000e+00, %F
|
||||
%1 = fcmp olt double 0.000000e+00, %0
|
||||
ret i1 %1
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl logf" %t1.s | count 1
|
||||
; RUN: grep "bl log" %t1.s | count 2
|
||||
declare double @llvm.log.f64(double)
|
||||
|
||||
define double @test(double %F) {
|
||||
%result = call double @llvm.log.f64(double %F)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.log.f32(float)
|
||||
|
||||
define float @testf(float %F) {
|
||||
%result = call float @llvm.log.f32(float %F)
|
||||
ret float %result
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl log10f" %t1.s | count 1
|
||||
; RUN: grep "bl log10" %t1.s | count 2
|
||||
declare double @llvm.log10.f64(double)
|
||||
|
||||
define double @test(double %F) {
|
||||
%result = call double @llvm.log10.f64(double %F)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.log10.f32(float)
|
||||
|
||||
define float @testf(float %F) {
|
||||
%result = call float @llvm.log10.f32(float %F)
|
||||
ret float %result
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl log2f" %t1.s | count 1
|
||||
; RUN: grep "bl log2" %t1.s | count 2
|
||||
declare double @llvm.log2.f64(double)
|
||||
|
||||
define double @test(double %F) {
|
||||
%result = call double @llvm.log2.f64(double %F)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.log2.f32(float)
|
||||
|
||||
define float @testf(float %F) {
|
||||
%result = call float @llvm.log2.f32(float %F)
|
||||
ret float %result
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl powf" %t1.s | count 1
|
||||
; RUN: grep "bl pow" %t1.s | count 2
|
||||
declare double @llvm.pow.f64(double, double)
|
||||
|
||||
define double @test(double %F, double %power) {
|
||||
%result = call double @llvm.pow.f64(double %F, double %power)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.pow.f32(float, float)
|
||||
|
||||
define float @testf(float %F, float %power) {
|
||||
%result = call float @llvm.pow.f32(float %F, float %power)
|
||||
ret float %result
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl __powidf2" %t1.s | count 1
|
||||
; RUN: grep "bl __powisf2" %t1.s | count 1
|
||||
declare double @llvm.powi.f64(double, i32)
|
||||
|
||||
define double @test(double %F, i32 %power) {
|
||||
%result = call double @llvm.powi.f64(double %F, i32 %power)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.powi.f32(float, i32)
|
||||
|
||||
define float @testf(float %F, i32 %power) {
|
||||
%result = call float @llvm.powi.f32(float %F, i32 %power)
|
||||
ret float %result
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl sinf" %t1.s | count 1
|
||||
; RUN: grep "bl sin" %t1.s | count 2
|
||||
declare double @llvm.sin.f64(double)
|
||||
|
||||
define double @test(double %F) {
|
||||
%result = call double @llvm.sin.f64(double %F)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.sin.f32(float)
|
||||
|
||||
define float @testf(float %F) {
|
||||
%result = call float @llvm.sin.f32(float %F)
|
||||
ret float %result
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
; RUN: llvm-as < %s | llc -march=xcore > %t1.s
|
||||
; RUN: grep "bl sqrtf" %t1.s | count 1
|
||||
; RUN: grep "bl sqrt" %t1.s | count 2
|
||||
declare double @llvm.sqrt.f64(double)
|
||||
|
||||
define double @test(double %F) {
|
||||
%result = call double @llvm.sqrt.f64(double %F)
|
||||
ret double %result
|
||||
}
|
||||
|
||||
declare float @llvm.sqrt.f32(float)
|
||||
|
||||
define float @testf(float %F) {
|
||||
%result = call float @llvm.sqrt.f32(float %F)
|
||||
ret float %result
|
||||
}
|
||||
Reference in New Issue
Block a user