fpcdefs.inc 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. {$mode objfpc}
  2. {$asmmode default}
  3. {$H-}
  4. {$goto on}
  5. {$inline on}
  6. {$interfaces corba}
  7. { This reduces the memory requirements a lot }
  8. {$PACKENUM 1}
  9. {$ifndef FPC_BIG_ENDIAN}
  10. { $define USE_PACKSET1}
  11. {$endif}
  12. {$ifdef USE_PACKSET1}
  13. {$PACKSET 1}
  14. {$endif USE_PACKSET1}
  15. { We don't use exceptions, so turn off the implicit
  16. exceptions in the constructors }
  17. {$IMPLICITEXCEPTIONS OFF}
  18. { We don't want the compiler to use fastmath
  19. optimization because it considers negative zeroes
  20. as normal zeroes }
  21. {$OPTIMIZATION NOFASTMATH}
  22. { This define enables codepage-aware compiler messages handling. Turning it on
  23. forces code page conversion from the codepage, specified in the .msg file to
  24. CP_ACP, before printing the message to the console. Enable this for host
  25. platforms, that have code page conversion support in their RTL. }
  26. {$if defined(win32) or defined(win64) or defined(unix)}
  27. {$define cpawaremessages}
  28. {$endif}
  29. { Inline small functions, but not when EXTDEBUG is used }
  30. {$ifndef EXTDEBUG}
  31. {$define USEINLINE}
  32. {$endif EXTDEBUG}
  33. {$ifdef DEBUG_ALL_OPT}
  34. { for aopt unit }
  35. {$define DEBUG_OPTALLOC}
  36. {$define DEBUG_INSTRUCTIONREGISTERDEPENDENCIES}
  37. {for CPU/aoptcpu unit }
  38. {$define DEBUG_AOPTCPU}
  39. {$define DEBUG_PREREGSCHEDULER (arm specific) }
  40. { for aoptobj unit }
  41. {$define DEBUG_AOPTOBJ}
  42. {$define ALLOCREGDEBUG}
  43. { for optconstprop unit }
  44. {$define DEBUG_CONSTPROP}
  45. { for optcse unit }
  46. {$define CSEDEBUG}
  47. { for optdeadstore unit }
  48. {$define DEBUG_DEADSTORE}
  49. { for optdfa unit }
  50. {$define DEBUG_DFA}
  51. { for optloop unit }
  52. {$define DEBUG_OPTFORLOOP}
  53. {$define DEBUG_OPTSTRENGTH}
  54. { for optvirt unit }
  55. {$define DEBUG_DEVIRT}
  56. {$endif}
  57. {$define USEEXCEPT}
  58. { This fake CPU is used to allow incorporation of globtype unit
  59. into utils/ppudump without any CPU specific code PM }
  60. {$ifdef generic_cpu}
  61. {$define cpu32bit}
  62. {$define cpu32bitaddr}
  63. {$define cpu32bitalu}
  64. {$define cpuflags}
  65. {$define cpuextended}
  66. {$endif generic_cpu}
  67. {$ifdef cpuarm}
  68. {$packrecords c}
  69. {$endif cpuarm}
  70. {$ifdef i8086}
  71. {$define cpu16bit}
  72. {$define cpu16bitaddr}
  73. {$define cpu16bitalu}
  74. {$define x86}
  75. {$define cpuflags}
  76. {$define cpuextended}
  77. {//$define SUPPORT_MMX}
  78. {$define cpumm}
  79. {$define fewintregisters}
  80. {$define cpurox}
  81. {$define cpurefshaveindexreg}
  82. {$define SUPPORT_SAFECALL}
  83. {$define cpuneedsmulhelper}
  84. { TODO: add another define in order to disable the div helper for 16-bit divs? }
  85. {$define cpuneedsdivhelper}
  86. {$define VOLATILE_ES}
  87. {$define SUPPORT_GET_FRAME}
  88. {$define cpucg64shiftsupport}
  89. {$define OMFOBJSUPPORT}
  90. {$ifdef go32v2}
  91. { go32v2 uses cwsdpmi extender which is incompatible with watcom extender
  92. thus we use the internal smartlink sections by default in that case. }
  93. {$define I8086_SMARTLINK_SECTIONS}
  94. {$define i8086_link_intern_debuginfo}
  95. {$endif go32v2}
  96. {$endif i8086}
  97. {$ifdef i386}
  98. {$define cpu32bit}
  99. {$define cpu32bitaddr}
  100. {$define cpu32bitalu}
  101. {$define x86}
  102. {$define cpuflags}
  103. {$define cpuextended}
  104. {$define SUPPORT_MMX}
  105. {$define cpumm}
  106. {$define fewintregisters}
  107. {$define cpurox}
  108. {$define cpurefshaveindexreg}
  109. {$define SUPPORT_SAFECALL}
  110. {$define SUPPORT_GET_FRAME}
  111. {$define cpucapabilities}
  112. {$define cpucg64shiftsupport}
  113. {$endif i386}
  114. {$ifdef x86_64}
  115. {$define x86}
  116. {$define cpuflags}
  117. {$define cpu64bitalu}
  118. {$define cpu64bitaddr}
  119. {$define cpuextended}
  120. {$define cpufloat128}
  121. {$define cputargethasfixedstack}
  122. {$define cpumm}
  123. {$define cpurox}
  124. {$define cpurefshaveindexreg}
  125. {$define SUPPORT_SAFECALL}
  126. {$define SUPPORT_GET_FRAME}
  127. {$define cpucapabilities}
  128. {$endif x86_64}
  129. {$ifdef sparc}
  130. {$define cpu32bit}
  131. {$define cpu32bitaddr}
  132. {$define cpu32bitalu}
  133. {$define cpuflags}
  134. {$define cputargethasfixedstack}
  135. {$define cpurefshaveindexreg}
  136. {$define cpudelayslot}
  137. {$define SUPPORT_SAFECALL}
  138. {$define sparcgen}
  139. { the official name of the 32 Bit SPARC port is still "sparc" but
  140. using the sparc32 define makes things more clear }
  141. {$define sparc32}
  142. {$endif sparc}
  143. {$ifdef sparc64}
  144. {$define cpu64bit}
  145. {$define cpu64bitaddr}
  146. {$define cpu64bitalu}
  147. {$define cpuflags}
  148. {$define cputargethasfixedstack}
  149. {$define cpurefshaveindexreg}
  150. {$define cpudelayslot}
  151. {$define SUPPORT_SAFECALL}
  152. {$define sparcgen}
  153. {$endif sparc64}
  154. {$ifdef powerpc}
  155. {$define cpu32bit}
  156. {$define cpu32bitaddr}
  157. {$define cpu32bitalu}
  158. {$define cpuflags}
  159. {$define cputargethasfixedstack}
  160. {$define cpumm}
  161. {$define cpurox}
  162. {$define cpurefshaveindexreg}
  163. {$define SUPPORT_GET_FRAME}
  164. {$endif powerpc}
  165. {$ifdef powerpc64}
  166. {$define cpu64bitalu}
  167. {$define cpu64bitaddr}
  168. {$define cpuflags}
  169. {$define cputargethasfixedstack}
  170. {$define cpumm}
  171. {$define cpurox}
  172. {$define cpurefshaveindexreg}
  173. {$define cpuno32bitops}
  174. {$endif powerpc64}
  175. {$ifdef arm}
  176. {$define cpu32bit}
  177. {$define cpu32bitaddr}
  178. {$define cpu32bitalu}
  179. {$define cpuflags}
  180. {$define cpufpemu}
  181. {$define cpuneedsdivhelper}
  182. {$define cpurox}
  183. {$define cputargethasfixedstack}
  184. {$define cpurefshaveindexreg}
  185. {$define cpucapabilities}
  186. {$define SUPPORT_SAFECALL}
  187. {$define SUPPORT_GET_FRAME}
  188. { default to armel }
  189. {$if not(defined(CPUARM)) and not(defined(CPUARMEB)) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  190. {$define FPC_ARMEL}
  191. {$endif}
  192. { inherit FPC_ARMEL? }
  193. {$if defined(CPUARMEL) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  194. {$define FPC_ARMEL}
  195. {$endif}
  196. { inherit FPC_ARMEB? }
  197. {$if defined(CPUARMEB) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMHF))}
  198. {$define FPC_ARMEB}
  199. {$endif}
  200. { inherit FPC_ARMHF? }
  201. {$if defined(CPUARMHF) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMEB))}
  202. {$define FPC_ARMHF}
  203. {$endif}
  204. {$endif arm}
  205. {$ifdef m68k}
  206. {$define cpu32bit}
  207. {$define cpu32bitaddr}
  208. {$define cpu32bitalu}
  209. {$define cpuflags}
  210. {$define cpurox}
  211. {$define cpufpemu}
  212. {$define cpurefshaveindexreg}
  213. {$define cpucapabilities}
  214. {$define cpuneedsmulhelper}
  215. {$define cpuneedsdivhelper}
  216. {$define cpu_uses_separate_address_registers}
  217. {$define SUPPORT_SAFECALL}
  218. {$define SUPPORT_GET_FRAME}
  219. {$endif m68k}
  220. {$ifdef avr}
  221. {$define cpu8bit}
  222. {$define cpu16bitaddr}
  223. {$define cpu8bitalu}
  224. {$define cpuflags}
  225. {$define cpunofpu}
  226. {$define cpunodefaultint}
  227. {$define cpuneedsdivhelper}
  228. {$define cpuneedsmulhelper}
  229. {$define cpurefshaveindexreg}
  230. {$define cpucapabilities}
  231. {$endif avr}
  232. {$ifdef mipsel}
  233. {$define mips}
  234. {$else not mipsel}
  235. { Define both mips and mipseb if mipsel is not defined
  236. but mips cpu is wanted. }
  237. {$ifdef mipseb}
  238. {$define mips}
  239. {$endif mipseb}
  240. {$ifdef mips}
  241. {$define mipseb}
  242. {$endif mips}
  243. {$endif mipsel}
  244. {$ifdef mips}
  245. {$ifndef mips64}
  246. {$define cpu32bit}
  247. {$define cpu32bitalu}
  248. {$define cpu32bitaddr}
  249. {$else}
  250. {$error mips64 not yet supported}
  251. {$endif}
  252. {$define cpuflags} { Flags are emulated }
  253. {$define cputargethasfixedstack}
  254. {$define cpurequiresproperalignment}
  255. { define cpumm}
  256. {$define cpurefshaveindexreg}
  257. {$define cpudelayslot}
  258. {$define SUPPORT_GET_FRAME}
  259. {$define SUPPORT_SAFECALL}
  260. {$endif mips}
  261. {$ifdef jvm}
  262. {$define cpu32bit}
  263. {$define cpu64bitalu}
  264. {$define cpu32bitaddr}
  265. {$define cpuhighleveltarget}
  266. {$define symansistr}
  267. {$define SUPPORT_GET_FRAME}
  268. {$endif}
  269. {$ifdef aarch64}
  270. {$define cpu64bit}
  271. {$define cpu64bitaddr}
  272. {$define cpu64bitalu}
  273. {$define cpuflags}
  274. {$define cpurox}
  275. {$define cputargethasfixedstack}
  276. {$define cpurefshaveindexreg}
  277. {$define SUPPORT_GET_FRAME}
  278. {$define SUPPORT_SAFECALL}
  279. {$endif aarch64}
  280. { Stabs is not officially supported on 64 bit targets by gdb, except on Mac OS X
  281. (but there we don't support it)
  282. }
  283. {$ifdef cpu64bitaddr}
  284. {$ifndef USE_STABS_64}
  285. {$define NoDbgStabs}
  286. {$endif}
  287. {$endif}
  288. {$if not defined(FPC_HAS_TYPE_EXTENDED) and defined(i386)}
  289. {$ifndef FPC_SOFT_FPUX80}
  290. {$error Cross-compiling from systems without support for an 80 bit extended floating point type to i386 is not yet supported at this time }
  291. {$endif}
  292. {$endif}
  293. { when compiling with an LLVM-based compiler, default to LLVM unless -dNOLLVM is specified }
  294. {$if defined(CPULLVM) and not defined(NOLLVM)}
  295. {$define LLVM}
  296. {$endif}
  297. { llvm backends partially use other backends for parameter info calculation,
  298. alignment info, data sizes etc. They always support 64 bit alu though.
  299. }
  300. {$ifdef llvm}
  301. {$undef SUPPORT_MMX}
  302. {$undef cpu16bitalu}
  303. {$undef cpu32bitalu}
  304. {$define cpu64bitalu}
  305. {$define cpuhighleveltarget}
  306. {$define symansistr}
  307. {$endif}