cpuinfo.pas 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {
  2. Copyright (c) 2008 by the Free Pascal development team
  3. Basic Processor information for the AVR
  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_avr
  26. );
  27. tfputype =
  28. (fpu_none,
  29. fpu_soft,
  30. fp_libgcc
  31. );
  32. tcontrollertype =
  33. (ct_none,
  34. ct_atmega16,
  35. ct_atmega32,
  36. ct_atmega48,
  37. ct_atmega64,
  38. ct_atmega128
  39. );
  40. Const
  41. {# Size of native extended floating point type }
  42. extended_size = 12;
  43. {# Size of a multimedia register }
  44. mmreg_size = 16;
  45. { target cpu string (used by compiler options) }
  46. target_cpu_string = 'avr';
  47. { calling conventions supported by the code generator }
  48. supported_calling_conventions : tproccalloptions = [
  49. pocall_internproc,
  50. pocall_safecall,
  51. pocall_stdcall,
  52. { same as stdcall only different name mangling }
  53. pocall_cdecl,
  54. { same as stdcall only different name mangling }
  55. pocall_cppdecl,
  56. { same as stdcall but floating point numbers are handled like equal sized integers }
  57. pocall_softfloat
  58. ];
  59. cputypestr : array[tcputype] of string[5] = ('',
  60. 'AVR'
  61. );
  62. fputypestr : array[tfputype] of string[6] = (
  63. 'NONE',
  64. 'SOFT',
  65. 'LIBGCC'
  66. );
  67. controllertypestr : array[tcontrollertype] of string[20] =
  68. ('',
  69. 'ATMEGA16',
  70. 'ATMEGA32',
  71. 'ATMEGA48',
  72. 'ATMEGA64',
  73. 'ATMEGA128'
  74. );
  75. controllerunitstr : array[tcontrollertype] of string[20] =
  76. ('',
  77. 'ATMEGA16',
  78. 'ATMEGA32',
  79. 'ATMEGA48',
  80. 'ATMEGA64',
  81. 'ATMEGA128'
  82. );
  83. { Supported optimizations, only used for information }
  84. supported_optimizerswitches = genericlevel1optimizerswitches+
  85. genericlevel2optimizerswitches+
  86. genericlevel3optimizerswitches-
  87. { no need to write info about those }
  88. [cs_opt_level1,cs_opt_level2,cs_opt_level3]+
  89. [cs_opt_regvar,cs_opt_loopunroll,cs_opt_tailrecursion,cs_opt_stackframe];
  90. level1optimizerswitches = genericlevel1optimizerswitches;
  91. level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches + [cs_opt_regvar,cs_opt_stackframe,cs_opt_tailrecursion];
  92. level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [{,cs_opt_loopunroll}];
  93. Implementation
  94. end.