fpcdefs.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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. { This fake CPU is used to allow incorporation of globtype unit
  54. into utils/ppudump without any CPU specific code PM }
  55. {$ifdef generic_cpu}
  56. {$define cpu32bit}
  57. {$define cpu32bitaddr}
  58. {$define cpu32bitalu}
  59. {$define cpuflags}
  60. {$define cpuextended}
  61. {$endif generic_cpu}
  62. {$ifdef cpuarm}
  63. {$packrecords c}
  64. {$endif cpuarm}
  65. {$ifdef i8086}
  66. {$define cpu16bit}
  67. {$define cpu16bitaddr}
  68. {$define cpu16bitalu}
  69. {$define x86}
  70. {$define cpuflags}
  71. {$define cpuextended}
  72. {//$define SUPPORT_MMX}
  73. {$define cpumm}
  74. {$define fewintregisters}
  75. {$define cpurox}
  76. {$define cpurefshaveindexreg}
  77. {$define SUPPORT_SAFECALL}
  78. {$define cpuneedsmulhelper}
  79. { TODO: add another define in order to disable the div helper for 16-bit divs? }
  80. {$define cpuneedsdivhelper}
  81. {$define VOLATILE_ES}
  82. {$define SUPPORT_GET_FRAME}
  83. {$define cpucg64shiftsupport}
  84. {$define OMFOBJSUPPORT}
  85. {$ifdef go32v2}
  86. { go32v2 uses cwsdpmi extender which is incompatible with watcom extender
  87. thus we use the internal smartlink sections by default in that case. }
  88. {$define I8086_SMARTLINK_SECTIONS}
  89. {$define i8086_link_intern_debuginfo}
  90. {$endif go32v2}
  91. {$endif i8086}
  92. {$ifdef i386}
  93. {$define cpu32bit}
  94. {$define cpu32bitaddr}
  95. {$define cpu32bitalu}
  96. {$define x86}
  97. {$define cpuflags}
  98. {$define cpuextended}
  99. {$define SUPPORT_MMX}
  100. {$define cpumm}
  101. {$define fewintregisters}
  102. {$define cpurox}
  103. {$define cpurefshaveindexreg}
  104. {$define SUPPORT_SAFECALL}
  105. {$define SUPPORT_GET_FRAME}
  106. {$define cpucapabilities}
  107. {$define fpucapabilities}
  108. {$define cpucg64shiftsupport}
  109. {$endif i386}
  110. {$ifdef x86_64}
  111. {$define x86}
  112. {$define cpuflags}
  113. {$define cpu64bitalu}
  114. {$define cpu64bitaddr}
  115. {$define cpuextended}
  116. {$define cpufloat128}
  117. {$define cputargethasfixedstack}
  118. {$define cpumm}
  119. {$define cpurox}
  120. {$define cpurefshaveindexreg}
  121. {$define SUPPORT_SAFECALL}
  122. {$define SUPPORT_GET_FRAME}
  123. {$define cpucapabilities}
  124. {$define fpucapabilities}
  125. {$endif x86_64}
  126. {$ifdef sparc}
  127. {$define cpu32bit}
  128. {$define cpu32bitaddr}
  129. {$define cpu32bitalu}
  130. {$define cpuflags}
  131. {$define cputargethasfixedstack}
  132. {$define cpurefshaveindexreg}
  133. {$define cpudelayslot}
  134. {$define SUPPORT_SAFECALL}
  135. {$define sparcgen}
  136. { the official name of the 32 Bit SPARC port is still "sparc" but
  137. using the sparc32 define makes things more clear }
  138. {$define sparc32}
  139. {$endif sparc}
  140. {$ifdef sparc64}
  141. {$define cpu64bit}
  142. {$define cpu64bitaddr}
  143. {$define cpu64bitalu}
  144. {$define cpuflags}
  145. {$define cputargethasfixedstack}
  146. {$define cpurefshaveindexreg}
  147. {$define cpudelayslot}
  148. {$define SUPPORT_SAFECALL}
  149. {$define sparcgen}
  150. {$endif sparc64}
  151. {$ifdef powerpc}
  152. {$define cpu32bit}
  153. {$define cpu32bitaddr}
  154. {$define cpu32bitalu}
  155. {$define cpuflags}
  156. {$define cputargethasfixedstack}
  157. {$define cpumm}
  158. {$define cpurox}
  159. {$define cpurefshaveindexreg}
  160. {$define SUPPORT_SAFECALL}
  161. {$define SUPPORT_GET_FRAME}
  162. {$endif powerpc}
  163. {$ifdef powerpc64}
  164. {$define cpu64bitalu}
  165. {$define cpu64bitaddr}
  166. {$define cpuflags}
  167. {$define cputargethasfixedstack}
  168. {$define cpumm}
  169. {$define cpurox}
  170. {$define cpurefshaveindexreg}
  171. {$define cpuno32bitops}
  172. {$define SUPPORT_SAFECALL}
  173. {$endif powerpc64}
  174. {$ifdef arm}
  175. {$define cpu32bit}
  176. {$define cpu32bitaddr}
  177. {$define cpu32bitalu}
  178. {$define cpuflags}
  179. {$define cpufpemu}
  180. {$define cpuneedsdivhelper}
  181. {$define cpurox}
  182. {$define cputargethasfixedstack}
  183. {$define cpurefshaveindexreg}
  184. {$define cpucapabilities}
  185. {$define fpucapabilities}
  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. { inherit FPC_OARM? }
  205. {$if defined(CPUARM) and not(defined(FPC_ARMHF)) 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. {$define cpucapabilities}
  291. {$define fpucapabilities}
  292. {$endif aarch64}
  293. {$ifdef riscv32}
  294. {$define riscv}
  295. {$define cpu32bit}
  296. {$define cpu32bitaddr}
  297. {$define cpu32bitalu}
  298. {$define cpufpemu}
  299. {$define cputargethasfixedstack}
  300. {$define cpuneedsmulhelper}
  301. {$define cpuneedsdivhelper}
  302. {$define cpucapabilities}
  303. {$define cpurequiresproperalignment}
  304. {$endif riscv32}
  305. {$ifdef z80}
  306. {$define cpu8bit}
  307. {$define cpu16bitaddr}
  308. {$define cpu8bitalu}
  309. {$define cpufpemu}
  310. {$define cpuflags}
  311. {$define cpunofpu}
  312. {$define cpunodefaultint}
  313. {$define cpuneedsdivhelper}
  314. {$define cpuneedsmulhelper}
  315. {$define cpucapabilities}
  316. {$endif z80}
  317. {$ifdef riscv64}
  318. {$define riscv}
  319. {$define cpu64bit}
  320. {$define cpu64bitaddr}
  321. {$define cpu64bitalu}
  322. {$define cpufpemu}
  323. {$define cputargethasfixedstack}
  324. {$define cpuneedsmulhelper}
  325. {$define cpuneedsdivhelper}
  326. {$define cpucapabilities}
  327. {$define cpurequiresproperalignment}
  328. {$endif riscv64}
  329. {$ifdef xtensa}
  330. {$define cpu32bit}
  331. {$define cpu32bitaddr}
  332. {$define cpu32bitalu}
  333. {$define cpufpemu}
  334. {$define cpuflags} { xtensa has a boolean extension }
  335. {$define cputargethasfixedstack}
  336. {$define cpuneedsdivhelper}
  337. {$define cpucapabilities}
  338. {$define cpurequiresproperalignment}
  339. {$define cpufloatintregmov}
  340. {$endif xtensa}
  341. { Stabs is not officially supported on 64 bit targets by gdb, except on Mac OS X
  342. (but there we don't support it)
  343. }
  344. {$ifdef cpu64bitaddr}
  345. {$ifndef USE_STABS_64}
  346. {$define NoDbgStabs}
  347. {$endif}
  348. {$endif}
  349. {$if not defined(FPC_HAS_TYPE_EXTENDED) and defined(i386)}
  350. {$ifndef FPC_SOFT_FPUX80}
  351. {$error Cross-compiling from systems without support for an 80 bit extended floating point type to i386 is not yet supported at this time }
  352. {$endif}
  353. {$endif}
  354. { when compiling with an LLVM-based compiler, default to LLVM unless -dNOLLVM is specified }
  355. {$if defined(CPULLVM) and not defined(NOLLVM)}
  356. {$define LLVM}
  357. {$endif}
  358. { llvm backends partially use other backends for parameter info calculation,
  359. alignment info, data sizes etc. They always support 64 bit alu though.
  360. }
  361. {$ifdef llvm}
  362. {$undef SUPPORT_MMX}
  363. {$undef cpuneedsmulhelper}
  364. {$undef cpuneedsdivhelper}
  365. {$define cpuhighleveltarget}
  366. {$define cpucg64shiftsupport}
  367. {$define symansistr}
  368. {$endif}
  369. {$ifdef wasm32}
  370. {$define wasm}
  371. {$define cpu32bit}
  372. {$define cpu64bitalu}
  373. {$define cpu32bitaddr}
  374. {$define cpuhighleveltarget}
  375. {$define symansistr}
  376. {$define SUPPORT_GET_FRAME}
  377. {$endif}