fpcdefs.inc 11 KB

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