fpcdefs.inc 9.3 KB

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