fpcdefs.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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. { inherit FPC_OARM? }
  209. {$if defined(CPUARM) and not(defined(FPC_ARMHF)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMEB))}
  210. {$define FPC_ARMHF}
  211. {$endif}
  212. {$endif arm}
  213. {$ifdef m68k}
  214. {$define cpu32bit}
  215. {$define cpu32bitaddr}
  216. {$define cpu32bitalu}
  217. {$define cpuflags}
  218. {$define cpurox}
  219. {$define cpufpemu}
  220. {$define cpurefshaveindexreg}
  221. {$define cpucapabilities}
  222. {$define fpucapabilities}
  223. {$define cpuneedsmulhelper}
  224. {$define cpuneedsdivhelper}
  225. {$define cpu_uses_separate_address_registers}
  226. {$define SUPPORT_SAFECALL}
  227. {$define SUPPORT_GET_FRAME}
  228. {$endif m68k}
  229. {$ifdef avr}
  230. {$define cpu8bit}
  231. {$define cpu16bitaddr}
  232. {$define cpu8bitalu}
  233. {$define cpuflags}
  234. {$define cpunofpu}
  235. {$define cpunodefaultint}
  236. {$define cpuneedsdivhelper}
  237. {$define cpuneedsmulhelper}
  238. {$define cpurefshaveindexreg}
  239. {$define cpucapabilities}
  240. {$endif avr}
  241. {$ifdef mipsel}
  242. {$define mips}
  243. {$else not mipsel}
  244. { Define both mips and mipseb if mipsel is not defined
  245. but mips cpu is wanted. }
  246. {$ifdef mipseb}
  247. {$define mips}
  248. {$endif mipseb}
  249. {$ifdef mips}
  250. {$define mipseb}
  251. {$endif mips}
  252. {$endif mipsel}
  253. {$ifdef mips64el}
  254. {$define mips}
  255. {$define mips64}
  256. {$endif mipsel}
  257. {$ifdef mips}
  258. {$ifndef mips64}
  259. {$define cpu32bit}
  260. {$define cpu32bitalu}
  261. {$define cpu32bitaddr}
  262. {$else}
  263. {$define cpu64bit}
  264. {$define cpu64bitalu}
  265. {$define cpu64bitaddr}
  266. {$endif}
  267. {$define cpuflags} { Flags are emulated }
  268. {$define cputargethasfixedstack}
  269. {$define cpurequiresproperalignment}
  270. { define cpumm}
  271. {$define cpurefshaveindexreg}
  272. {$define cpudelayslot}
  273. {$define SUPPORT_GET_FRAME}
  274. {$define SUPPORT_SAFECALL}
  275. {$endif mips}
  276. {$ifdef jvm}
  277. {$define cpu32bit}
  278. {$define cpu64bitalu}
  279. {$define cpu32bitaddr}
  280. {$define cpuhighleveltarget}
  281. {$define symansistr}
  282. {$define SUPPORT_GET_FRAME}
  283. {$endif}
  284. {$ifdef aarch64}
  285. {$define cpu64bit}
  286. {$define cpu64bitaddr}
  287. {$define cpu64bitalu}
  288. {$define cpuflags}
  289. {$define cpurox}
  290. {$define cputargethasfixedstack}
  291. {$define cpurefshaveindexreg}
  292. {$define SUPPORT_GET_FRAME}
  293. {$define SUPPORT_SAFECALL}
  294. {$define cpucapabilities}
  295. {$define fpucapabilities}
  296. {$endif aarch64}
  297. {$ifdef riscv32}
  298. {$define riscv}
  299. {$define cpu32bit}
  300. {$define cpu32bitaddr}
  301. {$define cpu32bitalu}
  302. {$define cpufpemu}
  303. {$define cputargethasfixedstack}
  304. {$define cpuneedsmulhelper}
  305. {$define cpuneedsdivhelper}
  306. {$define cpucapabilities}
  307. {$define cpurequiresproperalignment}
  308. {$endif riscv32}
  309. {$ifdef z80}
  310. {$define cpu8bit}
  311. {$define cpu16bitaddr}
  312. {$define cpu8bitalu}
  313. {$define cpufpemu}
  314. {$define cpuflags}
  315. {$define cpunofpu}
  316. {$define cpunodefaultint}
  317. {$define cpuneedsdivhelper}
  318. {$define cpuneedsmulhelper}
  319. {$define cpucapabilities}
  320. {$endif z80}
  321. {$ifdef riscv64}
  322. {$define riscv}
  323. {$define cpu64bit}
  324. {$define cpu64bitaddr}
  325. {$define cpu64bitalu}
  326. {$define cpufpemu}
  327. {$define cputargethasfixedstack}
  328. {$define cpuneedsmulhelper}
  329. {$define cpuneedsdivhelper}
  330. {$define cpucapabilities}
  331. {$define cpurequiresproperalignment}
  332. {$endif riscv64}
  333. {$ifdef xtensa}
  334. {$define cpu32bit}
  335. {$define cpu32bitaddr}
  336. {$define cpu32bitalu}
  337. {$define cpufpemu}
  338. {$define cpuflags} { xtensa has a boolean extension }
  339. {$define cputargethasfixedstack}
  340. {$define cpuneedsdivhelper}
  341. {$define cpucapabilities}
  342. {$define cpurequiresproperalignment}
  343. {$define cpufloatintregmov}
  344. {$endif xtensa}
  345. { Stabs is not officially supported on 64 bit targets by gdb, except on Mac OS X
  346. (but there we don't support it)
  347. }
  348. {$ifdef cpu64bitaddr}
  349. {$ifndef USE_STABS_64}
  350. {$define NoDbgStabs}
  351. {$endif}
  352. {$endif}
  353. {$if not defined(FPC_HAS_TYPE_EXTENDED) and defined(i386)}
  354. {$ifndef FPC_SOFT_FPUX80}
  355. {$error Cross-compiling from systems without support for an 80 bit extended floating point type to i386 is not yet supported at this time }
  356. {$endif}
  357. {$endif}
  358. { when compiling with an LLVM-based compiler, default to LLVM unless -dNOLLVM is specified }
  359. {$if defined(CPULLVM) and not defined(NOLLVM)}
  360. {$define LLVM}
  361. {$endif}
  362. { llvm backends partially use other backends for parameter info calculation,
  363. alignment info, data sizes etc. They always support 64 bit alu though.
  364. }
  365. {$ifdef llvm}
  366. {$undef SUPPORT_MMX}
  367. {$undef cpuneedsmulhelper}
  368. {$undef cpuneedsdivhelper}
  369. {$define cpuhighleveltarget}
  370. {$define cpucg64shiftsupport}
  371. {$define symansistr}
  372. {$endif}
  373. {$ifdef wasm32}
  374. {$define wasm}
  375. {$define cpu32bit}
  376. {$define cpu64bitalu}
  377. {$define cpu32bitaddr}
  378. {$define cpuhighleveltarget}
  379. {$define symansistr}
  380. {$define SUPPORT_GET_FRAME}
  381. {$endif}