fpcdefs.inc 8.1 KB

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