fpcdefs.inc 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. { Inline small functions, but not when EXTDEBUG is used }
  19. {$ifndef EXTDEBUG}
  20. {$define USEINLINE}
  21. {$endif EXTDEBUG}
  22. {$define USEEXCEPT}
  23. { This fake CPU is used to allow incorporation of globtype unit
  24. into utils/ppudump without any CPU specific code PM }
  25. {$ifdef generic_cpu}
  26. {$define cpu32bit}
  27. {$define cpu32bitaddr}
  28. {$define cpu32bitalu}
  29. {$define cpuflags}
  30. {$define cpuextended}
  31. {$endif generic_cpu}
  32. {$ifdef cpuarm}
  33. {$packrecords c}
  34. {$endif cpuarm}
  35. {$ifdef i8086}
  36. {$define cpu16bit}
  37. {$define cpu16bitaddr}
  38. {$define cpu16bitalu}
  39. {$define x86}
  40. {$define cpuflags}
  41. {$define cpuextended}
  42. {//$define SUPPORT_MMX}
  43. {$define cpumm}
  44. {$define fewintregisters}
  45. {//$define cpurox}
  46. {$define cpurefshaveindexreg}
  47. {$define SUPPORT_SAFECALL}
  48. {$define cpuneedsmulhelper}
  49. { TODO: add another define in order to disable the div helper for 16-bit divs? }
  50. {$define cpuneedsdivhelper}
  51. {$define VOLATILE_ES}
  52. {$define SUPPORT_GET_FRAME}
  53. {$endif i8086}
  54. {$ifdef i386}
  55. {$define cpu32bit}
  56. {$define cpu32bitaddr}
  57. {$define cpu32bitalu}
  58. {$define x86}
  59. {$define cpuflags}
  60. {$define cpuextended}
  61. {$define SUPPORT_MMX}
  62. {$define cpumm}
  63. {$define fewintregisters}
  64. {$define cpurox}
  65. {$define cpurefshaveindexreg}
  66. {$define SUPPORT_SAFECALL}
  67. {$define SUPPORT_GET_FRAME}
  68. {$define cpucapabilities}
  69. {$endif i386}
  70. {$ifdef x86_64}
  71. {$define x86}
  72. {$define cpuflags}
  73. {$define cpu64bitalu}
  74. {$define cpu64bitaddr}
  75. {$define cpuextended}
  76. {$define cpufloat128}
  77. {$define cputargethasfixedstack}
  78. {$define cpumm}
  79. {$define cpurox}
  80. {$define cpurefshaveindexreg}
  81. {$define SUPPORT_SAFECALL}
  82. {$define SUPPORT_GET_FRAME}
  83. {$define cpucapabilities}
  84. {$endif x86_64}
  85. {$ifdef sparc}
  86. {$define cpu32bit}
  87. {$define cpu32bitaddr}
  88. {$define cpu32bitalu}
  89. {$define cpuflags}
  90. {$define cputargethasfixedstack}
  91. {$define cpurefshaveindexreg}
  92. {$define SUPPORT_SAFECALL}
  93. {$endif sparc}
  94. {$ifdef powerpc}
  95. {$define cpu32bit}
  96. {$define cpu32bitaddr}
  97. {$define cpu32bitalu}
  98. {$define cpuflags}
  99. {$define cputargethasfixedstack}
  100. {$define cpumm}
  101. {$define cpurox}
  102. {$define cpurefshaveindexreg}
  103. {$endif powerpc}
  104. {$ifdef powerpc64}
  105. {$define cpu64bitalu}
  106. {$define cpu64bitaddr}
  107. {$define cpuflags}
  108. {$define cputargethasfixedstack}
  109. {$define cpumm}
  110. {$define cpurox}
  111. {$define cpurefshaveindexreg}
  112. {$define cpuno32bitops}
  113. {$endif powerpc64}
  114. {$ifdef arm}
  115. {$define cpu32bit}
  116. {$define cpu32bitaddr}
  117. {$define cpu32bitalu}
  118. {$define cpuflags}
  119. {$define cpufpemu}
  120. {$define cpuneedsdivhelper}
  121. {$define cpurox}
  122. {$define cputargethasfixedstack}
  123. {$define cpurefshaveindexreg}
  124. {$define cpucapabilities}
  125. {$define SUPPORT_SAFECALL}
  126. {$define SUPPORT_GET_FRAME}
  127. { default to armel }
  128. {$if not(defined(CPUARM)) and not(defined(CPUARMEB)) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  129. {$define FPC_ARMEL}
  130. {$endif}
  131. { inherit FPC_ARMEL? }
  132. {$if defined(CPUARMEL) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
  133. {$define FPC_ARMEL}
  134. {$endif}
  135. { inherit FPC_ARMEB? }
  136. {$if defined(CPUARMEB) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMHF))}
  137. {$define FPC_ARMEB}
  138. {$endif}
  139. { inherit FPC_ARMHF? }
  140. {$if defined(CPUARMHF) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEL)) and not(defined(FPC_ARMEB))}
  141. {$define FPC_ARMHF}
  142. {$endif}
  143. {$endif arm}
  144. {$ifdef m68k}
  145. {$define cpu32bit}
  146. {$define cpu32bitaddr}
  147. {$define cpu32bitalu}
  148. {$define cpuflags}
  149. {$define cpufpemu}
  150. {$define cpurefshaveindexreg}
  151. {$define cpucapabilities}
  152. {$define cpuneedsdivhelper}
  153. {$endif m68k}
  154. {$ifdef avr}
  155. {$define cpu8bit}
  156. {$define cpu16bitaddr}
  157. {$define cpu8bitalu}
  158. {$define cpuflags}
  159. {$define cpunofpu}
  160. {$define cpunodefaultint}
  161. {$define cpuneedsdivhelper}
  162. {$define cpuneedsmulhelper}
  163. {$define cpurefshaveindexreg}
  164. {$define cpucapabilities}
  165. {$endif avr}
  166. {$ifdef mipsel}
  167. {$define mips}
  168. {$else not mipsel}
  169. { Define both mips and mipseb if mipsel is not defined
  170. but mips cpu is wanted. }
  171. {$ifdef mipseb}
  172. {$define mips}
  173. {$endif mipseb}
  174. {$ifdef mips}
  175. {$define mipseb}
  176. {$endif mips}
  177. {$endif mipsel}
  178. {$ifdef mips}
  179. {$ifndef mips64}
  180. {$define cpu32bit}
  181. {$define cpu32bitalu}
  182. {$define cpu32bitaddr}
  183. {$else}
  184. {$error mips64 not yet supported}
  185. {$endif}
  186. {$define cpuflags} { Flags are emulated }
  187. {$define cputargethasfixedstack}
  188. {$define cpurequiresproperalignment}
  189. { define cpumm}
  190. {$define cpurefshaveindexreg}
  191. {$define SUPPORT_GET_FRAME}
  192. {$define SUPPORT_SAFECALL}
  193. {$endif mips}
  194. {$ifdef spc32}
  195. {$define cpu32bit}
  196. {$define cpu32bitalu}
  197. {$define cpu32bitaddr}
  198. {$define cpuflags}
  199. {$define cputargethasfixedstack}
  200. {$define cpurequiresproperalignment}
  201. {$define cpufpemu}
  202. {$define cpuneedsdiv32helper}
  203. {$define cpuneedsmulhelper}
  204. {$define cpucapabilities}
  205. { define cpumm}
  206. {$endif mips}
  207. {$ifdef jvm}
  208. {$define cpu32bit}
  209. {$define cpu64bitalu}
  210. {$define cpu32bitaddr}
  211. {$define cpuhighleveltarget}
  212. {$define symansistr}
  213. {$define SUPPORT_GET_FRAME}
  214. {$endif}
  215. {$ifdef aarch64}
  216. {$define cpu64bit}
  217. {$define cpu64bitaddr}
  218. {$define cpu64bitalu}
  219. {$define cpuflags}
  220. {$define cpurox}
  221. {$define cputargethasfixedstack}
  222. {$define cpurefshaveindexreg}
  223. {$define SUPPORT_GET_FRAME}
  224. {$endif aarch64}
  225. {$IFDEF MACOS}
  226. {$DEFINE USE_FAKE_SYSUTILS}
  227. {$ENDIF MACOS}
  228. { Stabs is not officially supported on 64 bit targets by gdb, except on Mac OS X
  229. (but there we don't support it)
  230. }
  231. {$ifdef cpu64bitaddr}
  232. {$ifndef USE_STABS_64}
  233. {$define NoDbgStabs}
  234. {$endif}
  235. {$endif}
  236. {$if not defined(FPC_HAS_TYPE_EXTENDED) and defined(i386)}
  237. {$error Cross-compiling from systems without support for an 80 bit extended floating point type to i386 is not yet supported at this time }
  238. {$endif}
  239. { llvm backends partially use other backends for parameter info calculation,
  240. alignment info, data sizes etc. They always support 64 bit alu though.
  241. }
  242. {$ifdef llvm}
  243. {$undef SUPPORT_MMX}
  244. {$undef cpu16bitalu}
  245. {$undef cpu32bitalu}
  246. {$define cpu64bitalu}
  247. {$define cpuhighleveltarget}
  248. {$define symansistr}
  249. {$endif}