fpcdefs.inc 7.1 KB

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