cpuinfo.pas 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. {
  2. Copyright (c) 1998-2002 by the Free Pascal development team
  3. Basic Processor information for the ARM
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************}
  10. Unit CPUInfo;
  11. Interface
  12. uses
  13. globtype;
  14. Type
  15. bestreal = double;
  16. ts32real = single;
  17. ts64real = double;
  18. ts80real = type extended;
  19. ts128real = type extended;
  20. ts64comp = comp;
  21. pbestreal=^bestreal;
  22. { possible supported processors for this target }
  23. tcputype =
  24. (cpu_none,
  25. cpu_armv3,
  26. cpu_armv4,
  27. cpu_armv5,
  28. cpu_armv6,
  29. cpu_armv7,
  30. cpu_armv7m,
  31. cpu_cortexm3
  32. );
  33. Const
  34. cpu_arm = [cpu_none,cpu_armv3,cpu_armv4,cpu_armv5];
  35. cpu_thumb = [];
  36. cpu_thumb2 = [cpu_armv7m,cpu_cortexm3];
  37. Type
  38. tfputype =
  39. (fpu_none,
  40. fpu_soft,
  41. fpu_libgcc,
  42. fpu_fpa,
  43. fpu_fpa10,
  44. fpu_fpa11,
  45. fpu_vfpv2,
  46. fpu_vfpv3
  47. );
  48. tcontrollertype =
  49. (ct_none,
  50. { Phillips }
  51. ct_lpc2114,
  52. ct_lpc2124,
  53. ct_lpc2194,
  54. { ATMEL }
  55. ct_at91sam7s256,
  56. ct_at91sam7se256,
  57. ct_at91sam7x256,
  58. ct_at91sam7xc256,
  59. { STMicroelectronics }
  60. ct_stm32f103re,
  61. { TI }
  62. stellaris
  63. );
  64. Const
  65. {# Size of native extended floating point type }
  66. extended_size = 12;
  67. {# Size of a multimedia register }
  68. mmreg_size = 16;
  69. { target cpu string (used by compiler options) }
  70. target_cpu_string = 'arm';
  71. { calling conventions supported by the code generator }
  72. supported_calling_conventions : tproccalloptions = [
  73. pocall_internproc,
  74. pocall_safecall,
  75. pocall_stdcall,
  76. { same as stdcall only different name mangling }
  77. pocall_cdecl,
  78. { same as stdcall only different name mangling }
  79. pocall_cppdecl,
  80. { same as stdcall but floating point numbers are handled like equal sized integers }
  81. pocall_softfloat,
  82. { same as stdcall (requires that all const records are passed by
  83. reference, but that's already done for stdcall) }
  84. pocall_mwpascal,
  85. { used for interrupt handling }
  86. pocall_interrupt
  87. ];
  88. cputypestr : array[tcputype] of string[8] = ('',
  89. 'ARMV3',
  90. 'ARMV4',
  91. 'ARMV5',
  92. 'ARMV6',
  93. 'ARMV7',
  94. 'ARMV7M',
  95. 'CORTEXM3'
  96. );
  97. fputypestr : array[tfputype] of string[6] = ('',
  98. 'SOFT',
  99. 'LIBGCC',
  100. 'FPA',
  101. 'FPA10',
  102. 'FPA11',
  103. 'VFPV2',
  104. 'VFPV3'
  105. );
  106. controllertypestr : array[tcontrollertype] of string[20] =
  107. ('',
  108. 'LPC2114',
  109. 'LPC2124',
  110. 'LPC2194',
  111. 'AT91SAM7S256',
  112. 'AT91SAM7SE256',
  113. 'AT91SAM7X256',
  114. 'AT91SAM7XC256',
  115. 'STM32F103RE',
  116. 'STELLARIS'
  117. );
  118. controllerunitstr : array[tcontrollertype] of string[20] =
  119. ('',
  120. 'LPC21x4',
  121. 'LPC21x4',
  122. 'LPC21x4',
  123. 'AT91SAM7x256',
  124. 'AT91SAM7x256',
  125. 'AT91SAM7x256',
  126. 'AT91SAM7x256',
  127. 'STM32F103',
  128. 'STELLARIS'
  129. );
  130. interruptvectors : array[tcontrollertype] of longint =
  131. (0,
  132. 8,
  133. 8,
  134. 8,
  135. 8,
  136. 8,
  137. 8,
  138. 8,
  139. 12+59, { XL-density }
  140. 12 { No model specified }
  141. );
  142. vfp_scalar = [fpu_vfpv2,fpu_vfpv3];
  143. { Supported optimizations, only used for information }
  144. supported_optimizerswitches = genericlevel1optimizerswitches+
  145. genericlevel2optimizerswitches+
  146. genericlevel3optimizerswitches-
  147. { no need to write info about those }
  148. [cs_opt_level1,cs_opt_level2,cs_opt_level3]+
  149. [cs_opt_regvar,cs_opt_loopunroll,cs_opt_tailrecursion,
  150. cs_opt_stackframe,cs_opt_nodecse];
  151. level1optimizerswitches = genericlevel1optimizerswitches;
  152. level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
  153. [cs_opt_regvar,cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse];
  154. level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [{,cs_opt_loopunroll}];
  155. Implementation
  156. end.