fpcdefs.inc 7.2 KB

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