fpcdefs.inc 7.2 KB

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