mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-29 00:41:46 +01:00
+ LLVM support for the FMA intrinsics
git-svn-id: trunk@40604 -
This commit is contained in:
parent
1cc995b471
commit
4f72edcdd5
@ -36,6 +36,7 @@ interface
|
|||||||
|
|
||||||
function first_get_frame: tnode; override;
|
function first_get_frame: tnode; override;
|
||||||
function first_abs_real: tnode; override;
|
function first_abs_real: tnode; override;
|
||||||
|
function first_fma: tnode; override;
|
||||||
function first_sqr_real: tnode; override;
|
function first_sqr_real: tnode; override;
|
||||||
function first_sqrt_real: tnode; override;
|
function first_sqrt_real: tnode; override;
|
||||||
function first_trunc_real: tnode; override;
|
function first_trunc_real: tnode; override;
|
||||||
@ -52,6 +53,7 @@ implementation
|
|||||||
verbose,globals,globtype,constexp,
|
verbose,globals,globtype,constexp,
|
||||||
aasmbase, aasmdata,
|
aasmbase, aasmdata,
|
||||||
symconst,symtype,symdef,defutil,
|
symconst,symtype,symdef,defutil,
|
||||||
|
compinnr,
|
||||||
nutils,nadd,nbas,ncal,ncnv,ncon,nflw,ninl,nld,nmat,
|
nutils,nadd,nbas,ncal,ncnv,ncon,nflw,ninl,nld,nmat,
|
||||||
pass_2,
|
pass_2,
|
||||||
cgbase,cgutils,tgobj,hlcgobj,
|
cgbase,cgutils,tgobj,hlcgobj,
|
||||||
@ -146,6 +148,26 @@ implementation
|
|||||||
left:=nil;
|
left:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function tllvminlinenode.first_fma: tnode;
|
||||||
|
var
|
||||||
|
procname: string[15];
|
||||||
|
begin
|
||||||
|
case inlinenumber of
|
||||||
|
in_fma_single:
|
||||||
|
procname:='llvm_fma_f32';
|
||||||
|
in_fma_double:
|
||||||
|
procname:='llvm_fma_f64';
|
||||||
|
in_fma_extended:
|
||||||
|
procname:='llvm_fma_f80';
|
||||||
|
in_fma_float128:
|
||||||
|
procname:='llvm_fma_f128';
|
||||||
|
else
|
||||||
|
internalerror(2018122101);
|
||||||
|
end;
|
||||||
|
result:=ccallnode.createintern(procname,left);
|
||||||
|
left:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tllvminlinenode.first_sqr_real: tnode;
|
function tllvminlinenode.first_sqr_real: tnode;
|
||||||
begin
|
begin
|
||||||
|
|||||||
@ -29,3 +29,12 @@ function llvm_sqrt_f80(val: extended): extended; compilerproc; external name 'll
|
|||||||
{$ifdef SUPPORT_FLOAT128}
|
{$ifdef SUPPORT_FLOAT128}
|
||||||
function llvm_sqrt_f128(val: float128): float128; compilerproc; external name 'llvm.sqrt.f128';
|
function llvm_sqrt_f128(val: float128): float128; compilerproc; external name 'llvm.sqrt.f128';
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
function llvm_fma_f32(a, b, c: single): single; compilerproc; external name 'llvm.fma.f32';
|
||||||
|
function llvm_fma_f64(a, b, c: double): double; compilerproc; external name 'llvm.fma.f64';
|
||||||
|
{$ifdef SUPPORT_EXTENDED}
|
||||||
|
function llvm_fma_f80(a, b, c: extended): extended; compilerproc; external name 'llvm.fma.f80';
|
||||||
|
{$endif}
|
||||||
|
{$ifdef SUPPORT_FLOAT128}
|
||||||
|
function llvm_fma_f128(a, b, c: float128): float128; compilerproc; external name 'llvm.fma.f128';
|
||||||
|
{$endif}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user