The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Are these really Windows compiler unsupported Delphi Intrinsic Routines?

Posted by jpluimers on 2019/03/19

Odd, the [WayBack/Archive.is] Delphi Intrinsic Routines – RAD Studio indicates quite a few compiler intrinsics are not available on Windows.

I wonder if this list is correct:

Routine Description DCC32 DCC64 DCCOSX DCCAARM DCCIOSARM DCCIOSARM64 DCCIOS32
System.AtomicCmpExchange AtomicCmpExchange is used for comparing and exchanging memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.AtomicDecrement AtomicDecrement is used for decrementing memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.AtomicExchange AtomicExchange is used for exchanging memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.AtomicIncrement AtomicIncrement is used for incrementing memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.BuiltInArcTan Calculates the arctangent of a given number. Allowed.png Allowed.png
System.BuiltInArcTan2 Calculates the arctangent angle and quadrant of a given number. Allowed.png Allowed.png
System.BuiltInCos Calculates the cosine of an angle. Allowed.png Allowed.png
System.BuiltInLn Calculates the natural logarithm of a real expression. Allowed.png Allowed.png
System.BuiltInLnXPlus1 Calculates the natural logarithm of (X+1). Allowed.png Allowed.png
System.BuiltInLog10 Calculates log base 10. Allowed.png Allowed.png
System.BuiltInLog2 Calculates log base 2. Allowed.png Allowed.png
System.BuiltInSin Calculates the sine of the angle. Allowed.png Allowed.png
System.BuiltInSqrt Calculates the square root of X. Allowed.png Allowed.png
System.BuiltInTan Calculates the tangent of X. Allowed.png Allowed.png

Especially since this compiles fine with the DCC32 compiler:

program CompilerIntrinsicsConsoleProject;

{$APPTYPE CONSOLE}

{$R *.res}

var
  I, J, K: Integer;
begin
  System.AtomicCmpExchange(I, J, K);
  System.AtomicDecrement(I);
  System.AtomicExchange(I, J);
  System.AtomicIncrement(J);
end.

–jeroen

3 Responses to “Are these really Windows compiler unsupported Delphi Intrinsic Routines?”

  1. rvelthuis said

    The table at: http://docwiki.embarcadero.com/RADStudio/Rio/en/Delphi_Intrinsic_Routines is quite a bit different, at least right now. Only the BuiltinXXX math functions seem to be missing in most compilers, probably because these use the FPU, which is only used in Win32 and macOS32. The AtomicXXX functions exist everywhere.

    • David Millington said

      Rudy, you’re right. There’s a comment of mine that doesn’t seem to have been approved from when this was posted. I got the docs checked and updated, and yes, the BuiltIn* methods map directly to assembly statements and so are missing when there is no FPU and so no single statement for the builtin.

  2. rvelthuis said

    I also wondered about the table when I saw it a few months ago. They all exist and they work as expected for Win32 and Win64, AFAIK. Can’t test for macOS, currently, but I doubt they are not implemented for the Mac (Mac on Intel and Win32 assembler are quite similar).

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.