mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 06:59:33 +01:00 
			
		
		
		
	* handle atan, sqrt, ln, sin and cos in the x86 RTL for llvm
o there are llvm intrinsics for all of these except for atan,
      but these obey "the same rules as the equivalent libc functions"
      and I first have to investigate whether these libc functions
      behave the same as our FPC implementations
git-svn-id: trunk@31657 -
			
			
This commit is contained in:
		
							parent
							
								
									616dbead35
								
							
						
					
					
						commit
						6909523b70
					
				@ -122,10 +122,17 @@ const
 | 
			
		||||
    {$ifndef FPC_SYSTEM_HAS_SQRT}
 | 
			
		||||
    {$define FPC_SYSTEM_HAS_SQRT}
 | 
			
		||||
    function fpc_sqrt_real(d : ValReal) : ValReal;compilerproc;
 | 
			
		||||
{$ifndef cpullvm}
 | 
			
		||||
    begin
 | 
			
		||||
      { Function is handled internal in the compiler }
 | 
			
		||||
      runerror(207);
 | 
			
		||||
      result:=0;
 | 
			
		||||
{$else not cpullvm}
 | 
			
		||||
    assembler;nostackframe;
 | 
			
		||||
    asm
 | 
			
		||||
      fldt d
 | 
			
		||||
      fsqrt
 | 
			
		||||
{$endif not cpullvm}
 | 
			
		||||
    end;
 | 
			
		||||
    {$endif FPC_SYSTEM_HAS_SQRT}
 | 
			
		||||
 | 
			
		||||
@ -134,37 +141,67 @@ const
 | 
			
		||||
    {$ifndef FPC_SYSTEM_HAS_ARCTAN}
 | 
			
		||||
    {$define FPC_SYSTEM_HAS_ARCTAN}
 | 
			
		||||
    function fpc_arctan_real(d : ValReal) : ValReal;compilerproc;
 | 
			
		||||
{$ifndef cpullvm}
 | 
			
		||||
    begin
 | 
			
		||||
      { Function is handled internal in the compiler }
 | 
			
		||||
      runerror(207);
 | 
			
		||||
      result:=0;
 | 
			
		||||
{$else not cpullvm}
 | 
			
		||||
    assembler;nostackframe;
 | 
			
		||||
    asm
 | 
			
		||||
      fldt d
 | 
			
		||||
      fld1
 | 
			
		||||
      fpatan
 | 
			
		||||
{$endif not cpullvm}
 | 
			
		||||
    end;
 | 
			
		||||
    {$endif FPC_SYSTEM_HAS_ARCTAN}
 | 
			
		||||
    {$ifndef FPC_SYSTEM_HAS_LN}
 | 
			
		||||
    {$define FPC_SYSTEM_HAS_LN}
 | 
			
		||||
    function fpc_ln_real(d : ValReal) : ValReal;compilerproc;
 | 
			
		||||
{$ifndef cpullvm}
 | 
			
		||||
    begin
 | 
			
		||||
      { Function is handled internal in the compiler }
 | 
			
		||||
      runerror(207);
 | 
			
		||||
      result:=0;
 | 
			
		||||
{$else not cpullvm}
 | 
			
		||||
    assembler;nostackframe;
 | 
			
		||||
    asm
 | 
			
		||||
      fldln2
 | 
			
		||||
      fldt d
 | 
			
		||||
      fyl2x
 | 
			
		||||
{$endif not cpullvm}
 | 
			
		||||
    end;
 | 
			
		||||
    {$endif FPC_SYSTEM_HAS_LN}
 | 
			
		||||
    {$ifndef FPC_SYSTEM_HAS_SIN}
 | 
			
		||||
    {$define FPC_SYSTEM_HAS_SIN}
 | 
			
		||||
    function fpc_sin_real(d : ValReal) : ValReal;compilerproc;
 | 
			
		||||
{$ifndef cpullvm}
 | 
			
		||||
    begin
 | 
			
		||||
      { Function is handled internal in the compiler }
 | 
			
		||||
      runerror(207);
 | 
			
		||||
      result:=0;
 | 
			
		||||
{$else not cpullvm}
 | 
			
		||||
    assembler;nostackframe;
 | 
			
		||||
    asm
 | 
			
		||||
      fldt d
 | 
			
		||||
      fsin
 | 
			
		||||
{$endif not cpullvm}
 | 
			
		||||
    end;
 | 
			
		||||
    {$endif FPC_SYSTEM_HAS_SIN}
 | 
			
		||||
    {$ifndef FPC_SYSTEM_HAS_COS}
 | 
			
		||||
    {$define FPC_SYSTEM_HAS_COS}
 | 
			
		||||
    function fpc_cos_real(d : ValReal) : ValReal;compilerproc;
 | 
			
		||||
{$ifndef cpullvm}
 | 
			
		||||
    begin
 | 
			
		||||
      { Function is handled internal in the compiler }
 | 
			
		||||
      runerror(207);
 | 
			
		||||
      result:=0;
 | 
			
		||||
{$else not cpullvm}
 | 
			
		||||
    assembler;nostackframe;
 | 
			
		||||
    asm
 | 
			
		||||
      fldt d
 | 
			
		||||
      fcos
 | 
			
		||||
{$endif not cpullvm}
 | 
			
		||||
    end;
 | 
			
		||||
    {$endif FPC_SYSTEM_HAS_COS}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user