From 7993bf6668743baba05f072ab11f1c3d02f7e9d4 Mon Sep 17 00:00:00 2001 From: hajny Date: Mon, 10 Nov 2014 12:34:59 +0000 Subject: * boolean constant instead of IFDEFs for detection of microcontroller support git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@29052 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/globals.pas | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'compiler/globals.pas') diff --git a/compiler/globals.pas b/compiler/globals.pas index 6c2bc91a9f..cc0df4e2d8 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -163,9 +163,8 @@ interface {$endif defined(ARM)} { CPU targets with microcontroller support can add a controller specific unit } -{$if defined(ARM) or defined(AVR) or defined(MIPSEL)} controllertype : tcontrollertype; -{$endif defined(ARM) or defined(AVR) or defined(MIPSEL)} + { WARNING: this pointer cannot be written as such in record token } pmessage : pmessagestaterecord; end; @@ -411,7 +410,7 @@ interface {$endif i8086} maxfpuregisters : 0; -{ Note: GENERIC_CPU is sued together with generic subdirectory to +{ Note: GENERIC_CPU is used together with generic subdirectory to be able to compile some of the units without any real CPU. This is used to generate a CPU independant PPUDUMP utility. PM } {$ifdef GENERIC_CPU} @@ -502,9 +501,7 @@ interface {$if defined(ARM)} instructionset : is_arm; {$endif defined(ARM)} -{$if defined(ARM) or defined(AVR) or defined(MIPSEL)} controllertype : ct_none; -{$endif defined(ARM) or defined(AVR) or defined(MIPSEL)} pmessage : nil; ); @@ -536,9 +533,7 @@ interface function Setoptimizecputype(const s:string;var a:tcputype):boolean; function Setcputype(const s:string;var a:tsettings):boolean; function SetFpuType(const s:string;var a:tfputype):boolean; -{$if defined(arm) or defined(avr) or defined(mipsel)} function SetControllerType(const s:string;var a:tcontrollertype):boolean; -{$endif defined(arm) or defined(avr) or defined(mipsel)} function IncludeFeature(const s : string) : boolean; function SetMinFPConstPrec(const s: string; var a: tfloattype) : boolean; @@ -1177,23 +1172,34 @@ implementation end; -{$if defined(arm) or defined(avr) or defined(mipsel)} function SetControllerType(const s:string;var a:tcontrollertype):boolean; var t : tcontrollertype; hs : string; begin - result:=false; - hs:=Upper(s); - for t:=low(tcontrollertype) to high(tcontrollertype) do - if embedded_controllers[t].controllertypestr=hs then - begin - a:=t; - result:=true; - break; - end; +{ The following check allows to reduce amount of code for platforms } +{ not supporting microcontrollers due to evaluation at compile time. } +{$PUSH} + {$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *) + if ControllerSupport then + begin + result:=false; + hs:=Upper(s); + for t:=low(tcontrollertype) to high(tcontrollertype) do + if embedded_controllers[t].controllertypestr=hs then + begin + a:=t; + result:=true; + break; + end; + end + else + begin + a := ct_none; + Result := true; + end; +{$POP} end; -{$endif defined(arm) or defined(avr) or defined(mipsel)} function IncludeFeature(const s : string) : boolean; -- cgit v1.2.1 From e4827c36fd5d9a718899819afbc78837c81198b9 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 16 Nov 2014 20:47:38 +0000 Subject: + change always floating point divisions into multiplications if they are a power of two, this is an exact operation so it is always allowed * change only divisions by normal numbers into multiplications git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@29085 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/globals.pas | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'compiler/globals.pas') diff --git a/compiler/globals.pas b/compiler/globals.pas index cc0df4e2d8..af28bcc9af 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -84,23 +84,23 @@ interface treelogfilename = 'tree.log'; {$if defined(CPUARM) and defined(FPUFPA)} - MathQNaN : tdoublerec = (bytes : (0,0,252,255,0,0,0,0)); - MathInf : tdoublerec = (bytes : (0,0,240,127,0,0,0,0)); - MathNegInf : tdoublerec = (bytes : (0,0,240,255,0,0,0,0)); - MathPi : tdoublerec = (bytes : (251,33,9,64,24,45,68,84)); + MathQNaN : tcompdoublerec = (bytes : (0,0,252,255,0,0,0,0)); + MathInf : tcompdoublerec = (bytes : (0,0,240,127,0,0,0,0)); + MathNegInf : tcompdoublerec = (bytes : (0,0,240,255,0,0,0,0)); + MathPi : tcompdoublerec = (bytes : (251,33,9,64,24,45,68,84)); {$else} {$ifdef FPC_LITTLE_ENDIAN} - MathQNaN : tdoublerec = (bytes : (0,0,0,0,0,0,252,255)); - MathInf : tdoublerec = (bytes : (0,0,0,0,0,0,240,127)); - MathNegInf : tdoublerec = (bytes : (0,0,0,0,0,0,240,255)); - MathPi : tdoublerec = (bytes : (24,45,68,84,251,33,9,64)); - MathPiExtended : textendedrec = (bytes : (53,194,104,33,162,218,15,201,0,64)); + MathQNaN : tcompdoublerec = (bytes : (0,0,0,0,0,0,252,255)); + MathInf : tcompdoublerec = (bytes : (0,0,0,0,0,0,240,127)); + MathNegInf : tcompdoublerec = (bytes : (0,0,0,0,0,0,240,255)); + MathPi : tcompdoublerec = (bytes : (24,45,68,84,251,33,9,64)); + MathPiExtended : tcompextendedrec = (bytes : (53,194,104,33,162,218,15,201,0,64)); {$else FPC_LITTLE_ENDIAN} - MathQNaN : tdoublerec = (bytes : (255,252,0,0,0,0,0,0)); - MathInf : tdoublerec = (bytes : (127,240,0,0,0,0,0,0)); - MathNegInf : tdoublerec = (bytes : (255,240,0,0,0,0,0,0)); - MathPi : tdoublerec = (bytes : (64,9,33,251,84,68,45,24)); - MathPiExtended : textendedrec = (bytes : (64,0,201,15,218,162,33,104,194,53)); + MathQNaN : tcompdoublerec = (bytes : (255,252,0,0,0,0,0,0)); + MathInf : tcompdoublerec = (bytes : (127,240,0,0,0,0,0,0)); + MathNegInf : tcompdoublerec = (bytes : (255,240,0,0,0,0,0,0)); + MathPi : tcompdoublerec = (bytes : (64,9,33,251,84,68,45,24)); + MathPiExtended : tcompextendedrec = (bytes : (64,0,201,15,218,162,33,104,194,53)); {$endif FPC_LITTLE_ENDIAN} {$endif} @@ -963,7 +963,7 @@ implementation result := -1; end; - function convertdoublerec(d : tdoublerec) : tdoublerec;{$ifdef USEINLINE}inline;{$endif} + function convertdoublerec(d : tcompdoublerec) : tcompdoublerec;{$ifdef USEINLINE}inline;{$endif} {$ifdef CPUARM} var i : longint; -- cgit v1.2.1 From 650353e03005822739e58dce9009a481e71a0827 Mon Sep 17 00:00:00 2001 From: hajny Date: Fri, 21 Nov 2014 13:52:10 +0000 Subject: * option -m made conditional (-dPREPROCWRITE) like its processing git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@29098 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/globals.pas | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler/globals.pas') diff --git a/compiler/globals.pas b/compiler/globals.pas index af28bcc9af..1d018a8f7f 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -237,7 +237,9 @@ interface paralinkoptions : TCmdStr; paradynamiclinker : string; paraprintnodetree : byte; +{$ifdef PREPROCWRITE} parapreprocess : boolean; +{$endif PREPROCWRITE} printnodefile : text; { typical cross compiling params} -- cgit v1.2.1 From 9ba1923a1c9c5fc6d3270a6c4a3c93ad3e34b637 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 23 Nov 2014 17:29:00 +0000 Subject: + make $SUBARCH (cputypestr) and $FPCABI available to configuration files git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@29124 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/globals.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/globals.pas') diff --git a/compiler/globals.pas b/compiler/globals.pas index 1d018a8f7f..00f2b5465f 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -41,7 +41,6 @@ interface {$ELSE} fksysutl, {$ENDIF} - { comphook pulls in sysutils anyways } cutils,cclasses,cfileutl, cpuinfo, @@ -835,6 +834,8 @@ implementation Replace(s,'$FPCTARGET',target_os_string) else Replace(s,'$FPCTARGET',target_full_string); + Replace(s,'$SUBARCH',lower(cputypestr[init_settings.cputype])); + Replace(s,'$FPCABI',lower(abiinfo[target_info.abi].name)); {$ifdef mswindows} ReplaceSpecialFolder('$LOCAL_APPDATA',CSIDL_LOCAL_APPDATA); ReplaceSpecialFolder('$APPDATA',CSIDL_APPDATA); -- cgit v1.2.1 From a023c4291ccdd9ce0b8f08d04b6167dddf88eb23 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Fri, 28 Nov 2014 16:39:12 +0000 Subject: Fix for Mantis #26022. globals.pas: * enable type helpers by default for mode Delphi and DelphiUnicode git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@29173 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/globals.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/globals.pas') diff --git a/compiler/globals.pas b/compiler/globals.pas index 00f2b5465f..585a42ee6f 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -51,7 +51,7 @@ interface [m_delphi,m_class,m_objpas,m_result,m_string_pchar, m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring, m_out,m_default_para,m_duplicate_names,m_hintdirective, - m_property,m_default_inline,m_except,m_advanced_records]; + m_property,m_default_inline,m_except,m_advanced_records,m_type_helpers]; delphiunicodemodeswitches = delphimodeswitches + [m_systemcodepage,m_default_unicodestring]; fpcmodeswitches = [m_fpc,m_string_pchar,m_nested_comment,m_repeat_forward, -- cgit v1.2.1 From 1aa7fcfcf6e9b645ecc31aa2e38fa5e5f92f22ba Mon Sep 17 00:00:00 2001 From: nickysn Date: Tue, 23 Dec 2014 18:55:57 +0000 Subject: + support the $fpcmemorymodel macro in fpc.cfg git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@29315 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/globals.pas | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/globals.pas') diff --git a/compiler/globals.pas b/compiler/globals.pas index 585a42ee6f..6176daf0b5 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -836,6 +836,11 @@ implementation Replace(s,'$FPCTARGET',target_full_string); Replace(s,'$SUBARCH',lower(cputypestr[init_settings.cputype])); Replace(s,'$FPCABI',lower(abiinfo[target_info.abi].name)); +{$ifdef i8086} + Replace(s,'$FPCMEMORYMODEL',lower(x86memorymodelstr[init_settings.x86memorymodel])); +{$else i8086} + Replace(s,'$FPCMEMORYMODEL','flat'); +{$endif i8086} {$ifdef mswindows} ReplaceSpecialFolder('$LOCAL_APPDATA',CSIDL_LOCAL_APPDATA); ReplaceSpecialFolder('$APPDATA',CSIDL_APPDATA); -- cgit v1.2.1 From c563503fbf87fe2a7303566bb13ee46679f2f88b Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 23 Dec 2014 20:48:35 +0000 Subject: * $SUBARCH => $FPCSUBARCH git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@29316 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/globals.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/globals.pas') diff --git a/compiler/globals.pas b/compiler/globals.pas index 6176daf0b5..47abece55c 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -834,7 +834,7 @@ implementation Replace(s,'$FPCTARGET',target_os_string) else Replace(s,'$FPCTARGET',target_full_string); - Replace(s,'$SUBARCH',lower(cputypestr[init_settings.cputype])); + Replace(s,'$FPCSUBARCH',lower(cputypestr[init_settings.cputype])); Replace(s,'$FPCABI',lower(abiinfo[target_info.abi].name)); {$ifdef i8086} Replace(s,'$FPCMEMORYMODEL',lower(x86memorymodelstr[init_settings.x86memorymodel])); -- cgit v1.2.1