mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-05 09:27:40 +02:00
* SPARC: SetExceptionMask and SetRoundingMode must return the old value of mask/mode respectively, not the new one.
git-svn-id: trunk@27218 -
This commit is contained in:
parent
67a8c315d8
commit
295e795a0a
@ -22,9 +22,12 @@ function GetRoundMode: TFPURoundingMode;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode;
|
function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode;
|
||||||
|
var
|
||||||
|
cw: dword;
|
||||||
begin
|
begin
|
||||||
set_fsr((get_fsr and $3fffffff) or (dword(RoundMode) shl 30));
|
cw:=get_fsr;
|
||||||
result:=TFPURoundingMode(get_fsr shr 30);
|
result:=TFPURoundingMode(cw shr 30);
|
||||||
|
set_fsr((cw and $3fffffff) or (dword(RoundMode) shl 30));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -40,11 +43,8 @@ function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function GetExceptionMask: TFPUExceptionMask;
|
function FSR2ExceptionMask(fsr: dword): TFPUExceptionMask;
|
||||||
var
|
|
||||||
fsr : dword;
|
|
||||||
begin
|
begin
|
||||||
fsr:=get_fsr;
|
|
||||||
result:=[];
|
result:=[];
|
||||||
{ invalid operation: bit 27 }
|
{ invalid operation: bit 27 }
|
||||||
if (fsr and (1 shl 27))=0 then
|
if (fsr and (1 shl 27))=0 then
|
||||||
@ -68,12 +68,18 @@ function GetExceptionMask: TFPUExceptionMask;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function GetExceptionMask: TFPUExceptionMask;
|
||||||
|
begin
|
||||||
|
result:=FSR2ExceptionMask(get_fsr);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask;
|
function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask;
|
||||||
var
|
var
|
||||||
fsr : dword;
|
fsr : dword;
|
||||||
begin
|
begin
|
||||||
fsr:=get_fsr;
|
fsr:=get_fsr;
|
||||||
|
result:=FSR2ExceptionMask(fsr);
|
||||||
|
|
||||||
{ invalid operation: bit 27 }
|
{ invalid operation: bit 27 }
|
||||||
if (exInvalidOp in mask) then
|
if (exInvalidOp in mask) then
|
||||||
|
Loading…
Reference in New Issue
Block a user