fpcdefs.inc 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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 fpucapabilities}
  89. {$define cpucg64shiftsupport}
  90. {$endif i386}
  91. {$ifdef x86_64}
  92. {$define x86}
  93. {$define cpuflags}
  94. {$define cpu64bitalu}
  95. {$define cpu64bitaddr}
  96. {$define cpuextended}
  97. {$define cpufloat128}
  98. {$define cputargethasfixedstack}
  99. {$define cpumm}
  100. {$define cpurox}
  101. {$define cpurefshaveindexreg}
  102. {$define SUPPORT_SAFECALL}
  103. {$define SUPPORT_GET_FRAME}
  104. {$define cpucapabilities}
  105. {$define fpucapabilities}
  106. {$endif x86_64}
  107. {$ifdef sparc}
  108. {$define cpu32bit}
  109. {$define cpu32bitaddr}
  110. {$define cpu32bitalu}
  111. {$define cpuflags}
  112. {$define cputargethasfixedstack}
  113. {$define cpurefshaveindexreg}
  114. {$define cpudelayslot}
  115. {$define SUPPORT_SAFECALL}
  116. {$define sparcgen}
  117. { the official name of the 32 Bit SPARC port is still "sparc" but
  118. using the sparc32 define makes things more clear }
  119. {$define sparc32}
  120. {$endif sparc}
  121. {$ifdef sparc64}
  122. {$define cpu64bit}
  123. {$define cpu64bitaddr}
  124. {$define cpu64bitalu}
  125. {$define cpuflags}
  126. {$define cputargethasfixedstack}
  127. {$define cpurefshaveindexreg}
  128. {$define cpudelayslot}
  129. {$define SUPPORT_SAFECALL}
  130. {$define sparcgen}
  131. {$endif sparc64}
  132. {$ifdef powerpc}
  133. {$define cpu32bit}
  134. {$define cpu32bitaddr}
  135. {$define cpu32bitalu}
  136. {$define cpuflags}
  137. {$define cputargethasfixedstack}
  138. {$define cpumm}
  139. {$define cpurox}
  140. {$define cpurefshaveindexreg}
  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. {$endif powerpc64}
  153. {$ifdef arm}
  154. {$define cpu32bit}
  155. {$define cpu32bitaddr}
  156. {$define cpu32bitalu}
  157. {$define cpuflags}
  158. {$define cpufpemu}
  159. {$define cpuneedsdivhelper}
  160. {$define cpurox}
  161. {$define cputargethasfixedstack}
  162. {$define cpurefshaveindexreg}
  163. {$define cpucapabilities}
  164. {$define fpucapabilities}
  165. {$define SUPPORT_SAFECALL}
  166. {$define SUPPORT_GET_FRAME}
  167. { default to armel }
  168. {$if not(defined(CPUARM)) and not(defined(CPUARMEB)) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  169. {$define FPC_ARMEL}
  170. {$endif}
  171. { inherit FPC_ARMEL? }
  172. {$if defined(CPUARMEL) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  173. {$define FPC_ARMEL}
  174. {$endif}
  175. { inherit FPC_ARMEB? }
  176. {$if defined(CPUARMEB) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMHF))}
  177. {$define FPC_ARMEB}
  178. {$endif}
  179. { inherit FPC_ARMHF? }
  180. {$if defined(CPUARMHF) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMEB))}
  181. {$define FPC_ARMHF}
  182. {$endif}
  183. {$endif arm}
  184. {$ifdef m68k}
  185. {$define cpu32bit}
  186. {$define cpu32bitaddr}
  187. {$define cpu32bitalu}
  188. {$define cpuflags}
  189. {$define cpurox}
  190. {$define cpufpemu}
  191. {$define cpurefshaveindexreg}
  192. {$define cpucapabilities}
  193. {$define fpucapabilities}
  194. {$define cpuneedsmulhelper}
  195. {$define cpuneedsdivhelper}
  196. {$define cpu_uses_separate_address_registers}
  197. {$define SUPPORT_SAFECALL}
  198. {$define SUPPORT_GET_FRAME}
  199. {$endif m68k}
  200. {$ifdef avr}
  201. {$define cpu8bit}
  202. {$define cpu16bitaddr}
  203. {$define cpu8bitalu}
  204. {$define cpuflags}
  205. {$define cpunofpu}
  206. {$define cpunodefaultint}
  207. {$define cpuneedsdivhelper}
  208. {$define cpuneedsmulhelper}
  209. {$define cpurefshaveindexreg}
  210. {$define cpucapabilities}
  211. {$endif avr}
  212. {$ifdef mipsel}
  213. {$define mips}
  214. {$else not mipsel}
  215. { Define both mips and mipseb if mipsel is not defined
  216. but mips cpu is wanted. }
  217. {$ifdef mipseb}
  218. {$define mips}
  219. {$endif mipseb}
  220. {$ifdef mips}
  221. {$define mipseb}
  222. {$endif mips}
  223. {$endif mipsel}
  224. {$ifdef mips}
  225. {$ifndef mips64}
  226. {$define cpu32bit}
  227. {$define cpu32bitalu}
  228. {$define cpu32bitaddr}
  229. {$else}
  230. {$error mips64 not yet supported}
  231. {$endif}
  232. {$define cpuflags} { Flags are emulated }
  233. {$define cputargethasfixedstack}
  234. {$define cpurequiresproperalignment}
  235. { define cpumm}
  236. {$define cpurefshaveindexreg}
  237. {$define cpudelayslot}
  238. {$define SUPPORT_GET_FRAME}
  239. {$define SUPPORT_SAFECALL}
  240. {$endif mips}
  241. {$ifdef jvm}
  242. {$define cpu32bit}
  243. {$define cpu64bitalu}
  244. {$define cpu32bitaddr}
  245. {$define cpuhighleveltarget}
  246. {$define symansistr}
  247. {$define SUPPORT_GET_FRAME}
  248. {$endif}
  249. {$ifdef aarch64}
  250. {$define cpu64bit}
  251. {$define cpu64bitaddr}
  252. {$define cpu64bitalu}
  253. {$define cpuflags}
  254. {$define cpurox}
  255. {$define cputargethasfixedstack}
  256. {$define cpurefshaveindexreg}
  257. {$define SUPPORT_GET_FRAME}
  258. {$define SUPPORT_SAFECALL}
  259. {$endif aarch64}
  260. {$ifdef riscv32}
  261. {$define riscv}
  262. {$define cpu32bit}
  263. {$define cpu32bitaddr}
  264. {$define cpu32bitalu}
  265. {$define cpufpemu}
  266. {$define cputargethasfixedstack}
  267. {$define cpuneedsmulhelper}
  268. {$define cpuneedsdivhelper}
  269. {$define cpucapabilities}
  270. {$define cpurequiresproperalignment}
  271. {$endif riscv32}
  272. {$ifdef riscv64}
  273. {$define riscv}
  274. {$define cpu64bit}
  275. {$define cpu64bitaddr}
  276. {$define cpu64bitalu}
  277. {$define cpufpemu}
  278. {$define cputargethasfixedstack}
  279. {$define cpuneedsmulhelper}
  280. {$define cpuneedsdivhelper}
  281. {$define cpucapabilities}
  282. {$define cpurequiresproperalignment}
  283. {$endif riscv64}
  284. { Stabs is not officially supported on 64 bit targets by gdb, except on Mac OS X
  285. (but there we don't support it)
  286. }
  287. {$ifdef cpu64bitaddr}
  288. {$ifndef USE_STABS_64}
  289. {$define NoDbgStabs}
  290. {$endif}
  291. {$endif}
  292. {$if not defined(FPC_HAS_TYPE_EXTENDED) and defined(i386)}
  293. {$ifndef FPC_SOFT_FPUX80}
  294. {$error Cross-compiling from systems without support for an 80 bit extended floating point type to i386 is not yet supported at this time }
  295. {$endif}
  296. {$endif}
  297. { llvm backends partially use other backends for parameter info calculation,
  298. alignment info, data sizes etc. They always support 64 bit alu though.
  299. }
  300. {$ifdef llvm}
  301. {$undef SUPPORT_MMX}
  302. {$undef cpuneedsmulhelper}
  303. {$undef cpuneedsdivhelper}
  304. {$define cpuhighleveltarget}
  305. {$define cpucg64shiftsupport}
  306. {$define symansistr}
  307. {$endif}