+ LLVM support for the FMA intrinsics

git-svn-id: trunk@40604 -
This commit is contained in:
Jonas Maebe 2018-12-21 20:57:19 +00:00
parent 1cc995b471
commit 4f72edcdd5
2 changed files with 31 additions and 0 deletions

View File

@ -36,6 +36,7 @@ interface
function first_get_frame: tnode; override;
function first_abs_real: tnode; override;
function first_fma: tnode; override;
function first_sqr_real: tnode; override;
function first_sqrt_real: tnode; override;
function first_trunc_real: tnode; override;
@ -52,6 +53,7 @@ implementation
verbose,globals,globtype,constexp,
aasmbase, aasmdata,
symconst,symtype,symdef,defutil,
compinnr,
nutils,nadd,nbas,ncal,ncnv,ncon,nflw,ninl,nld,nmat,
pass_2,
cgbase,cgutils,tgobj,hlcgobj,
@ -146,6 +148,26 @@ implementation
left:=nil;
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;
begin

View File

@ -29,3 +29,12 @@ function llvm_sqrt_f80(val: extended): extended; compilerproc; external name 'll
{$ifdef SUPPORT_FLOAT128}
function llvm_sqrt_f128(val: float128): float128; compilerproc; external name 'llvm.sqrt.f128';
{$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}