fpcdefs.inc 8.4 KB

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