fpcdefs.inc 7.0 KB

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