diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index 33a6053ced..448b0ca59b 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -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; diff --git a/compiler/aggas.pas b/compiler/aggas.pas index 3238142494..e51a9ab51c 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -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 diff --git a/compiler/arm/armatt.inc b/compiler/arm/armatt.inc index e030dd95d3..efc974dd25 100644 --- a/compiler/arm/armatt.inc +++ b/compiler/arm/armatt.inc @@ -202,5 +202,7 @@ 'iteet', 'ittet', 'itett', -'itttt' +'itttt', +'tbb', +'tbh' ); diff --git a/compiler/arm/armatts.inc b/compiler/arm/armatts.inc index b5adf84b9a..b11094b987 100644 --- a/compiler/arm/armatts.inc +++ b/compiler/arm/armatts.inc @@ -202,5 +202,7 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, +attsufNONE, +attsufNONE, attsufNONE ); diff --git a/compiler/arm/armins.dat b/compiler/arm/armins.dat index 3db632aaf7..39a3b15d56 100644 --- a/compiler/arm/armins.dat +++ b/compiler/arm/armins.dat @@ -623,3 +623,6 @@ reg32,reg32,reg32,reg32 \x16\x00\x80\x90 ARM7 [ITETT] [ITTTT] + +[TBB] +[TBH] diff --git a/compiler/arm/armop.inc b/compiler/arm/armop.inc index e43d1231a1..ec5d50029e 100644 --- a/compiler/arm/armop.inc +++ b/compiler/arm/armop.inc @@ -202,5 +202,7 @@ A_ITTTE, A_ITEET, A_ITTET, A_ITETT, -A_ITTTT +A_ITTTT, +A_TBB, +A_TBH );