fpcdefs.inc 11 KB

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