mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 05:59:30 +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
|
||||
begin
|
||||
ai:=TAiCpu.Op_sym(A_Bxx,hl);
|
||||
ai.SetCondition(C_NO);
|
||||
ai.SetCondition(C_VC);
|
||||
list.Concat(ai);
|
||||
{ Delay slot }
|
||||
list.Concat(TAiCpu.Op_none(A_NOP));
|
||||
|
@ -97,24 +97,28 @@ uses
|
||||
|
||||
type
|
||||
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_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_NO,C_NP,
|
||||
C_NS,C_NZ,C_O,C_P,C_PE,C_PO,C_S,C_Z,
|
||||
C_FE,C_FG,C_FL,C_FGE,C_FLE,C_FNE
|
||||
C_A,C_AE,C_B,C_BE,
|
||||
C_G,C_GE,C_L,C_LE,
|
||||
C_E,C_NE,
|
||||
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
|
||||
firstIntCond=C_A;
|
||||
lastIntCond=C_Z;
|
||||
lastIntCond=C_VS;
|
||||
firstFloatCond=C_FE;
|
||||
lastFloatCond=C_FNE;
|
||||
floatAsmConds=[C_FE..C_FNE];
|
||||
floatAsmConds=[C_FE..C_FLG];
|
||||
|
||||
cond2str:array[TAsmCond] of string[3]=('',
|
||||
'gu','cc','cs','leu','cs','e','g','ge','l','le','leu','cs',
|
||||
'cc','gu','cc','ne','le','l','ge','g','vc','XX',
|
||||
'pos','ne','vs','XX','XX','XX','vs','e',
|
||||
'e','g','l','ge','le','ne'
|
||||
'gu','cc','cs','leu',
|
||||
'g','ge','l','le',
|
||||
'e','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_LE, {Less or Equal}
|
||||
F_A, {Above}
|
||||
F_AE, {Above or Equal}
|
||||
F_B, {Below}
|
||||
F_AE, {Above or Equal, synonym: Carry Clear}
|
||||
F_B, {Below, synonym: Carry Set}
|
||||
F_BE, {Below or Equal}
|
||||
F_C, {Carry}
|
||||
F_NC, {Not Carry}
|
||||
{ Floating point results }
|
||||
F_FE, {Equal}
|
||||
F_FNE, {Not Equal}
|
||||
@ -325,7 +327,7 @@ implementation
|
||||
procedure inverse_flags(var f: TResFlags);
|
||||
const
|
||||
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);
|
||||
begin
|
||||
f:=inv_flags[f];
|
||||
@ -335,7 +337,7 @@ implementation
|
||||
function flags_to_cond(const f:TResFlags):TAsmCond;
|
||||
const
|
||||
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);
|
||||
begin
|
||||
result:=flags_2_cond[f];
|
||||
@ -432,10 +434,12 @@ implementation
|
||||
function inverse_cond(const c: TAsmCond): TAsmCond; {$ifdef USEINLINE}inline;{$endif USEINLINE}
|
||||
const
|
||||
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_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_O,C_P,
|
||||
C_S,C_Z,C_NO,C_NP,C_NP,C_P,C_NS,C_NZ,
|
||||
C_FNE,C_FLE,C_FGE,C_FL,C_FG,C_FE
|
||||
C_BE,C_B,C_AE,C_A,
|
||||
C_LE,C_L,C_GE,C_G,
|
||||
C_NE,C_E,
|
||||
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
|
||||
result := inverse[c];
|
||||
|
@ -148,7 +148,7 @@ implementation
|
||||
if (nodetype = modn) then
|
||||
begin
|
||||
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;
|
||||
current_asmdata.CurrAsmList.concat(ai);
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_NOT,resultreg));
|
||||
|
Loading…
Reference in New Issue
Block a user