fpcdefs.inc 7.5 KB

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