fpcdefs.inc 10 KB

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