fpcdefs.inc 8.4 KB

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