cpuinfo.pas 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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_armv7m,
  30. cpu_cortexm3
  31. );
  32. Const
  33. cpu_arm = [cpu_none,cpu_armv3,cpu_armv4,cpu_armv5];
  34. cpu_thumb = [];
  35. cpu_thumb2 = [cpu_armv7m,cpu_cortexm3];
  36. Type
  37. tfputype =
  38. (fpu_none,
  39. fpu_soft,
  40. fpu_libgcc,
  41. fpu_fpa,
  42. fpu_fpa10,
  43. fpu_fpa11,
  44. fpu_vfpv2,
  45. fpu_vfpv3
  46. );
  47. tcontrollertype =
  48. (ct_none,
  49. { Phillips }
  50. ct_lpc2114,
  51. ct_lpc2124,
  52. ct_lpc2194,
  53. { ATMEL }
  54. ct_at91sam7s256,
  55. ct_at91sam7se256,
  56. ct_at91sam7x256,
  57. ct_at91sam7xc256,
  58. { STMicroelectronics }
  59. ct_stm32f103re,
  60. { TI }
  61. stellaris
  62. );
  63. Const
  64. {# Size of native extended floating point type }
  65. extended_size = 12;
  66. {# Size of a multimedia register }
  67. mmreg_size = 16;
  68. { target cpu string (used by compiler options) }
  69. target_cpu_string = 'arm';
  70. { calling conventions supported by the code generator }
  71. supported_calling_conventions : tproccalloptions = [
  72. pocall_internproc,
  73. pocall_safecall,
  74. pocall_stdcall,
  75. { same as stdcall only different name mangling }
  76. pocall_cdecl,
  77. { same as stdcall only different name mangling }
  78. pocall_cppdecl,
  79. { same as stdcall but floating point numbers are handled like equal sized integers }
  80. pocall_softfloat,
  81. { same as stdcall (requires that all const records are passed by
  82. reference, but that's already done for stdcall) }
  83. pocall_mwpascal,
  84. { used for interrupt handling }
  85. pocall_interrupt
  86. ];
  87. cputypestr : array[tcputype] of string[8] = ('',
  88. 'ARMV3',
  89. 'ARMV4',
  90. 'ARMV5',
  91. 'ARMV6',
  92. 'ARMV7M',
  93. 'CORTEXM3'
  94. );
  95. fputypestr : array[tfputype] of string[6] = ('',
  96. 'SOFT',
  97. 'LIBGCC',
  98. 'FPA',
  99. 'FPA10',
  100. 'FPA11',
  101. 'VFPV2',
  102. 'VFPV3'
  103. );
  104. controllertypestr : array[tcontrollertype] of string[20] =
  105. ('',
  106. 'LPC2114',
  107. 'LPC2124',
  108. 'LPC2194',
  109. 'AT91SAM7S256',
  110. 'AT91SAM7SE256',
  111. 'AT91SAM7X256',
  112. 'AT91SAM7XC256',
  113. 'STM32F103RE',
  114. 'STELLARIS'
  115. );
  116. controllerunitstr : array[tcontrollertype] of string[20] =
  117. ('',
  118. 'LPC21x4',
  119. 'LPC21x4',
  120. 'LPC21x4',
  121. 'AT91SAM7x256',
  122. 'AT91SAM7x256',
  123. 'AT91SAM7x256',
  124. 'AT91SAM7x256',
  125. 'STM32F103',
  126. 'STELLARIS'
  127. );
  128. interruptvectors : array[tcontrollertype] of longint =
  129. (0,
  130. 8,
  131. 8,
  132. 8,
  133. 8,
  134. 8,
  135. 8,
  136. 8,
  137. 12+59, { XL-density }
  138. 12 { No model specified }
  139. );
  140. vfp_scalar = [fpu_vfpv2,fpu_vfpv3];
  141. { Supported optimizations, only used for information }
  142. supported_optimizerswitches = genericlevel1optimizerswitches+
  143. genericlevel2optimizerswitches+
  144. genericlevel3optimizerswitches-
  145. { no need to write info about those }
  146. [cs_opt_level1,cs_opt_level2,cs_opt_level3]+
  147. [cs_opt_regvar,cs_opt_loopunroll,cs_opt_tailrecursion,
  148. cs_opt_stackframe,cs_opt_nodecse];
  149. level1optimizerswitches = genericlevel1optimizerswitches;
  150. level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
  151. [cs_opt_regvar,cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse];
  152. level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [{,cs_opt_loopunroll}];
  153. Implementation
  154. end.