mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 01:49:20 +02:00
* val, str and read/write(ln) now use is_oversizedint/ord to determine which helper function to use; this also clears the warnings that prevented compilation of the 64-bit targets
git-svn-id: branches/i8086@24092 -
This commit is contained in:
parent
9c435a0bcb
commit
526c3b9c9b
@ -159,26 +159,25 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function get_str_int_func(ordtype: tordtype): string;
|
function get_str_int_func(def: tdef): string;
|
||||||
const
|
const
|
||||||
{$if defined(cpu64bitaddr)}
|
{$if defined(cpu64bitaddr)}
|
||||||
oversized_types = [];
|
|
||||||
highest_unsigned_type = u64bit;
|
highest_unsigned_type = u64bit;
|
||||||
{$elseif defined(cpu32bitaddr)}
|
{$elseif defined(cpu32bitaddr)}
|
||||||
oversized_types = [scurrency,s64bit,u64bit];
|
|
||||||
highest_unsigned_type = u32bit;
|
highest_unsigned_type = u32bit;
|
||||||
{$elseif defined(cpu16bitalu)}
|
{$elseif defined(cpu16bitalu)}
|
||||||
oversized_types = [scurrency,s64bit,u64bit,s32bit,u32bit];
|
|
||||||
highest_unsigned_type = u16bit;
|
highest_unsigned_type = u16bit;
|
||||||
{$elseif defined(cpu8bitalu)}
|
{$elseif defined(cpu8bitalu)}
|
||||||
oversized_types = [scurrency,s64bit,u64bit,s32bit,u32bit,s16bit,u16bit];
|
|
||||||
highest_unsigned_type = u8bit;
|
highest_unsigned_type = u8bit;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
var
|
||||||
|
ordtype: tordtype;
|
||||||
begin
|
begin
|
||||||
|
ordtype := torddef(def).ordtype;
|
||||||
if not (ordtype in [scurrency,s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then
|
if not (ordtype in [scurrency,s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then
|
||||||
internalerror(2013032603);
|
internalerror(2013032603);
|
||||||
|
|
||||||
if ordtype in oversized_types then
|
if is_oversizedord(def) then
|
||||||
begin
|
begin
|
||||||
case ordtype of
|
case ordtype of
|
||||||
scurrency,
|
scurrency,
|
||||||
@ -375,7 +374,7 @@ implementation
|
|||||||
bool8bit,bool16bit,bool32bit,bool64bit:
|
bool8bit,bool16bit,bool32bit,bool64bit:
|
||||||
procname := procname + 'bool';
|
procname := procname + 'bool';
|
||||||
else
|
else
|
||||||
procname := procname + get_str_int_func(torddef(source.resultdef).ordtype);
|
procname := procname + get_str_int_func(source.resultdef);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ for ansistrings insert the encoding argument }
|
{ for ansistrings insert the encoding argument }
|
||||||
@ -565,22 +564,15 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure get_read_write_int_func(ordtype: tordtype; out func_suffix: string; out readfunctype: tdef);
|
procedure get_read_write_int_func(def: tdef; out func_suffix: string; out readfunctype: tdef);
|
||||||
const
|
var
|
||||||
{$if defined(cpu64bitaddr)}
|
ordtype: tordtype;
|
||||||
oversized_types = [];
|
|
||||||
{$elseif defined(cpu32bitaddr)}
|
|
||||||
oversized_types = [s64bit,u64bit];
|
|
||||||
{$elseif defined(cpu16bitalu)}
|
|
||||||
oversized_types = [s64bit,u64bit,s32bit,u32bit];
|
|
||||||
{$elseif defined(cpu8bitalu)}
|
|
||||||
oversized_types = [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit];
|
|
||||||
{$endif}
|
|
||||||
begin
|
begin
|
||||||
|
ordtype := torddef(def).ordtype;
|
||||||
if not (ordtype in [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then
|
if not (ordtype in [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then
|
||||||
internalerror(2013032601);
|
internalerror(2013032601);
|
||||||
|
|
||||||
if ordtype in oversized_types then
|
if is_oversizedint(def) then
|
||||||
begin
|
begin
|
||||||
case ordtype of
|
case ordtype of
|
||||||
s64bit:
|
s64bit:
|
||||||
@ -733,7 +725,7 @@ implementation
|
|||||||
u32bit,
|
u32bit,
|
||||||
u64bit:
|
u64bit:
|
||||||
begin
|
begin
|
||||||
get_read_write_int_func(Torddef(para.left.resultdef).ordtype,func_suffix,readfunctype);
|
get_read_write_int_func(para.left.resultdef,func_suffix,readfunctype);
|
||||||
name := procprefixes[do_read]+func_suffix;
|
name := procprefixes[do_read]+func_suffix;
|
||||||
end;
|
end;
|
||||||
uchar :
|
uchar :
|
||||||
@ -1372,22 +1364,15 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function get_val_int_func(ordtype: tordtype): string;
|
function get_val_int_func(def: tdef): string;
|
||||||
const
|
var
|
||||||
{$if defined(cpu64bitaddr)}
|
ordtype: tordtype;
|
||||||
oversized_types = [];
|
|
||||||
{$elseif defined(cpu32bitaddr)}
|
|
||||||
oversized_types = [s64bit,u64bit];
|
|
||||||
{$elseif defined(cpu16bitalu)}
|
|
||||||
oversized_types = [s64bit,u64bit,s32bit,u32bit];
|
|
||||||
{$elseif defined(cpu8bitalu)}
|
|
||||||
oversized_types = [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit];
|
|
||||||
{$endif}
|
|
||||||
begin
|
begin
|
||||||
|
ordtype := torddef(def).ordtype;
|
||||||
if not (ordtype in [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then
|
if not (ordtype in [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then
|
||||||
internalerror(2013032603);
|
internalerror(2013032603);
|
||||||
|
|
||||||
if ordtype in oversized_types then
|
if is_oversizedint(def) then
|
||||||
begin
|
begin
|
||||||
case ordtype of
|
case ordtype of
|
||||||
s64bit: exit('int64');
|
s64bit: exit('int64');
|
||||||
@ -1537,7 +1522,7 @@ implementation
|
|||||||
s8bit,s16bit,s32bit,s64bit,
|
s8bit,s16bit,s32bit,s64bit,
|
||||||
u8bit,u16bit,u32bit,u64bit:
|
u8bit,u16bit,u32bit,u64bit:
|
||||||
begin
|
begin
|
||||||
suffix := get_val_int_func(torddef(destpara.resultdef).ordtype) + '_';
|
suffix := get_val_int_func(destpara.resultdef) + '_';
|
||||||
{ we also need a destsize para in the case of sint }
|
{ we also need a destsize para in the case of sint }
|
||||||
if suffix = 'sint_' then
|
if suffix = 'sint_' then
|
||||||
sizepara := ccallparanode.create(cordconstnode.create
|
sizepara := ccallparanode.create(cordconstnode.create
|
||||||
|
Loading…
Reference in New Issue
Block a user