summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/ninl.pas7
-rw-r--r--compiler/options.pas3
-rw-r--r--rtl/inc/systemh.inc5
3 files changed, 11 insertions, 4 deletions
diff --git a/compiler/ninl.pas b/compiler/ninl.pas
index f4138e874d..1185675d9f 100644
--- a/compiler/ninl.pas
+++ b/compiler/ninl.pas
@@ -2412,9 +2412,9 @@ implementation
if left.nodetype=ordconstn then
begin
if tordconstnode(left).value<0 then
- result:=cordconstnode.create((-tordconstnode(left).value),s32inttype,false)
+ result:=cordconstnode.create((-tordconstnode(left).value),resultdef,false)
else
- result:=cordconstnode.create((tordconstnode(left).value),s32inttype,false);
+ result:=cordconstnode.create((tordconstnode(left).value),resultdef,false);
end
end;
in_sqr_real :
@@ -3139,8 +3139,7 @@ implementation
in_abs_long:
begin
set_varstate(left,vs_read,[vsf_must_be_valid]);
- inserttypeconv(left,s32inttype);
- resultdef:=s32inttype;
+ resultdef:=left.resultdef;
end;
in_abs_real,
diff --git a/compiler/options.pas b/compiler/options.pas
index 8ee071dff9..035d40e847 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -2939,6 +2939,9 @@ begin
{ abs(long) is handled internally on all CPUs }
def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
+{$if defined(x86_64) or defined(powerpc64)}
+ def_system_macro('FPC_HAS_INTERNAL_ABS_INT64');
+{$endif x86_64 or powerpc64}
def_system_macro('FPC_HAS_UNICODESTRING');
def_system_macro('FPC_RTTI_PACKSET1');
diff --git a/rtl/inc/systemh.inc b/rtl/inc/systemh.inc
index 3bd0ed90fc..cbc3fae322 100644
--- a/rtl/inc/systemh.inc
+++ b/rtl/inc/systemh.inc
@@ -797,7 +797,12 @@ Function abs(l:longint):longint;[internproc:fpc_in_abs_long];
{$else FPC_HAS_INTERNAL_ABS_LONG}
Function abs(l:Longint):Longint;[internconst:fpc_in_const_abs];{$ifdef SYSTEMINLINE}inline;{$endif}
{$endif FPC_HAS_INTERNAL_ABS_LONG}
+{$ifdef FPC_HAS_INTERNAL_ABS_INT64}
+{$define FPC_SYSTEM_HAS_ABS_INT64}
+Function abs(l:Int64):Int64;[internproc:fpc_in_abs_long];
+{$else FPC_HAS_INTERNAL_ABS_INT64}
Function abs(l:Int64):Int64;[internconst:fpc_in_const_abs];{$ifdef SYSTEMINLINE}inline;{$endif}
+{$endif FPC_HAS_INTERNAL_ABS_INT64}
Function sqr(l:Longint):Longint;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
Function sqr(l:Int64):Int64;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
Function sqr(l:QWord):QWord;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}