fpcdefs.inc 11 KB

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