mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 01:59:18 +02:00
* SPARC: cleaned up and actualized TAsmCond (stuff copy-pasted from x86 removed, conditions for unordered floating-point comparisons added). Fixes Mantis #9362 on this target.
git-svn-id: trunk@27593 -
This commit is contained in:
parent
58882e2934
commit
f3801d13de
@ -970,7 +970,7 @@ implementation
|
|||||||
pasbool8,pasbool16,pasbool32,pasbool64]))) then
|
pasbool8,pasbool16,pasbool32,pasbool64]))) then
|
||||||
begin
|
begin
|
||||||
ai:=TAiCpu.Op_sym(A_Bxx,hl);
|
ai:=TAiCpu.Op_sym(A_Bxx,hl);
|
||||||
ai.SetCondition(C_NO);
|
ai.SetCondition(C_VC);
|
||||||
list.Concat(ai);
|
list.Concat(ai);
|
||||||
{ Delay slot }
|
{ Delay slot }
|
||||||
list.Concat(TAiCpu.Op_none(A_NOP));
|
list.Concat(TAiCpu.Op_none(A_NOP));
|
||||||
|
@ -97,24 +97,28 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
TAsmCond=(C_None,
|
TAsmCond=(C_None,
|
||||||
C_A,C_AE,C_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_NA,C_NAE,
|
C_A,C_AE,C_B,C_BE,
|
||||||
C_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_NO,C_NP,
|
C_G,C_GE,C_L,C_LE,
|
||||||
C_NS,C_NZ,C_O,C_P,C_PE,C_PO,C_S,C_Z,
|
C_E,C_NE,
|
||||||
C_FE,C_FG,C_FL,C_FGE,C_FLE,C_FNE
|
C_POS,C_NEG,C_VC,C_VS,
|
||||||
|
C_FE,C_FG,C_FL,C_FGE,C_FLE,C_FNE,
|
||||||
|
C_FU,C_FUG,C_FUL,C_FUGE,C_FULE,C_FO,C_FUE,C_FLG
|
||||||
);
|
);
|
||||||
|
|
||||||
const
|
const
|
||||||
firstIntCond=C_A;
|
firstIntCond=C_A;
|
||||||
lastIntCond=C_Z;
|
lastIntCond=C_VS;
|
||||||
firstFloatCond=C_FE;
|
firstFloatCond=C_FE;
|
||||||
lastFloatCond=C_FNE;
|
lastFloatCond=C_FNE;
|
||||||
floatAsmConds=[C_FE..C_FNE];
|
floatAsmConds=[C_FE..C_FLG];
|
||||||
|
|
||||||
cond2str:array[TAsmCond] of string[3]=('',
|
cond2str:array[TAsmCond] of string[3]=('',
|
||||||
'gu','cc','cs','leu','cs','e','g','ge','l','le','leu','cs',
|
'gu','cc','cs','leu',
|
||||||
'cc','gu','cc','ne','le','l','ge','g','vc','XX',
|
'g','ge','l','le',
|
||||||
'pos','ne','vs','XX','XX','XX','vs','e',
|
'e','ne',
|
||||||
'e','g','l','ge','le','ne'
|
'pos','neg','vc','vs',
|
||||||
|
'e','g','l','ge','le','ne',
|
||||||
|
'u','ug','ul','uge','ule','o','ue','lg'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -132,11 +136,9 @@ uses
|
|||||||
F_GE, {Greater or Equal}
|
F_GE, {Greater or Equal}
|
||||||
F_LE, {Less or Equal}
|
F_LE, {Less or Equal}
|
||||||
F_A, {Above}
|
F_A, {Above}
|
||||||
F_AE, {Above or Equal}
|
F_AE, {Above or Equal, synonym: Carry Clear}
|
||||||
F_B, {Below}
|
F_B, {Below, synonym: Carry Set}
|
||||||
F_BE, {Below or Equal}
|
F_BE, {Below or Equal}
|
||||||
F_C, {Carry}
|
|
||||||
F_NC, {Not Carry}
|
|
||||||
{ Floating point results }
|
{ Floating point results }
|
||||||
F_FE, {Equal}
|
F_FE, {Equal}
|
||||||
F_FNE, {Not Equal}
|
F_FNE, {Not Equal}
|
||||||
@ -325,7 +327,7 @@ implementation
|
|||||||
procedure inverse_flags(var f: TResFlags);
|
procedure inverse_flags(var f: TResFlags);
|
||||||
const
|
const
|
||||||
inv_flags: array[TResFlags] of TResFlags =
|
inv_flags: array[TResFlags] of TResFlags =
|
||||||
(F_NE,F_E,F_LE,F_GE,F_L,F_G,F_BE,F_B,F_AE,F_A,F_NC,F_C,
|
(F_NE,F_E,F_LE,F_GE,F_L,F_G,F_BE,F_B,F_AE,F_A,
|
||||||
F_FNE,F_FE,F_FLE,F_FGE,F_FL,F_FG);
|
F_FNE,F_FE,F_FLE,F_FGE,F_FL,F_FG);
|
||||||
begin
|
begin
|
||||||
f:=inv_flags[f];
|
f:=inv_flags[f];
|
||||||
@ -335,7 +337,7 @@ implementation
|
|||||||
function flags_to_cond(const f:TResFlags):TAsmCond;
|
function flags_to_cond(const f:TResFlags):TAsmCond;
|
||||||
const
|
const
|
||||||
flags_2_cond:array[TResFlags] of TAsmCond=
|
flags_2_cond:array[TResFlags] of TAsmCond=
|
||||||
(C_E,C_NE,C_G,C_L,C_GE,C_LE,C_A,C_AE,C_B,C_BE,C_C,C_NC,
|
(C_E,C_NE,C_G,C_L,C_GE,C_LE,C_A,C_AE,C_B,C_BE,
|
||||||
C_FE,C_FNE,C_FG,C_FL,C_FGE,C_FLE);
|
C_FE,C_FNE,C_FG,C_FL,C_FGE,C_FLE);
|
||||||
begin
|
begin
|
||||||
result:=flags_2_cond[f];
|
result:=flags_2_cond[f];
|
||||||
@ -432,10 +434,12 @@ implementation
|
|||||||
function inverse_cond(const c: TAsmCond): TAsmCond; {$ifdef USEINLINE}inline;{$endif USEINLINE}
|
function inverse_cond(const c: TAsmCond): TAsmCond; {$ifdef USEINLINE}inline;{$endif USEINLINE}
|
||||||
const
|
const
|
||||||
inverse: array[TAsmCond] of TAsmCond=(C_None,
|
inverse: array[TAsmCond] of TAsmCond=(C_None,
|
||||||
C_NA,C_NAE,C_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_A,C_AE,
|
C_BE,C_B,C_AE,C_A,
|
||||||
C_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_O,C_P,
|
C_LE,C_L,C_GE,C_G,
|
||||||
C_S,C_Z,C_NO,C_NP,C_NP,C_P,C_NS,C_NZ,
|
C_NE,C_E,
|
||||||
C_FNE,C_FLE,C_FGE,C_FL,C_FG,C_FE
|
C_NEG,C_POS,C_VS,C_VC,
|
||||||
|
C_FNE,C_FULE,C_FUGE,C_FUL,C_FUG,C_FE,
|
||||||
|
C_FO,C_FLE,C_FGE,C_FL,C_FG,C_FU,C_FLG,C_FUE
|
||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
result := inverse[c];
|
result := inverse[c];
|
||||||
|
@ -148,7 +148,7 @@ implementation
|
|||||||
if (nodetype = modn) then
|
if (nodetype = modn) then
|
||||||
begin
|
begin
|
||||||
current_asmdata.getjumplabel(overflowlabel);
|
current_asmdata.getjumplabel(overflowlabel);
|
||||||
ai:=taicpu.op_cond_sym(A_Bxx,C_O,overflowlabel);
|
ai:=taicpu.op_cond_sym(A_Bxx,C_VS,overflowlabel);
|
||||||
ai.delayslot_annulled:=true;
|
ai.delayslot_annulled:=true;
|
||||||
current_asmdata.CurrAsmList.concat(ai);
|
current_asmdata.CurrAsmList.concat(ai);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_NOT,resultreg));
|
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_NOT,resultreg));
|
||||||
|
Loading…
Reference in New Issue
Block a user