mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-03 07:18:47 +02:00
* patch by Christo Crause: fix register search on xtensa, resolves #37121
git-svn-id: trunk@45467 -
This commit is contained in:
parent
bc1b1e5d1f
commit
e76f9e5b36
@ -87,9 +87,6 @@ unit cpubase;
|
||||
{ firs flag imaginary register }
|
||||
first_flag_imreg = $10;
|
||||
|
||||
{ TODO: Calculate bsstart}
|
||||
regnumber_count_bsstart = 16;
|
||||
|
||||
regnumber_table : array[tregisterindex] of tregister = (
|
||||
{$i rxtensanum.inc}
|
||||
);
|
||||
|
@ -54,28 +54,9 @@ implementation
|
||||
{$i rxtensasri.inc}
|
||||
);
|
||||
|
||||
function findreg_by_gasname(const s:string):tregisterindex;
|
||||
var
|
||||
i,p : tregisterindex;
|
||||
begin
|
||||
{Binary search.}
|
||||
p:=0;
|
||||
i:=regnumber_count_bsstart;
|
||||
repeat
|
||||
if (p+i<=high(tregisterindex)) and (gas_regname_table[gas_regname_index[p+i]]<=s) then
|
||||
p:=p+i;
|
||||
i:=i shr 1;
|
||||
until i=0;
|
||||
if gas_regname_table[gas_regname_index[p]]=s then
|
||||
findreg_by_gasname:=gas_regname_index[p]
|
||||
else
|
||||
findreg_by_gasname:=0;
|
||||
end;
|
||||
|
||||
|
||||
function gas_regnum_search(const s:string):Tregister;
|
||||
begin
|
||||
result:=regnumber_table[findreg_by_gasname(s)];
|
||||
result:=regnumber_table[findreg_by_name_table(s, gas_regname_table, gas_regname_index)];
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user