mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 08:54:22 +02:00
* make fpu/mmx/xmm/ymm registers numbers instead of flags to have enough space for zmm/bnd/k registers
git-svn-id: trunk@38116 -
This commit is contained in:
parent
2d52536460
commit
e6a6938787
@ -86,6 +86,8 @@ interface
|
||||
otf_reg_mmx = $02000000;
|
||||
otf_reg_xmm = $04000000;
|
||||
otf_reg_ymm = $08000000;
|
||||
|
||||
otf_reg_extra_mask = $0F000000;
|
||||
{ Bits 16..19: subclasses, meaning depends on classes field }
|
||||
otf_sub0 = $00010000;
|
||||
otf_sub1 = $00020000;
|
||||
@ -93,7 +95,9 @@ interface
|
||||
otf_sub3 = $00080000;
|
||||
OT_REG_SMASK = otf_sub0 or otf_sub1 or otf_sub2 or otf_sub3;
|
||||
|
||||
OT_REG_TYPMASK = otf_reg_cdt or otf_reg_gpr or otf_reg_sreg or otf_reg_fpu or otf_reg_mmx or otf_reg_xmm or otf_reg_ymm;
|
||||
OT_REG_EXTRA_MASK = $0F000000;
|
||||
|
||||
OT_REG_TYPMASK = otf_reg_cdt or otf_reg_gpr or otf_reg_sreg or otf_reg_extra_mask;
|
||||
{ register class 0: CRx, DRx and TRx }
|
||||
{$ifdef x86_64}
|
||||
OT_REG_CDT = OT_REGISTER or otf_reg_cdt or OT_BITS64;
|
||||
@ -175,7 +179,7 @@ interface
|
||||
{ simple [address] offset }
|
||||
|
||||
{ Matches any type of r/m operand }
|
||||
OT_MEMORY_ANY = OT_MEMORY or OT_RM_GPR or OT_XMMRM or OT_MMXRM or OT_YMMRM;
|
||||
OT_MEMORY_ANY = OT_MEMORY or OT_RM_GPR or OT_XMMRM or OT_MMXRM or OT_YMMRM or OT_REG_EXTRA_MASK;
|
||||
|
||||
{ Immediate operands }
|
||||
OT_IMM8 = OT_IMMEDIATE or OT_BITS8;
|
||||
@ -1096,16 +1100,16 @@ implementation
|
||||
s:=s+',';
|
||||
{ type }
|
||||
addsize:=false;
|
||||
if (ot and OT_XMMREG)=OT_XMMREG then
|
||||
if (ot and OT_REG_EXTRA_MASK)=OT_XMMREG then
|
||||
s:=s+'xmmreg'
|
||||
else
|
||||
if (ot and OT_YMMREG)=OT_YMMREG then
|
||||
if (ot and OT_REG_EXTRA_MASK)=OT_YMMREG then
|
||||
s:=s+'ymmreg'
|
||||
else
|
||||
if (ot and OT_MMXREG)=OT_MMXREG then
|
||||
if (ot and OT_REG_EXTRA_MASK)=OT_MMXREG then
|
||||
s:=s+'mmxreg'
|
||||
else
|
||||
if (ot and OT_FPUREG)=OT_FPUREG then
|
||||
if (ot and OT_REG_EXTRA_MASK)=OT_FPUREG then
|
||||
s:=s+'fpureg'
|
||||
else
|
||||
if (ot and OT_REGISTER)=OT_REGISTER then
|
||||
@ -1595,12 +1599,12 @@ implementation
|
||||
for i:=0 to p^.ops-1 do
|
||||
begin
|
||||
insot:=p^.optypes[i];
|
||||
if ((insot and OT_XMMRM) = OT_XMMRM) OR
|
||||
((insot and OT_YMMRM) = OT_YMMRM) then
|
||||
if ((insot and (OT_XMMRM or OT_REG_EXTRA_MASK)) = OT_XMMRM) OR
|
||||
((insot and (OT_YMMRM or OT_REG_EXTRA_MASK)) = OT_YMMRM) then
|
||||
begin
|
||||
if (insot and OT_SIZE_MASK) = 0 then
|
||||
begin
|
||||
case insot and (OT_XMMRM or OT_YMMRM) of
|
||||
case insot and (OT_XMMRM or OT_YMMRM or OT_REG_EXTRA_MASK) of
|
||||
OT_XMMRM: insot := insot or OT_BITS128;
|
||||
OT_YMMRM: insot := insot or OT_BITS256;
|
||||
end;
|
||||
@ -3547,7 +3551,8 @@ implementation
|
||||
if needed_VEX and
|
||||
(ops=4) and
|
||||
(oper[opidx]^.typ=top_reg) and
|
||||
(oper[opidx]^.ot and (otf_reg_xmm or otf_reg_ymm)<>0) then
|
||||
((oper[opidx]^.ot and OT_REG_EXTRA_MASK)=otf_reg_xmm) or
|
||||
((oper[opidx]^.ot and OT_REG_EXTRA_MASK)=otf_reg_ymm) then
|
||||
begin
|
||||
bytes[0] := ((getsupreg(oper[opidx]^.reg) and 15) shl 4);
|
||||
objdata.writebytes(bytes,1);
|
||||
@ -4056,7 +4061,7 @@ implementation
|
||||
NewRegSize := (insentry^.optypes[j] and OT_SIZE_MASK);
|
||||
if NewRegSize = 0 then
|
||||
begin
|
||||
case insentry^.optypes[j] and (OT_MMXREG OR OT_XMMREG OR OT_YMMREG) of
|
||||
case insentry^.optypes[j] and (OT_MMXREG or OT_XMMREG or OT_YMMREG or OT_REG_EXTRA_MASK) of
|
||||
OT_MMXREG: begin
|
||||
NewRegSize := OT_BITS64;
|
||||
end;
|
||||
@ -4073,7 +4078,7 @@ implementation
|
||||
end;
|
||||
|
||||
actRegSize := actRegSize or NewRegSize;
|
||||
actRegTypes := actRegTypes or (insentry^.optypes[j] and (OT_MMXREG OR OT_XMMREG OR OT_YMMREG));
|
||||
actRegTypes := actRegTypes or (insentry^.optypes[j] and (OT_MMXREG or OT_XMMREG or OT_YMMREG or OT_REG_EXTRA_MASK));
|
||||
end
|
||||
else if ((insentry^.optypes[j] and OT_MEMORY) <> 0) then
|
||||
begin
|
||||
@ -4172,7 +4177,7 @@ implementation
|
||||
0: ; // nothing todo
|
||||
1: begin
|
||||
MRefInfo := msiUnkown;
|
||||
case actRegMemTypes and (OT_MMXRM OR OT_XMMRM OR OT_YMMRM) of
|
||||
case actRegMemTypes and (OT_MMXRM or OT_XMMRM or OT_YMMRM or OT_REG_EXTRA_MASK) of
|
||||
OT_MMXRM: actMemSize := actMemSize or OT_BITS64;
|
||||
OT_XMMRM: actMemSize := actMemSize or OT_BITS128;
|
||||
OT_YMMRM: actMemSize := actMemSize or OT_BITS256;
|
||||
@ -4219,7 +4224,7 @@ implementation
|
||||
|
||||
if actRegCount > 0 then
|
||||
begin
|
||||
case actRegTypes and (OT_MMXREG or OT_XMMREG or OT_YMMREG) of
|
||||
case actRegTypes and (OT_MMXREG or OT_XMMREG or OT_YMMREG or OT_REG_EXTRA_MASK) of
|
||||
OT_MMXREG: RegMMXSizeMask := RegMMXSizeMask or actMemSize;
|
||||
OT_XMMREG: RegXMMSizeMask := RegXMMSizeMask or actMemSize;
|
||||
OT_YMMREG: RegYMMSizeMask := RegYMMSizeMask or actMemSize;
|
||||
|
Loading…
Reference in New Issue
Block a user