fpcdefs.inc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  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. {$define CPU_BC_HAS_SIZE_LIMIT}
  171. {$endif powerpc}
  172. {$ifdef powerpc64}
  173. {$define cpu64bit}
  174. {$define cpu64bitalu}
  175. {$define cpu64bitaddr}
  176. {$define cpuflags}
  177. {$define cputargethasfixedstack}
  178. {$define cpumm}
  179. {$define cpurox}
  180. {$define cpurefshaveindexreg}
  181. {$define cpuno32bitops}
  182. {$define SUPPORT_SAFECALL}
  183. {$define CPU_BC_HAS_SIZE_LIMIT}
  184. {$endif powerpc64}
  185. {$ifdef arm}
  186. {$define cpu32bit}
  187. {$define cpu32bitaddr}
  188. {$define cpu32bitalu}
  189. {$define cpuflags}
  190. {$define cpufpemu}
  191. {$define cpuneedsdivhelper}
  192. {$define cpurox}
  193. {$define cputargethasfixedstack}
  194. {$define cpurefshaveindexreg}
  195. {$define cpucapabilities}
  196. {$define fpucapabilities}
  197. {$define SUPPORT_SAFECALL}
  198. {$define SUPPORT_GET_FRAME}
  199. { default to armel }
  200. {$if not(defined(CPUARM)) and not(defined(CPUARMEB)) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  201. {$define FPC_ARMEL}
  202. {$endif}
  203. { inherit FPC_ARMEL? }
  204. {$if defined(CPUARMEL) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  205. {$define FPC_ARMEL}
  206. {$endif}
  207. { inherit FPC_ARMEB? }
  208. {$if defined(CPUARMEB) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMHF))}
  209. {$define FPC_ARMEB}
  210. {$endif}
  211. { inherit FPC_ARMHF? }
  212. {$if defined(CPUARMHF) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMEB))}
  213. {$define FPC_ARMHF}
  214. {$endif}
  215. { inherit FPC_OARM? }
  216. {$if defined(CPUARM) and not(defined(FPC_ARMHF)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMEB))}
  217. {$define FPC_ARMHF}
  218. {$endif}
  219. {$endif arm}
  220. {$ifdef m68k}
  221. {$define cpu32bit}
  222. {$define cpu32bitaddr}
  223. {$define cpu32bitalu}
  224. {$define cpuflags}
  225. {$define cpurox}
  226. {$define cpufpemu}
  227. {$define cpurefshaveindexreg}
  228. {$define cpucapabilities}
  229. {$define fpucapabilities}
  230. {$define cpuneedsmulhelper}
  231. {$define cpuneedsdivhelper}
  232. {$define cpu_uses_separate_address_registers}
  233. {$define SUPPORT_SAFECALL}
  234. {$define SUPPORT_GET_FRAME}
  235. {$endif m68k}
  236. {$ifdef avr}
  237. {$define cpu8bit}
  238. {$define cpu16bitaddr}
  239. {$define cpu8bitalu}
  240. {$define cpuflags}
  241. {$define cpunofpu}
  242. {$define cpunodefaultint}
  243. {$define cpuneedsdivhelper}
  244. {$define cpuneedsmulhelper}
  245. {$define cpurefshaveindexreg}
  246. {$define cpucapabilities}
  247. {$endif avr}
  248. {$ifdef mipsel}
  249. {$define mips}
  250. {$define mips32}
  251. {$else not mipsel}
  252. { Define both mips and mipseb if mipsel is not defined
  253. but mips cpu is wanted. }
  254. {$ifdef mipseb}
  255. {$define mips}
  256. {$define mips32}
  257. {$endif mipseb}
  258. {$ifdef mips}
  259. {$define mipseb}
  260. {$define mips32}
  261. {$endif mips}
  262. {$endif mipsel}
  263. {$ifdef mips64eb}
  264. {$define mips}
  265. {$define mips64}
  266. {$endif mips64eb}
  267. { Also accept mips64 for big endian 64-bit mips, but only if mips64 el is not set }
  268. {$ifdef mips64}
  269. {$define mips}
  270. {$ifndef mips64el}
  271. {$define mips64eb}
  272. {$endif not mips64el}
  273. {$endif mips64}
  274. {$ifdef mips64el}
  275. {$define mips}
  276. {$define mips64}
  277. {$endif mips64el}
  278. {$ifdef mips}
  279. {$ifndef mips64}
  280. {$define cpu32bit}
  281. {$define cpu32bitalu}
  282. {$define cpu32bitaddr}
  283. {$else}
  284. {$define cpu64bit}
  285. {$define cpu64bitalu}
  286. {$define cpu64bitaddr}
  287. {$endif}
  288. {$define cpufpemu}
  289. {$define cpuflags} { Flags are emulated }
  290. {$define cputargethasfixedstack}
  291. {$define cpurequiresproperalignment}
  292. { define cpumm}
  293. {$define cpurefshaveindexreg}
  294. {$define cpudelayslot}
  295. {$define SUPPORT_GET_FRAME}
  296. {$define SUPPORT_SAFECALL}
  297. {$endif mips}
  298. {$ifdef jvm}
  299. {$define cpu32bit}
  300. {$define cpu64bitalu}
  301. {$define cpu32bitaddr}
  302. {$define cpuhighleveltarget}
  303. {$define symansistr}
  304. {$define SUPPORT_GET_FRAME}
  305. {$endif}
  306. {$ifdef aarch64}
  307. {$define cpu64bit}
  308. {$define cpu64bitaddr}
  309. {$define cpu64bitalu}
  310. {$define cpuflags}
  311. {$define cpurox}
  312. {$define cputargethasfixedstack}
  313. {$define cpurefshaveindexreg}
  314. {$define SUPPORT_GET_FRAME}
  315. {$define SUPPORT_SAFECALL}
  316. {$define cpucapabilities}
  317. {$define fpucapabilities}
  318. {$endif aarch64}
  319. {$ifdef riscv32}
  320. {$define riscv}
  321. {$define cpu32bit}
  322. {$define cpu32bitaddr}
  323. {$define cpu32bitalu}
  324. {$define cpurox}
  325. {$define cpufpemu}
  326. {$define cputargethasfixedstack}
  327. {$define cpuneedsmulhelper}
  328. {$define cpuneedsdivhelper}
  329. {$define cpucapabilities}
  330. {$define cpurequiresproperalignment}
  331. {$define SUPPORT_SAFECALL}
  332. {$endif riscv32}
  333. {$ifdef z80}
  334. {$define cpu8bit}
  335. {$define cpu16bitaddr}
  336. {$define cpu8bitalu}
  337. {$define cpufpemu}
  338. {$define cpuflags}
  339. {$define cpunofpu}
  340. {$define cpunodefaultint}
  341. {$define cpuneedsdivhelper}
  342. {$define cpuneedsmulhelper}
  343. {$define cpucapabilities}
  344. {$endif z80}
  345. {$ifdef riscv64}
  346. {$define riscv}
  347. {$define cpu64bit}
  348. {$define cpu64bitaddr}
  349. {$define cpu64bitalu}
  350. {$define cpurox}
  351. {$define cpufpemu}
  352. {$define cputargethasfixedstack}
  353. {$define cpuneedsmulhelper}
  354. {$define cpuneedsdivhelper}
  355. {$define cpucapabilities}
  356. {$define cpurequiresproperalignment}
  357. {$define SUPPORT_SAFECALL}
  358. {$endif riscv64}
  359. {$ifdef xtensa}
  360. {$define cpu32bit}
  361. {$define cpu32bitaddr}
  362. {$define cpu32bitalu}
  363. {$define cpufpemu}
  364. {$define cpuflags} { xtensa has a boolean extension }
  365. {$define cputargethasfixedstack}
  366. {$define cpuneedsdivhelper}
  367. {$define cpucapabilities}
  368. {$define cpurequiresproperalignment}
  369. {$define cpufloatintregmov}
  370. {$endif xtensa}
  371. {$ifdef loongarch64}
  372. {$define loongarch}
  373. {$define cpu64bit}
  374. {$define cpu64bitaddr}
  375. {$define cpu64bitalu}
  376. {$define cputargethasfixedstack}
  377. {$define cpucapabilities}
  378. {$define SUPPORT_SAFECALL}
  379. {$endif loongarch64}
  380. { Stabs is not officially supported on 64 bit targets by gdb, except on Mac OS X
  381. (but there we don't support it)
  382. }
  383. {$ifdef cpu64bitaddr}
  384. {$ifndef USE_STABS_64}
  385. {$define NoDbgStabs}
  386. {$endif}
  387. {$endif}
  388. {$if not defined(FPC_HAS_TYPE_EXTENDED) and defined(i386)}
  389. {$ifndef FPC_SOFT_FPUX80}
  390. {$error Cross-compiling from systems without support for an 80 bit extended floating point type to i386 is not yet supported at this time }
  391. {$endif}
  392. {$endif}
  393. { when compiling with an LLVM-based compiler, default to LLVM unless -dNOLLVM is specified }
  394. {$if defined(CPULLVM) and not defined(NOLLVM)}
  395. {$define LLVM}
  396. {$endif}
  397. { llvm backends partially use other backends for parameter info calculation,
  398. alignment info, data sizes etc. They always support 64 bit alu though.
  399. }
  400. {$ifdef llvm}
  401. {$undef SUPPORT_MMX}
  402. {$undef cpuneedsmulhelper}
  403. {$undef cpuneedsdivhelper}
  404. {$define cpuhighleveltarget}
  405. {$define cpucg64shiftsupport}
  406. {$define symansistr}
  407. {$endif}
  408. {$ifdef wasm32}
  409. {$define wasm}
  410. {$define cpu32bit}
  411. {$define cpu64bitalu}
  412. {$define cpu32bitaddr}
  413. {$define cpuhighleveltarget}
  414. {$define cpurox}
  415. {$define symansistr}
  416. {$define SUPPORT_GET_FRAME}
  417. {$endif}