2
0

fpcdefs.inc 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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_GET_FRAME}
  139. {$endif powerpc}
  140. {$ifdef powerpc64}
  141. {$define cpu64bitalu}
  142. {$define cpu64bitaddr}
  143. {$define cpuflags}
  144. {$define cputargethasfixedstack}
  145. {$define cpumm}
  146. {$define cpurox}
  147. {$define cpurefshaveindexreg}
  148. {$define cpuno32bitops}
  149. {$endif powerpc64}
  150. {$ifdef arm}
  151. {$define cpu32bit}
  152. {$define cpu32bitaddr}
  153. {$define cpu32bitalu}
  154. {$define cpuflags}
  155. {$define cpufpemu}
  156. {$define cpuneedsdivhelper}
  157. {$define cpurox}
  158. {$define cputargethasfixedstack}
  159. {$define cpurefshaveindexreg}
  160. {$define cpucapabilities}
  161. {$define fpucapabilities}
  162. {$define SUPPORT_SAFECALL}
  163. {$define SUPPORT_GET_FRAME}
  164. { default to armel }
  165. {$if not(defined(CPUARM)) and not(defined(CPUARMEB)) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  166. {$define FPC_ARMEL}
  167. {$endif}
  168. { inherit FPC_ARMEL? }
  169. {$if defined(CPUARMEL) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  170. {$define FPC_ARMEL}
  171. {$endif}
  172. { inherit FPC_ARMEB? }
  173. {$if defined(CPUARMEB) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMHF))}
  174. {$define FPC_ARMEB}
  175. {$endif}
  176. { inherit FPC_ARMHF? }
  177. {$if defined(CPUARMHF) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMEB))}
  178. {$define FPC_ARMHF}
  179. {$endif}
  180. {$endif arm}
  181. {$ifdef m68k}
  182. {$define cpu32bit}
  183. {$define cpu32bitaddr}
  184. {$define cpu32bitalu}
  185. {$define cpuflags}
  186. {$define cpurox}
  187. {$define cpufpemu}
  188. {$define cpurefshaveindexreg}
  189. {$define cpucapabilities}
  190. {$define fpucapabilities}
  191. {$define cpuneedsmulhelper}
  192. {$define cpuneedsdivhelper}
  193. {$define cpu_uses_separate_address_registers}
  194. {$define SUPPORT_SAFECALL}
  195. {$define SUPPORT_GET_FRAME}
  196. {$endif m68k}
  197. {$ifdef avr}
  198. {$define cpu8bit}
  199. {$define cpu16bitaddr}
  200. {$define cpu8bitalu}
  201. {$define cpuflags}
  202. {$define cpunofpu}
  203. {$define cpunodefaultint}
  204. {$define cpuneedsdivhelper}
  205. {$define cpuneedsmulhelper}
  206. {$define cpurefshaveindexreg}
  207. {$define cpucapabilities}
  208. {$endif avr}
  209. {$ifdef mipsel}
  210. {$define mips}
  211. {$else not mipsel}
  212. { Define both mips and mipseb if mipsel is not defined
  213. but mips cpu is wanted. }
  214. {$ifdef mipseb}
  215. {$define mips}
  216. {$endif mipseb}
  217. {$ifdef mips}
  218. {$define mipseb}
  219. {$endif mips}
  220. {$endif mipsel}
  221. {$ifdef mips}
  222. {$ifndef mips64}
  223. {$define cpu32bit}
  224. {$define cpu32bitalu}
  225. {$define cpu32bitaddr}
  226. {$else}
  227. {$error mips64 not yet supported}
  228. {$endif}
  229. {$define cpuflags} { Flags are emulated }
  230. {$define cputargethasfixedstack}
  231. {$define cpurequiresproperalignment}
  232. { define cpumm}
  233. {$define cpurefshaveindexreg}
  234. {$define cpudelayslot}
  235. {$define SUPPORT_GET_FRAME}
  236. {$define SUPPORT_SAFECALL}
  237. {$endif mips}
  238. {$ifdef jvm}
  239. {$define cpu32bit}
  240. {$define cpu64bitalu}
  241. {$define cpu32bitaddr}
  242. {$define cpuhighleveltarget}
  243. {$define symansistr}
  244. {$define SUPPORT_GET_FRAME}
  245. {$endif}
  246. {$ifdef aarch64}
  247. {$define cpu64bit}
  248. {$define cpu64bitaddr}
  249. {$define cpu64bitalu}
  250. {$define cpuflags}
  251. {$define cpurox}
  252. {$define cputargethasfixedstack}
  253. {$define cpurefshaveindexreg}
  254. {$define SUPPORT_GET_FRAME}
  255. {$define SUPPORT_SAFECALL}
  256. {$endif aarch64}
  257. {$ifdef riscv32}
  258. {$define riscv}
  259. {$define cpu32bit}
  260. {$define cpu32bitaddr}
  261. {$define cpu32bitalu}
  262. {$define cpufpemu}
  263. {$define cputargethasfixedstack}
  264. {$define cpuneedsmulhelper}
  265. {$define cpuneedsdivhelper}
  266. {$define cpucapabilities}
  267. {$define cpurequiresproperalignment}
  268. {$endif riscv32}
  269. {$ifdef riscv64}
  270. {$define riscv}
  271. {$define cpu64bit}
  272. {$define cpu64bitaddr}
  273. {$define cpu64bitalu}
  274. {$define cpufpemu}
  275. {$define cputargethasfixedstack}
  276. {$define cpuneedsmulhelper}
  277. {$define cpuneedsdivhelper}
  278. {$define cpucapabilities}
  279. {$define cpurequiresproperalignment}
  280. {$endif riscv64}
  281. { Stabs is not officially supported on 64 bit targets by gdb, except on Mac OS X
  282. (but there we don't support it)
  283. }
  284. {$ifdef cpu64bitaddr}
  285. {$ifndef USE_STABS_64}
  286. {$define NoDbgStabs}
  287. {$endif}
  288. {$endif}
  289. {$if not defined(FPC_HAS_TYPE_EXTENDED) and defined(i386)}
  290. {$ifndef FPC_SOFT_FPUX80}
  291. {$error Cross-compiling from systems without support for an 80 bit extended floating point type to i386 is not yet supported at this time }
  292. {$endif}
  293. {$endif}
  294. { llvm backends partially use other backends for parameter info calculation,
  295. alignment info, data sizes etc. They always support 64 bit alu though.
  296. }
  297. {$ifdef llvm}
  298. {$undef SUPPORT_MMX}
  299. {$undef cpuneedsmulhelper}
  300. {$undef cpuneedsdivhelper}
  301. {$define cpuhighleveltarget}
  302. {$define cpucg64shiftsupport}
  303. {$define symansistr}
  304. {$endif}