|
From: <man...@us...> - 2012-03-26 22:53:46
|
Revision: 1517
http://graphics32.svn.sourceforge.net/graphics32/?rev=1517&view=rev
Author: mandersson
Date: 2012-03-26 22:53:40 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
Moved OMIT_MMX compiler define from GR32_Compilers.INC to GR32.INC. Added ReadSeconds function to TPerfTimer class in GR32_System.pas.
Modified Paths:
--------------
trunk/Source/GR32.inc
trunk/Source/GR32_Bindings.pas
trunk/Source/GR32_Compiler.inc
trunk/Source/GR32_System.pas
Modified: trunk/Source/GR32.inc
===================================================================
--- trunk/Source/GR32.inc 2012-03-25 20:11:34 UTC (rev 1516)
+++ trunk/Source/GR32.inc 2012-03-26 22:53:40 UTC (rev 1517)
@@ -36,16 +36,20 @@
{$I GR32_Compiler.inc}
-(* Symbol PUREPASCAL :
- -------------------
+(* Symbol PUREPASCAL:
+ ------------------
- Forces GR32 into pure pascal mode. Should be used only for testing and
- debugging purposes. *)
+ Forces GR32 into pure pascal mode. Should be used only for testing and
+ debugging purposes.
+ (Defined by default for FPC and DARWIN targets in GR32_Compilers.INC.)
+
+*)
+
{-$DEFINE PUREPASCAL}
+
-
(* Symbol DEPRECATEDMODE :
-----------------------
@@ -79,9 +83,9 @@
NOTE: Enabling this symbol increases executable size but will probably
result in better performance in most cases. *)
-{$IFDEF INLININGSUPPORTED}
- {$DEFINE USEINLINING}
-{$ENDIF}
+ {$IFDEF INLININGSUPPORTED}
+ {$DEFINE USEINLINING}
+ {$ENDIF}
@@ -136,6 +140,30 @@
RTL patching.
*)
-{$IFDEF GR32_FASTCODEMOVE}
- {$DEFINE USEMOVE}
-{$ENDIF}
+ {-$DEFINE GR32_FASTCODEMOVE}
+ {$IFDEF GR32_FASTCODEMOVE}
+ {$DEFINE USEMOVE}
+ {$ENDIF}
+
+
+
+(*
+ Symbol OMIT_MMX:
+ ----------------
+
+ If defined MMX optimizations are not used (omitted)
+
+ For faster pixel/color processing, MMX can be used which results in a huge
+ performance boost over PUREPASCAL code or native assembler code.
+ However, there's a penalty (a call to EMMS) when switching between FPU and
+ MMX registers. This call is not necessary when SSE2 is available. Though,
+ for backward compatibility it is necessary to call EMMS even if SSE2 is used.
+
+ NOTE: On every x64 system SSE2 is available and thus MMX support is not
+ necessary. In fact it is problematic in case the Delphi XE2 compiler is used.
+*)
+
+ {-$DEFINE OMIT_MMX}
+ {$IFDEF TARGET_x64}
+ {$DEFINE OMIT_MMX}
+ {$ENDIF}
Modified: trunk/Source/GR32_Bindings.pas
===================================================================
--- trunk/Source/GR32_Bindings.pas 2012-03-25 20:11:34 UTC (rev 1516)
+++ trunk/Source/GR32_Bindings.pas 2012-03-26 22:53:40 UTC (rev 1517)
@@ -251,6 +251,7 @@
for I := Registers.Count - 1 downto 0 do
TFunctionRegistry(Registers[I]).Free;
Registers.Free;
+ Registers := nil;
end;
end;
Modified: trunk/Source/GR32_Compiler.inc
===================================================================
--- trunk/Source/GR32_Compiler.inc 2012-03-25 20:11:34 UTC (rev 1516)
+++ trunk/Source/GR32_Compiler.inc 2012-03-26 22:53:40 UTC (rev 1517)
@@ -325,8 +325,7 @@
Forces GR32 into pure pascal mode.
- NOTE: FPC generates very efficient code, there is no need for assembler,
- which just causes trouble
+ NOTE: Further work needed to make assembly routines FPC compatible.
NOTE: The DARWIN target of Free Pascal generates PIC code by default
Which isn't compatible with the current assembler, so force PUREPASCAL
@@ -349,7 +348,20 @@
{$DEFINE PUREPASCAL}
{$ENDIF}
+(*
+ Symbol BITS_GETTER:
+ -------------------
+*)
+
+{$IFDEF COMPILERFPC}
+ // Widgetsets other then Windows will want to implement BITS_GETTER
+ {$IFNDEF LCLWin32}
+ {$DEFINE BITS_GETTER}
+ {$ENDIF}
+{$ENDIF}
+
+
(*
Symbol NATIVE_SINCOS:
---------------------
@@ -390,26 +402,6 @@
(*
- Symbol OMIT_MMX:
- ----------------
-
- If defined MMX optimizations are not used (omitted)
-
- For faster pixel/color processing, MMX can be used which results in a huge
- performance boost over PUREPASCAL code or native assembler code.
- However, there's a penalty (a call to EMMS) when switching between FPU and
- MMX registers. This call is not necessary when SSE2 is available. Though,
- for backward compatibility it is necessary to call EMMS even if SSE2 is used.
-
- NOTE: On every x64 system SSE2 is available and thus MMX support is not
- necessary. In fact it is problematic in case the Delphi XE2 compiler is used.
-*)
-
-{$IFDEF TARGET_x64}
- {$DEFINE OMIT_MMX}
-{$ENDIF}
-
-(*
Miscellaneous Defines:
---------------------- *)
Modified: trunk/Source/GR32_System.pas
===================================================================
--- trunk/Source/GR32_System.pas 2012-03-25 20:11:34 UTC (rev 1516)
+++ trunk/Source/GR32_System.pas 2012-03-26 22:53:40 UTC (rev 1517)
@@ -69,6 +69,7 @@
procedure Start;
function ReadNanoseconds: string;
function ReadMilliseconds: string;
+ function ReadSeconds: String;
function ReadValue: Int64;
end;
@@ -189,6 +190,13 @@
Result := FloatToStrF(1000 * (FPerformanceCountStop - FPerformanceCountStart) / FFrequency, ffFixed, 15, 3);
end;
+function TPerfTimer.ReadSeconds: String;
+begin
+ QueryPerformanceCounter(FPerformanceCountStop);
+ QueryPerformanceFrequency(FFrequency);
+ Result := FloatToStrF((FPerformanceCountStop - FPerformanceCountStart) / FFrequency, ffFixed, 15, 3);
+end;
+
function TPerfTimer.ReadValue: Int64;
begin
QueryPerformanceCounter(FPerformanceCountStop);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|