|
@@ -64,11 +64,7 @@ interface
|
|
ait_directive,
|
|
ait_directive,
|
|
ait_label,
|
|
ait_label,
|
|
ait_const,
|
|
ait_const,
|
|
- ait_real_32bit,
|
|
|
|
- ait_real_64bit,
|
|
|
|
- ait_real_80bit,
|
|
|
|
- ait_comp_64bit,
|
|
|
|
- ait_real_128bit,
|
|
|
|
|
|
+ ait_realconst,
|
|
ait_stab,
|
|
ait_stab,
|
|
ait_force_line,
|
|
ait_force_line,
|
|
ait_function_name,
|
|
ait_function_name,
|
|
@@ -152,6 +148,14 @@ interface
|
|
aitconst_gotoff_symbol
|
|
aitconst_gotoff_symbol
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ tairealconsttype = (
|
|
|
|
+ aitrealconst_s32bit,
|
|
|
|
+ aitrealconst_s64bit,
|
|
|
|
+ aitrealconst_s80bit,
|
|
|
|
+ aitrealconst_s128bit,
|
|
|
|
+ aitrealconst_s64comp
|
|
|
|
+ );
|
|
|
|
+
|
|
const
|
|
const
|
|
{$if defined(cpu64bitaddr)}
|
|
{$if defined(cpu64bitaddr)}
|
|
aitconst_ptr = aitconst_64bit;
|
|
aitconst_ptr = aitconst_64bit;
|
|
@@ -187,11 +191,7 @@ interface
|
|
'symbol_directive',
|
|
'symbol_directive',
|
|
'label',
|
|
'label',
|
|
'const',
|
|
'const',
|
|
- 'real_32bit',
|
|
|
|
- 'real_64bit',
|
|
|
|
- 'real_80bit',
|
|
|
|
- 'comp_64bit',
|
|
|
|
- 'real_128bit',
|
|
|
|
|
|
+ 'realconst',
|
|
'stab',
|
|
'stab',
|
|
'force_line',
|
|
'force_line',
|
|
'function_name',
|
|
'function_name',
|
|
@@ -351,7 +351,7 @@ interface
|
|
ait_thumb_set,
|
|
ait_thumb_set,
|
|
{$endif arm}
|
|
{$endif arm}
|
|
ait_set,ait_weak,
|
|
ait_set,ait_weak,
|
|
- ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_real_128bit,
|
|
|
|
|
|
+ ait_realconst,
|
|
ait_symbol,
|
|
ait_symbol,
|
|
{$ifdef JVM}
|
|
{$ifdef JVM}
|
|
ait_jvar, ait_jcatch,
|
|
ait_jvar, ait_jcatch,
|
|
@@ -626,57 +626,34 @@ interface
|
|
function size:longint;
|
|
function size:longint;
|
|
end;
|
|
end;
|
|
|
|
|
|
- { Generates a single float (32 bit real) }
|
|
|
|
- tai_real_32bit = class(tai)
|
|
|
|
- value : ts32real;
|
|
|
|
- constructor Create(_value : ts32real);
|
|
|
|
- constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
|
|
|
|
- procedure ppuwrite(ppufile:tcompilerppufile);override;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
|
|
+ { floating point const }
|
|
tformatoptions = (fo_none,fo_hiloswapped);
|
|
tformatoptions = (fo_none,fo_hiloswapped);
|
|
-
|
|
|
|
- { Generates a double float (64 bit real) }
|
|
|
|
- tai_real_64bit = class(tai)
|
|
|
|
- value : ts64real;
|
|
|
|
|
|
+ tai_realconst = class(tai)
|
|
|
|
+ realtyp: tairealconsttype;
|
|
|
|
+ savesize: byte;
|
|
|
|
+ value: record
|
|
|
|
+ case tairealconsttype of
|
|
|
|
+ aitrealconst_s32bit: (s32val: ts32real);
|
|
|
|
+ aitrealconst_s64bit: (s64val: ts64real);
|
|
|
|
+ aitrealconst_s80bit: (s80val: ts80real);
|
|
|
|
+ aitrealconst_s128bit: (s128val: ts128real);
|
|
|
|
+ aitrealconst_s64comp: (s64compval: ts64comp);
|
|
|
|
+ end;
|
|
{$ifdef ARM}
|
|
{$ifdef ARM}
|
|
formatoptions : tformatoptions;
|
|
formatoptions : tformatoptions;
|
|
- constructor Create_hiloswapped(_value : ts64real);
|
|
|
|
{$endif ARM}
|
|
{$endif ARM}
|
|
- constructor Create(_value : ts64real);
|
|
|
|
- constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
|
|
|
|
- procedure ppuwrite(ppufile:tcompilerppufile);override;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- { Generates an extended float (80 bit real) }
|
|
|
|
- tai_real_80bit = class(tai)
|
|
|
|
- value : ts80real;
|
|
|
|
- savesize : byte;
|
|
|
|
- constructor Create(_value : ts80real; _savesize: byte);
|
|
|
|
- constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
|
|
|
|
- procedure ppuwrite(ppufile:tcompilerppufile);override;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- { Generates an float128 (128 bit real) }
|
|
|
|
- tai_real_128bit = class(tai)
|
|
|
|
- value : ts128real;
|
|
|
|
- constructor Create(_value : ts128real);
|
|
|
|
- constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
|
|
|
|
- procedure ppuwrite(ppufile:tcompilerppufile);override;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
- { Generates a comp int (integer over 64 bits)
|
|
|
|
-
|
|
|
|
- This is Intel 80x86 specific, and is not
|
|
|
|
- really supported on other processors.
|
|
|
|
- }
|
|
|
|
- tai_comp_64bit = class(tai)
|
|
|
|
- value : ts64comp;
|
|
|
|
- constructor Create(_value : ts64comp);
|
|
|
|
- constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
|
|
|
|
- procedure ppuwrite(ppufile:tcompilerppufile);override;
|
|
|
|
|
|
+ constructor create_s32real(val: ts32real);
|
|
|
|
+ constructor create_s64real(val: ts64real);
|
|
|
|
+{$ifdef ARM}
|
|
|
|
+ constructor create_s64real_hiloswapped(val : ts64real);
|
|
|
|
+{$endif ARM}
|
|
|
|
+ constructor create_s80real(val: ts80real; _savesize: byte);
|
|
|
|
+ constructor create_s128real(val: ts128real);
|
|
|
|
+ constructor create_s64compreal(val: ts64comp);
|
|
|
|
+ constructor ppuload(t: taitype;ppufile: tcompilerppufile); override;
|
|
|
|
+ procedure ppuwrite(ppufile: tcompilerppufile); override;
|
|
|
|
+ function getcopy:tlinkedlistitem;override;
|
|
|
|
+ function datasize: word;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ tai_stab }
|
|
{ tai_stab }
|
|
@@ -1890,156 +1867,151 @@ implementation
|
|
|
|
|
|
|
|
|
|
{****************************************************************************
|
|
{****************************************************************************
|
|
- TAI_real_32bit
|
|
|
|
|
|
+ TAI_realconst
|
|
****************************************************************************}
|
|
****************************************************************************}
|
|
|
|
|
|
- constructor tai_real_32bit.Create(_value : ts32real);
|
|
|
|
-
|
|
|
|
- begin
|
|
|
|
- inherited Create;
|
|
|
|
- typ:=ait_real_32bit;
|
|
|
|
- value:=_value;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
- constructor tai_real_32bit.ppuload(t:taitype;ppufile:tcompilerppufile);
|
|
|
|
|
|
+ constructor tai_realconst.create_s32real(val: ts32real);
|
|
begin
|
|
begin
|
|
- inherited ppuload(t,ppufile);
|
|
|
|
- value:=ppufile.getreal;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- procedure tai_real_32bit.ppuwrite(ppufile:tcompilerppufile);
|
|
|
|
- begin
|
|
|
|
- inherited ppuwrite(ppufile);
|
|
|
|
- ppufile.putreal(value);
|
|
|
|
|
|
+ inherited create;
|
|
|
|
+ typ:=ait_realconst;
|
|
|
|
+ realtyp:=aitrealconst_s32bit;
|
|
|
|
+ savesize:=4;
|
|
|
|
+ value.s32val:=val;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
-{****************************************************************************
|
|
|
|
- TAI_real_64bit
|
|
|
|
- ****************************************************************************}
|
|
|
|
-
|
|
|
|
- constructor tai_real_64bit.Create(_value : ts64real);
|
|
|
|
-
|
|
|
|
|
|
+ constructor tai_realconst.create_s64real(val: ts64real);
|
|
begin
|
|
begin
|
|
- inherited Create;
|
|
|
|
- typ:=ait_real_64bit;
|
|
|
|
- value:=_value;
|
|
|
|
|
|
+ inherited create;
|
|
|
|
+ typ:=ait_realconst;
|
|
|
|
+ realtyp:=aitrealconst_s64bit;
|
|
|
|
+ savesize:=8;
|
|
|
|
+ value.s64val:=val;
|
|
end;
|
|
end;
|
|
|
|
|
|
-
|
|
|
|
{$ifdef ARM}
|
|
{$ifdef ARM}
|
|
- constructor tai_real_64bit.Create_hiloswapped(_value : ts64real);
|
|
|
|
-
|
|
|
|
|
|
+ constructor tai_realconst.create_s64real_hiloswapped(val : ts64real);
|
|
begin
|
|
begin
|
|
- inherited Create;
|
|
|
|
- typ:=ait_real_64bit;
|
|
|
|
- value:=_value;
|
|
|
|
- formatoptions:=fo_hiloswapped;
|
|
|
|
- end;
|
|
|
|
-{$endif ARM}
|
|
|
|
-
|
|
|
|
- constructor tai_real_64bit.ppuload(t:taitype;ppufile:tcompilerppufile);
|
|
|
|
- begin
|
|
|
|
- inherited ppuload(t,ppufile);
|
|
|
|
- value:=ppufile.getreal;
|
|
|
|
-{$ifdef ARM}
|
|
|
|
- formatoptions:=tformatoptions(ppufile.getbyte);
|
|
|
|
-{$endif ARM}
|
|
|
|
|
|
+ inherited create;
|
|
|
|
+ typ:=ait_realconst;
|
|
|
|
+ realtyp:=aitrealconst_s64bit;
|
|
|
|
+ value.s64val:=val;
|
|
|
|
+ savesize:=8;
|
|
|
|
+ formatoptions:=fo_hiloswapped;
|
|
end;
|
|
end;
|
|
|
|
|
|
-
|
|
|
|
- procedure tai_real_64bit.ppuwrite(ppufile:tcompilerppufile);
|
|
|
|
- begin
|
|
|
|
- inherited ppuwrite(ppufile);
|
|
|
|
- ppufile.putreal(value);
|
|
|
|
-{$ifdef ARM}
|
|
|
|
- ppufile.putbyte(byte(formatoptions));
|
|
|
|
{$endif ARM}
|
|
{$endif ARM}
|
|
- end;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-{****************************************************************************
|
|
|
|
- TAI_real_80bit
|
|
|
|
- ****************************************************************************}
|
|
|
|
-
|
|
|
|
- constructor tai_real_80bit.Create(_value : ts80real; _savesize: byte);
|
|
|
|
-
|
|
|
|
- begin
|
|
|
|
- inherited Create;
|
|
|
|
- typ:=ait_real_80bit;
|
|
|
|
- value:=_value;
|
|
|
|
- savesize:=_savesize;
|
|
|
|
- end;
|
|
|
|
|
|
|
|
-
|
|
|
|
- constructor tai_real_80bit.ppuload(t:taitype;ppufile:tcompilerppufile);
|
|
|
|
|
|
+ constructor tai_realconst.create_s80real(val: ts80real; _savesize: byte);
|
|
begin
|
|
begin
|
|
- inherited ppuload(t,ppufile);
|
|
|
|
- value:=ppufile.getreal;
|
|
|
|
- savesize:=ppufile.getbyte;
|
|
|
|
|
|
+ inherited create;
|
|
|
|
+ typ:=ait_realconst;
|
|
|
|
+ realtyp:=aitrealconst_s80bit;
|
|
|
|
+ savesize:=_savesize;
|
|
|
|
+ value.s80val:=val;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
- procedure tai_real_80bit.ppuwrite(ppufile:tcompilerppufile);
|
|
|
|
|
|
+ constructor tai_realconst.create_s128real(val: ts128real);
|
|
begin
|
|
begin
|
|
- inherited ppuwrite(ppufile);
|
|
|
|
- ppufile.putreal(value);
|
|
|
|
- ppufile.putbyte(savesize);
|
|
|
|
|
|
+ inherited create;
|
|
|
|
+ typ:=ait_realconst;
|
|
|
|
+ realtyp:=aitrealconst_s128bit;
|
|
|
|
+ savesize:=16;
|
|
|
|
+ value.s128val:=val;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
-{****************************************************************************
|
|
|
|
- TAI_real_80bit
|
|
|
|
- ****************************************************************************}
|
|
|
|
-
|
|
|
|
- constructor tai_real_128bit.Create(_value : ts128real);
|
|
|
|
-
|
|
|
|
|
|
+ constructor tai_realconst.create_s64compreal(val: ts64comp);
|
|
begin
|
|
begin
|
|
- inherited Create;
|
|
|
|
- typ:=ait_real_128bit;
|
|
|
|
- value:=_value;
|
|
|
|
|
|
+ inherited create;
|
|
|
|
+ typ:=ait_realconst;
|
|
|
|
+ realtyp:=aitrealconst_s64comp;
|
|
|
|
+ savesize:=8;
|
|
|
|
+ value.s64compval:=val;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
- constructor tai_real_128bit.ppuload(t:taitype;ppufile:tcompilerppufile);
|
|
|
|
|
|
+ constructor tai_realconst.ppuload(t: taitype; ppufile: tcompilerppufile);
|
|
begin
|
|
begin
|
|
- inherited ppuload(t,ppufile);
|
|
|
|
- value:=ppufile.getreal;
|
|
|
|
|
|
+ inherited;
|
|
|
|
+ realtyp:=tairealconsttype(ppufile.getbyte);
|
|
|
|
+{$ifdef ARM}
|
|
|
|
+ formatoptions:=tformatoptions(ppufile.getbyte);
|
|
|
|
+{$endif ARM}
|
|
|
|
+ case realtyp of
|
|
|
|
+ aitrealconst_s32bit:
|
|
|
|
+ value.s32val:=ppufile.getreal;
|
|
|
|
+ aitrealconst_s64bit:
|
|
|
|
+ value.s64val:=ppufile.getreal;
|
|
|
|
+ aitrealconst_s80bit:
|
|
|
|
+ value.s80val:=ppufile.getreal;
|
|
|
|
+ aitrealconst_s128bit:
|
|
|
|
+ value.s128val:=ppufile.getreal;
|
|
|
|
+ aitrealconst_s64comp:
|
|
|
|
+ value.s64compval:=comp(ppufile.getint64);
|
|
|
|
+ else
|
|
|
|
+ internalerror(2014050602);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
- procedure tai_real_128bit.ppuwrite(ppufile:tcompilerppufile);
|
|
|
|
|
|
+ procedure tai_realconst.ppuwrite(ppufile: tcompilerppufile);
|
|
|
|
+ var
|
|
|
|
+ c: comp;
|
|
begin
|
|
begin
|
|
inherited ppuwrite(ppufile);
|
|
inherited ppuwrite(ppufile);
|
|
- ppufile.putreal(value);
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-{****************************************************************************
|
|
|
|
- Tai_comp_64bit
|
|
|
|
- ****************************************************************************}
|
|
|
|
-
|
|
|
|
- constructor tai_comp_64bit.Create(_value : ts64comp);
|
|
|
|
-
|
|
|
|
- begin
|
|
|
|
- inherited Create;
|
|
|
|
- typ:=ait_comp_64bit;
|
|
|
|
- value:=_value;
|
|
|
|
|
|
+ ppufile.putbyte(byte(realtyp));
|
|
|
|
+{$ifdef ARM}
|
|
|
|
+ ppufile.putbyte(byte(formatoptions));
|
|
|
|
+{$endif ARM}
|
|
|
|
+ case realtyp of
|
|
|
|
+ aitrealconst_s32bit:
|
|
|
|
+ ppufile.putreal(value.s32val);
|
|
|
|
+ aitrealconst_s64bit:
|
|
|
|
+ ppufile.putreal(value.s64val);
|
|
|
|
+ aitrealconst_s80bit:
|
|
|
|
+ ppufile.putreal(value.s80val);
|
|
|
|
+ aitrealconst_s128bit:
|
|
|
|
+ ppufile.putreal(value.s128val);
|
|
|
|
+ aitrealconst_s64comp:
|
|
|
|
+ begin
|
|
|
|
+ c:=comp(value.s64compval);
|
|
|
|
+ ppufile.putint64(int64(c));
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ internalerror(2014050601);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
- constructor tai_comp_64bit.ppuload(t:taitype;ppufile:tcompilerppufile);
|
|
|
|
|
|
+ function tai_realconst.getcopy: tlinkedlistitem;
|
|
begin
|
|
begin
|
|
- inherited ppuload(t,ppufile);
|
|
|
|
- ppufile.putdata(value,sizeof(value));
|
|
|
|
|
|
+ result:=inherited getcopy;
|
|
|
|
+ tai_realconst(result).value:=value;
|
|
|
|
+ tai_realconst(result).realtyp:=realtyp;
|
|
|
|
+ tai_realconst(result).savesize:=savesize;
|
|
|
|
+{$ifdef ARM}
|
|
|
|
+ tai_realconst(result).formatoptions:=formatoptions;
|
|
|
|
+{$endif ARM}
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
- procedure tai_comp_64bit.ppuwrite(ppufile:tcompilerppufile);
|
|
|
|
|
|
+ function tai_realconst.datasize: word;
|
|
begin
|
|
begin
|
|
- inherited ppuwrite(ppufile);
|
|
|
|
- ppufile.getdata(value,sizeof(value));
|
|
|
|
|
|
+ case realtyp of
|
|
|
|
+ aitrealconst_s32bit:
|
|
|
|
+ result:=4;
|
|
|
|
+ aitrealconst_s64bit,
|
|
|
|
+ aitrealconst_s64comp:
|
|
|
|
+ result:=8;
|
|
|
|
+ aitrealconst_s80bit:
|
|
|
|
+ result:=10;
|
|
|
|
+ aitrealconst_s128bit:
|
|
|
|
+ result:=16;
|
|
|
|
+ else
|
|
|
|
+ internalerror(2014050603);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|