* patch by Jeppe Johansen to support jumptable generation for case nodes on arm/thumb-2, resolves #19502

git-svn-id: trunk@18233 -
This commit is contained in:
florian 2011-08-16 22:39:00 +00:00
parent 1e1c45c665
commit 2eb39c8843
6 changed files with 23 additions and 6 deletions

View File

@ -113,7 +113,9 @@ interface
relsyms (nor do they support dwarf, for that matter)
}
aitconst_darwin_dwarf_delta64,
aitconst_darwin_dwarf_delta32
aitconst_darwin_dwarf_delta32,
{ ARM Thumb-2 only }
aitconst_half16bit { used for table jumps. The actual value is the 16bit value shifted left once }
);
const
@ -1326,6 +1328,8 @@ implementation
result:=LengthUleb128(qword(value));
aitconst_sleb128bit :
result:=LengthSleb128(value);
aitconst_half16bit:
result:=2;
else
internalerror(200603253);
end;

View File

@ -195,10 +195,10 @@ implementation
const
ait_const2str : array[aitconst_128bit..aitconst_darwin_dwarf_delta32] of string[20]=(
ait_const2str : array[aitconst_128bit..aitconst_half16bit] of string[20]=(
#9'.fixme128'#9,#9'.quad'#9,#9'.long'#9,#9'.short'#9,#9'.byte'#9,
#9'.sleb128'#9,#9'.uleb128'#9,
#9'.rva'#9,#9'.secrel32'#9,#9'.quad'#9,#9'.long'#9
#9'.rva'#9,#9'.secrel32'#9,#9'.quad'#9,#9'.long'#9,#9'.short'#9
);
function ReplaceForbiddenChars(const s: string): string;
@ -835,7 +835,8 @@ implementation
aitconst_rva_symbol,
aitconst_secrel32_symbol,
aitconst_darwin_dwarf_delta32,
aitconst_darwin_dwarf_delta64:
aitconst_darwin_dwarf_delta64,
aitconst_half16bit:
begin
if (target_info.system in systems_darwin) and
(constdef in [aitconst_uleb128bit,aitconst_sleb128bit]) then
@ -881,6 +882,9 @@ implementation
{ 64 bit constants are already handled above in this case }
s:=tostr(longint(tai_const(hp).value));
{$endif cpu64bitaddr}
if constdef = aitconst_half16bit then
s:='('+s+')/2';
AsmWrite(s);
inc(l,length(s));
{ Values with symbols are written on a single line to improve

View File

@ -202,5 +202,7 @@
'iteet',
'ittet',
'itett',
'itttt'
'itttt',
'tbb',
'tbh'
);

View File

@ -202,5 +202,7 @@ attsufNONE,
attsufNONE,
attsufNONE,
attsufNONE,
attsufNONE,
attsufNONE,
attsufNONE
);

View File

@ -623,3 +623,6 @@ reg32,reg32,reg32,reg32 \x16\x00\x80\x90 ARM7
[ITETT]
[ITTTT]
[TBB]
[TBH]

View File

@ -202,5 +202,7 @@ A_ITTTE,
A_ITEET,
A_ITTET,
A_ITETT,
A_ITTTT
A_ITTTT,
A_TBB,
A_TBH
);