Language related articles
From Free Pascal wiki
Revision as of 15:19, 2 February 2004 by 81.224.251.162 (talk)
Back to Compiler development articles
Things FPC 1.9.x currently doesn't support
- The "implements" style delegation. see ( http://info.borland.com/techpubs/delphi/delphi5/oplg/objintrf.html )
- dispinterface
- packages
Things FPC 1.9.x partially support
- variants rumouredly have some problems.
- currency support needs testing (there was some work done recently afaik)
- Dynarrays, inclding Slice function seems to have problems.
New in 1.9.x (not yet in the docs)
- {$fputype xxx) to select a certain fpu style or -Cfxxx on command line/cfg file
- all: soft (not yet implemented)
- i386: x87, sse, sse2
- code compiled with sse uses the sse to do calculations with the single data type. This code runs only on Pentium III and above and AthlonXP and above
- code compiled with sse uses the sse unit to do calculations with the single and double data type. This code runs only on PentiumIV and above and Athlon64 and above
- x86-64: sse64
- powerpc: standard
- arm: libgcc, fpa, fpa10, fpa11, vfp
- procedural property support (property outside a class with normal procedures as getters/setters.
- reuse keywords imports all units the reused unit imports.
- reintroduce omits warning about hidden methods
- Some mac pascal extensions, see [[Target Mac].
SSE Usage
To determine the supported instruction set, use the is_sse_cpu and is_sse2_cpu of the mmx unit. Because the sse code is usually faster than x87-fpu code, it's recommended to use these switches for heavy floating point calculations. If you want an application which runs on all fpu architectures, a possible solution is to put the code into an include file and include this file twice into your program: once compiled with e.g. -Cfsse2 and once without. Use the e.g. is_sse2_cpu variable to select the appropriate code:
{$fputype x87} procedure calc_x87; {$i mymathcode.inc}
{$fputype sse2} procedure calc_sse2; {$i mymathcode.inc}
begin if is_sse2_cpu then calc_sse2 else calc_x87; end;