fpcdefs.inc 8.2 KB

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