cpubase.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl and Peter Vreman
  4. Contains the base types for the ARM
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. {# Base unit for processor information. This unit contains
  19. enumerations of registers, opcodes, sizes, and other
  20. such things which are processor specific.
  21. }
  22. unit cpubase;
  23. {$i fpcdefs.inc}
  24. interface
  25. uses
  26. cutils,cclasses,
  27. globtype,globals,
  28. cpuinfo,
  29. aasmbase,
  30. cginfo
  31. {$ifdef delphi}
  32. ,dmisc
  33. {$endif}
  34. ;
  35. {*****************************************************************************
  36. Assembler Opcodes
  37. *****************************************************************************}
  38. type
  39. TAsmOp=(A_None,A_ADC,A_ADD,A_AND,A_N,A_BIC,A_BKPT,A_B,A_BL,A_BLX,A_BX,
  40. A_CDP,A_CDP2,A_CLZ,A_CMN,A_CMP,A_EOR,A_LDC,_A_LDC2,
  41. A_LDM,A_LDR,A_LDRB,A_LDRD,A_LDRBT,A_LDRH,A_LDRSB,
  42. A_LDRSH,A_LDRT,A_MCR,A_MCR2,A_MCRR,A_MLA,A_MOV,
  43. A_MRC,A_MRC2,A_MRRC,A_RS,A_MSR,A_MUL,A_MVN,
  44. A_ORR,A_PLD,A_QADD,A_QDADD,A_QDSUB,A_QSUB,A_RSB,A_RSC,
  45. A_SBC,A_SMLAL,A_SMULL,A_SMUL,
  46. A_SMULW,A_STC,A_STC2,A_STM,A_STR,A_STRB,A_STRBT,A_STRD,
  47. A_STRH,A_STRT,A_SUB,A_SWI,A_SWP,A_SWPB,A_TEQ,A_TST,
  48. A_UMLAL,A_UMULL,
  49. { FPA coprocessor instructions }
  50. A_LDF,A_STF,A_LFM,A_SFM,A_FLT,A_FIX,A_WFS,A_RFS,A_RFC,
  51. A_ADF,A_DVF,A_FDV,A_FML,A_FRD,A_MUF,A_POL,A_PW,A_RDF,
  52. A_RMF,A_RPW,A_RSF,A_SUF,A_ABS,A_ACS,A_ASN,A_ATN,A_COS,
  53. A_EXP,A_LOG,A_LGN,A_MVF,A_MNF,A_NRM,A_RND,A_SIN,A_SQT,A_TAN,A_URD,
  54. A_CMF,A_CNF
  55. { VPA coprocessor codes }
  56. );
  57. { This should define the array of instructions as string }
  58. op2strtable=array[tasmop] of string[11];
  59. const
  60. { First value of opcode enumeration }
  61. firstop = low(tasmop);
  62. { Last value of opcode enumeration }
  63. lastop = high(tasmop);
  64. {*****************************************************************************
  65. Registers
  66. *****************************************************************************}
  67. type
  68. { Number of registers used for indexing in tables }
  69. tregisterindex=0..{$i rarmnor.inc}-1;
  70. const
  71. { Super registers: }
  72. RS_NONE=$00;
  73. RS_R0 = $01; RS_R1 = $02; RS_R2 = $03;
  74. RS_R3 = $04; RS_R4 = $05; RS_R5 = $06;
  75. RS_R6 = $07; RS_R7 = $08; RS_R8 = $09;
  76. RS_R9 = $0A; RS_R10 = $0B; RS_R11 = $0C;
  77. RS_R12 = $0D; RS_R13 = $0E; RS_R14 = $0F;
  78. RS_R15 = $10;
  79. RS_PC = RS_R15;
  80. RS_F0=$00;
  81. RS_F1=$01;
  82. RS_F2=$02;
  83. RS_F3=$03;
  84. RS_F4=$04;
  85. RS_F5=$05;
  86. RS_F6=$06;
  87. RS_F7=$07;
  88. RS_D0 = $01; RS_D1 = $02; RS_D2 = $03;
  89. RS_D3 = $04; RS_D4 = $05; RS_D5 = $06;
  90. RS_D6 = $07; RS_D7 = $08; RS_D8 = $09;
  91. RS_D9 = $0A; RS_D10 = $0B; RS_D11 = $0C;
  92. RS_D12 = $0D; RS_D13 = $0E; RS_D14 = $0F;
  93. RS_D15 = $10;
  94. { No Subregisters }
  95. R_SUBWHOLE = R_SUBNONE;
  96. { Available Registers }
  97. {$i rarmcon.inc}
  98. { aliases }
  99. NR_PC = NR_R15;
  100. { Integer Super registers first and last }
  101. {$warning Supreg shall be $00-$1f}
  102. first_int_supreg = RS_R3;
  103. last_int_supreg = RS_R15;
  104. first_int_imreg = $20;
  105. last_int_imreg = $fe;
  106. { Float Super register first and last }
  107. first_fpu_supreg = $00;
  108. last_fpu_supreg = $07;
  109. first_fpu_imreg = $20;
  110. last_fpu_imreg = $fe;
  111. { MM Super register first and last }
  112. first_mmx_supreg = RS_INVALID;
  113. last_mmx_supreg = RS_INVALID;
  114. first_mmx_imreg = RS_INVALID;
  115. last_mmx_imreg = RS_INVALID;
  116. {$warning TODO Calculate bsstart}
  117. regnumber_count_bsstart = 64;
  118. regnumber_table : array[tregisterindex] of tregister = (
  119. {$i rarmnum.inc}
  120. );
  121. regstabs_table : array[tregisterindex] of tregister = (
  122. {$i rarmsta.inc}
  123. );
  124. { registers which may be destroyed by calls }
  125. VOLATILE_INTREGISTERS = [RS_R0..RS_R3,RS_R12..RS_R15];
  126. VOLATILE_FPUREGISTERS = [RS_F0..RS_F3];
  127. type
  128. totherregisterset = set of tregisterindex;
  129. {*****************************************************************************
  130. Instruction post fixes
  131. *****************************************************************************}
  132. type
  133. { ARM instructions load/store and arithmetic instructions
  134. can have several instruction post fixes which are collected
  135. in this enumeration
  136. }
  137. TOpPostfix = (PF_None,
  138. { update condition flags
  139. or floating point single }
  140. PF_S,
  141. { floating point size }
  142. PF_D,PF_E,PF_P,FP_EP,
  143. { load/store }
  144. PF_B,PF_SB,PF_BT,PF_H,PF_SH,PF_T,
  145. { multiple load/store address modes }
  146. PF_IA,PF_IB,PF_DA,PF_DB,PF_FD,PF_FA,PF_ED,PF_EA
  147. );
  148. TRoundingMode = (RM_None,RM_P,RM_M,RM_Z);
  149. const
  150. cgsize2fpuoppostfix : array[OS_NO..OS_F128] of toppostfix = (
  151. PF_E,
  152. PF_None,PF_None,PF_None,PF_None,PF_None,PF_None,PF_None,PF_None,
  153. PF_S,PF_D,PF_E,PF_None,PF_None);
  154. oppostfix2str : array[TOpPostfix] of string[2] = ('',
  155. 's',
  156. 'd','e','p','ep',
  157. 'b','sb','bt','h','sh','t',
  158. 'ia','ib','da','db','fd','fa','ed','ea');
  159. roundingmode2str : array[TRoundingMode] of string[1] = ('',
  160. 'p','m','z');
  161. {*****************************************************************************
  162. Conditions
  163. *****************************************************************************}
  164. type
  165. TAsmCond=(C_None,
  166. C_EQ,C_NE,C_CS,C_CC,C_MI,C_PL,C_VS,C_VC,C_HI,C_LS,
  167. C_GE,C_LT,C_GT,C_LE,C_AL,C_NV
  168. );
  169. const
  170. cond2str : array[TAsmCond] of string[2]=('',
  171. 'eq','ne','cs','cc','mi','pl','vs','vc','hi','ls',
  172. 'ge','lt','gt','le','al','nv'
  173. );
  174. inverse_cond : array[TAsmCond] of TAsmCond=(C_None,
  175. C_NE,C_EQ,C_CC,C_CS,C_PL,C_MI,C_VC,C_VS,C_LS,C_HI,
  176. C_LT,C_GE,C_LE,C_GT,C_None,C_None
  177. );
  178. {*****************************************************************************
  179. Flags
  180. *****************************************************************************}
  181. type
  182. TResFlags = (F_EQ,F_NE,F_CS,F_CC,F_MI,F_PL,F_VS,F_VC,F_HI,F_LS,
  183. F_GE,F_LT,F_GT,F_LE);
  184. {*****************************************************************************
  185. Reference
  186. *****************************************************************************}
  187. type
  188. trefoptions=(ref_none,ref_parafixup,ref_localfixup,ref_selffixup);
  189. taddressmode = (AM_OFFSET,AM_PREINDEXED,AM_POSTINDEXED);
  190. tshiftmode = (SM_None,SM_LSL,SM_LSR,SM_ASR,SM_ROR,SM_RRX);
  191. { reference record }
  192. preference = ^treference;
  193. treference = packed record
  194. base,
  195. index : tregister;
  196. shiftimm : byte;
  197. signindex : shortint;
  198. offset : longint;
  199. symbol : tasmsymbol;
  200. offsetfixup : longint;
  201. options : trefoptions;
  202. addressmode : taddressmode;
  203. shiftmode : tshiftmode;
  204. end;
  205. { reference record }
  206. pparareference = ^tparareference;
  207. tparareference = packed record
  208. index : tregister;
  209. offset : longint;
  210. end;
  211. {*****************************************************************************
  212. Operands
  213. *****************************************************************************}
  214. { Types of operand }
  215. toptype=(top_none,top_reg,top_ref,top_const,top_symbol,top_regset,top_shifterop);
  216. tupdatereg = (UR_None,UR_Update);
  217. pshifterop = ^tshifterop;
  218. tshifterop = record
  219. shiftmode : tshiftmode;
  220. rs : tregister;
  221. shiftimm : byte;
  222. end;
  223. toper = record
  224. case typ : toptype of
  225. top_none : ();
  226. top_reg : (reg:tregister;update:tupdatereg);
  227. top_ref : (ref:preference);
  228. top_const : (val:aword);
  229. top_symbol : (sym:tasmsymbol;symofs:longint);
  230. top_regset : (regset:tsuperregisterset);
  231. top_shifterop : (shifterop : pshifterop);
  232. end;
  233. {*****************************************************************************
  234. Generic Location
  235. *****************************************************************************}
  236. type
  237. { tparamlocation describes where a parameter for a procedure is stored.
  238. References are given from the caller's point of view. The usual
  239. TLocation isn't used, because contains a lot of unnessary fields.
  240. }
  241. tparalocation = packed record
  242. size : TCGSize;
  243. loc : TCGLoc;
  244. sp_fixup : longint;
  245. case TCGLoc of
  246. LOC_REFERENCE : (reference : tparareference);
  247. { segment in reference at the same place as in loc_register }
  248. LOC_REGISTER,LOC_CREGISTER : (
  249. case longint of
  250. 1 : (register,registerhigh : tregister);
  251. { overlay a registerlow }
  252. 2 : (registerlow : tregister);
  253. { overlay a 64 Bit register type }
  254. 3 : (reg64 : tregister64);
  255. 4 : (register64 : tregister64);
  256. );
  257. { it's only for better handling }
  258. LOC_MMXREGISTER,LOC_CMMXREGISTER : (mmxreg : tregister);
  259. end;
  260. tlocation = packed record
  261. loc : TCGLoc;
  262. size : TCGSize;
  263. case TCGLoc of
  264. LOC_FLAGS : (resflags : tresflags);
  265. LOC_CONSTANT : (
  266. case longint of
  267. 1 : (value : AWord);
  268. { can't do this, this layout depends on the host cpu. Use }
  269. { lo(valueqword)/hi(valueqword) instead (JM) }
  270. { 2 : (valuelow, valuehigh:AWord); }
  271. { overlay a complete 64 Bit value }
  272. 3 : (valueqword : qword);
  273. );
  274. LOC_CREFERENCE,
  275. LOC_REFERENCE : (reference : treference);
  276. { segment in reference at the same place as in loc_register }
  277. LOC_REGISTER,LOC_CREGISTER : (
  278. case longint of
  279. 1 : (register,registerhigh,segment : tregister);
  280. { overlay a registerlow }
  281. 2 : (registerlow : tregister);
  282. { overlay a 64 Bit register type }
  283. 3 : (reg64 : tregister64);
  284. 4 : (register64 : tregister64);
  285. );
  286. { it's only for better handling }
  287. LOC_MMXREGISTER,LOC_CMMXREGISTER : (mmxreg : tregister);
  288. end;
  289. {*****************************************************************************
  290. Constants
  291. *****************************************************************************}
  292. const
  293. { declare aliases }
  294. LOC_MMREGISTER = LOC_SSEREGISTER;
  295. LOC_CMMREGISTER = LOC_CSSEREGISTER;
  296. max_operands = 3;
  297. {# Constant defining possibly all registers which might require saving }
  298. ALL_OTHERREGISTERS = [];
  299. general_superregisters = [RS_R0..RS_PC];
  300. {# Table of registers which can be allocated by the code generator
  301. internally, when generating the code.
  302. }
  303. { legend: }
  304. { xxxregs = set of all possibly used registers of that type in the code }
  305. { generator }
  306. { usableregsxxx = set of all 32bit components of registers that can be }
  307. { possible allocated to a regvar or using getregisterxxx (this }
  308. { excludes registers which can be only used for parameter }
  309. { passing on ABI's that define this) }
  310. { c_countusableregsxxx = amount of registers in the usableregsxxx set }
  311. maxintregs = 15;
  312. { to determine how many registers to use for regvars }
  313. maxintscratchregs = 3;
  314. usableregsint = [RS_R4..RS_R10];
  315. c_countusableregsint = 7;
  316. maxfpuregs = 8;
  317. fpuregs = [RS_F0..RS_F7];
  318. usableregsfpu = [RS_F4..RS_F7];
  319. c_countusableregsfpu = 4;
  320. mmregs = [RS_D0..RS_D15];
  321. usableregsmm = [RS_D8..RS_D15];
  322. c_countusableregsmm = 8;
  323. maxaddrregs = 0;
  324. addrregs = [];
  325. usableregsaddr = [];
  326. c_countusableregsaddr = 0;
  327. {*****************************************************************************
  328. Operand Sizes
  329. *****************************************************************************}
  330. type
  331. topsize = (S_NO,
  332. S_B,S_W,S_L,S_BW,S_BL,S_WL,
  333. S_IS,S_IL,S_IQ,
  334. S_FS,S_FL,S_FX,S_D,S_Q,S_FV,S_FXX
  335. );
  336. {*****************************************************************************
  337. Constants
  338. *****************************************************************************}
  339. const
  340. firstsaveintreg = RS_R4;
  341. lastsaveintreg = RS_R10;
  342. firstsavefpureg = RS_F4;
  343. lastsavefpureg = RS_F7;
  344. firstsavemmreg = RS_D8;
  345. lastsavemmreg = RS_D15;
  346. maxvarregs = 7;
  347. varregs : Array [1..maxvarregs] of tsuperregister =
  348. (RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,RS_R9,RS_R10);
  349. maxfpuvarregs = 4;
  350. fpuvarregs : Array [1..maxfpuvarregs] of tsuperregister =
  351. (RS_F4,RS_F5,RS_F6,RS_F7);
  352. {*****************************************************************************
  353. Default generic sizes
  354. *****************************************************************************}
  355. { Defines the default address size for a processor, }
  356. OS_ADDR = OS_32;
  357. { the natural int size for a processor, }
  358. OS_INT = OS_32;
  359. { the maximum float size for a processor, }
  360. OS_FLOAT = OS_F64;
  361. { the size of a vector register for a processor }
  362. OS_VECTOR = OS_M32;
  363. {*****************************************************************************
  364. Generic Register names
  365. *****************************************************************************}
  366. { Stack pointer register }
  367. NR_STACK_POINTER_REG = NR_R13;
  368. RS_STACK_POINTER_REG = RS_R13;
  369. { Frame pointer register }
  370. RS_FRAME_POINTER_REG = RS_R11;
  371. NR_FRAME_POINTER_REG = NR_R11;
  372. { Register for addressing absolute data in a position independant way,
  373. such as in PIC code. The exact meaning is ABI specific. For
  374. further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
  375. }
  376. NR_PIC_OFFSET_REG = NR_R9;
  377. { Results are returned in this register (32-bit values) }
  378. NR_FUNCTION_RETURN_REG = NR_R0;
  379. RS_FUNCTION_RETURN_REG = RS_R0;
  380. { Low part of 64bit return value }
  381. NR_FUNCTION_RETURN64_LOW_REG = NR_R0;
  382. RS_FUNCTION_RETURN64_LOW_REG = RS_R0;
  383. { High part of 64bit return value }
  384. NR_FUNCTION_RETURN64_HIGH_REG = NR_R1;
  385. RS_FUNCTION_RETURN64_HIGH_REG = RS_R1;
  386. { The value returned from a function is available in this register }
  387. NR_FUNCTION_RESULT_REG = NR_FUNCTION_RETURN_REG;
  388. RS_FUNCTION_RESULT_REG = RS_FUNCTION_RETURN_REG;
  389. { The lowh part of 64bit value returned from a function }
  390. NR_FUNCTION_RESULT64_LOW_REG = NR_FUNCTION_RETURN64_LOW_REG;
  391. RS_FUNCTION_RESULT64_LOW_REG = RS_FUNCTION_RETURN64_LOW_REG;
  392. { The high part of 64bit value returned from a function }
  393. NR_FUNCTION_RESULT64_HIGH_REG = NR_FUNCTION_RETURN64_HIGH_REG;
  394. RS_FUNCTION_RESULT64_HIGH_REG = RS_FUNCTION_RETURN64_HIGH_REG;
  395. NR_FPU_RESULT_REG = NR_F0;
  396. NR_MM_RESULT_REG = NR_NO;
  397. { Offset where the parent framepointer is pushed }
  398. PARENT_FRAMEPOINTER_OFFSET = 0;
  399. {*****************************************************************************
  400. GCC /ABI linking information
  401. *****************************************************************************}
  402. const
  403. { Registers which must be saved when calling a routine declared as
  404. cppdecl, cdecl, stdcall, safecall, palmossyscall. The registers
  405. saved should be the ones as defined in the target ABI and / or GCC.
  406. This value can be deduced from the CALLED_USED_REGISTERS array in the
  407. GCC source.
  408. }
  409. std_saved_registers = [RS_R4..RS_R10];
  410. { Required parameter alignment when calling a routine declared as
  411. stdcall and cdecl. The alignment value should be the one defined
  412. by GCC or the target ABI.
  413. The value of this constant is equal to the constant
  414. PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
  415. }
  416. std_param_align = 4;
  417. {*****************************************************************************
  418. Helpers
  419. *****************************************************************************}
  420. function cgsize2subreg(s:Tcgsize):Tsubregister;
  421. function is_calljmp(o:tasmop):boolean;
  422. procedure inverse_flags(var f: TResFlags);
  423. function flags_to_cond(const f: TResFlags) : TAsmCond;
  424. function findreg_by_number(r:Tregister):tregisterindex;
  425. function findreg_by_stdname(const s:string):byte;
  426. function std_regnum_search(const s:string):Tregister;
  427. function std_regname(r:Tregister):string;
  428. procedure shifterop_reset(var so : tshifterop);
  429. function is_pc(const r : tregister) : boolean;
  430. implementation
  431. uses
  432. verbose;
  433. const
  434. std_regname_table : array[tregisterindex] of string[7] = (
  435. {$i rarmstd.inc}
  436. );
  437. regnumber_index : array[tregisterindex] of tregisterindex = (
  438. {$i rarmrni.inc}
  439. );
  440. std_regname_index : array[tregisterindex] of tregisterindex = (
  441. {$i rarmsri.inc}
  442. );
  443. function cgsize2subreg(s:Tcgsize):Tsubregister;
  444. begin
  445. end;
  446. function is_calljmp(o:tasmop):boolean;
  447. begin
  448. { This isn't 100% perfect because the arm allows jumps also by writing to PC=R15.
  449. To overcome this problem we simply forbid that FPC generates jumps by loading R15 }
  450. is_calljmp:= o in [A_B,A_BL,A_BX,A_BLX];
  451. end;
  452. procedure inverse_flags(var f: TResFlags);
  453. begin
  454. end;
  455. function flags_to_cond(const f: TResFlags) : TAsmCond;
  456. const
  457. flag_2_cond: array[F_EQ..F_LE] of TAsmCond =
  458. (C_EQ,C_NE,C_CS,C_CC,C_MI,C_PL,C_VS,C_VC,C_HI,C_LS,
  459. C_GE,C_LT,C_GT,C_LE);
  460. begin
  461. if f>high(flag_2_cond) then
  462. internalerror(200112301);
  463. result:=flag_2_cond[f];
  464. end;
  465. function findreg_by_stdname(const s:string):byte;
  466. var
  467. i,p : tregisterindex;
  468. begin
  469. {Binary search.}
  470. p:=0;
  471. i:=regnumber_count_bsstart;
  472. repeat
  473. if (p+i<=high(tregisterindex)) and (std_regname_table[std_regname_index[p+i]]<=s) then
  474. p:=p+i;
  475. i:=i shr 1;
  476. until i=0;
  477. if std_regname_table[std_regname_index[p]]=s then
  478. result:=std_regname_index[p]
  479. else
  480. result:=0;
  481. end;
  482. function findreg_by_number(r:Tregister):tregisterindex;
  483. var
  484. i,p : tregisterindex;
  485. begin
  486. {Binary search.}
  487. p:=0;
  488. i:=regnumber_count_bsstart;
  489. repeat
  490. if (p+i<=high(tregisterindex)) and (regnumber_table[regnumber_index[p+i]]<=r) then
  491. p:=p+i;
  492. i:=i shr 1;
  493. until i=0;
  494. if regnumber_table[regnumber_index[p]]=r then
  495. result:=regnumber_index[p]
  496. else
  497. result:=0;
  498. end;
  499. function std_regnum_search(const s:string):Tregister;
  500. begin
  501. result:=regnumber_table[findreg_by_stdname(s)];
  502. end;
  503. function std_regname(r:Tregister):string;
  504. var
  505. p : tregisterindex;
  506. begin
  507. p:=findreg_by_number(r);
  508. if p<>0 then
  509. result:=std_regname_table[p]
  510. else
  511. result:=generic_regname(r);
  512. end;
  513. procedure shifterop_reset(var so : tshifterop);
  514. begin
  515. FillChar(so,sizeof(so),0);
  516. end;
  517. function is_pc(const r : tregister) : boolean;
  518. begin
  519. is_pc:=(r=NR_R15);
  520. end;
  521. end.
  522. {
  523. $Log$
  524. Revision 1.13 2003-09-04 21:07:03 florian
  525. * ARM compiler compiles again
  526. Revision 1.12 2003/09/04 00:15:29 florian
  527. * first bunch of adaptions of arm compiler for new register type
  528. Revision 1.11 2003/09/03 19:10:30 florian
  529. * initial revision of new register naming
  530. Revision 1.10 2003/09/01 15:11:16 florian
  531. * fixed reference handling
  532. * fixed operand postfix for floating point instructions
  533. * fixed wrong shifter constant handling
  534. Revision 1.9 2003/08/29 21:36:28 florian
  535. * fixed procedure entry/exit code
  536. * started to fix reference handling
  537. Revision 1.8 2003/08/28 00:05:29 florian
  538. * today's arm patches
  539. Revision 1.7 2003/08/25 23:20:38 florian
  540. + started to implement FPU support for the ARM
  541. * fixed a lot of other things
  542. Revision 1.6 2003/08/24 12:27:26 florian
  543. * continued to work on the arm port
  544. Revision 1.5 2003/08/21 03:14:00 florian
  545. * arm compiler can be compiled; far from being working
  546. Revision 1.4 2003/08/20 15:50:13 florian
  547. * more arm stuff
  548. Revision 1.3 2003/08/16 13:23:01 florian
  549. * several arm related stuff fixed
  550. Revision 1.2 2003/07/26 00:55:57 florian
  551. * basic stuff fixed
  552. Revision 1.1 2003/07/21 16:35:30 florian
  553. * very basic stuff for the arm
  554. }