fpcdefs.inc 11 KB

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