Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2013-06

FPC SoftFPU implementation

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Max Nazhalov

Some time ago I had to do a few hw-independent experiments with floating point, and faced with "./fpc/rtl/inc/softfpu.pp" unit. Its' current state is far from finishing of porting stage, so I had to make some changes to get it up and compile with originally foreseen functionality.

This is roughly a draft patch -- just conversion of unfinished porting of C-syntax; it omits some details like 'public'/'alias:'/'compilerproc' placing (since I have no idea about these modifiers). In addition, fixed several lost 'exit's, 'var'-modifier for 'shortShift128Left', some range-warnings..

Ambiguities were checked against "John R. Hauser's SoftFloat Release 2b". Missing parts were also ported from there. But almost no serious testing was performed yet by now due to lack of time.

Could this patch be reviewed and accepted/adapted/rejected?

---
WBR,
Max

Reply by email

Sven Barth
to Max Nazhalov
Max Nazhalov wrote 7 lines
Some time ago I had to do a few hw-independent experiments with floating point, and faced with "./fpc/rtl/inc/softfpu.pp" unit. Its' current state is far from finishing of porting stage, so I had to make some changes to get it up and compile with originally foreseen functionality. This is roughly a draft patch -- just conversion of unfinished porting of C-syntax; it omits some details like 'public'/'alias:'/'compilerproc' placing (since I have no idea about these modifiers). In addition, fixed several lost 'exit's, 'var'-modifier for 'shortShift128Left', some range-warnings.. Ambiguities were checked against "John R. Hauser's SoftFloat Release 2b". Missing parts were also ported from there. But almost no serious testing was performed yet by now due to lack of time. Could this patch be reviewed and accepted/adapted/rejected?

Would you please open an issue on bugs.freepascal.org for this and preferrably add an uncompressed .patch file. This way your patch won't be forgotten that easily. Thank you.

Regards,
Sven

Reply by email

Pierre Free Pascal
to Max Nazhalov: Some time ago I had to do a few hw-independent experiments with floating point, and faced…

Hi Max,

thank you for your contribution...
While testing it, I managed to fix another independent longstanding bug in softfpu.pp
(rev 24864) which fixes a int64<->single conversion error.

I must confess that it's been a long time since I last looked at the software fpu support code... thus I cannot make any prediction on the integration of your code in the compiler.

Pierre Muller

Show quoted text 9 lines
-----Message d'origine----- De : [mailto:fpc-devel- De la part de Max Nazhalov Envoyé : dimanche 9 juin 2013 18:22 À : Objet : [fpc-devel] FPC SoftFPU implementation Some time ago I had to do a few hw-independent experiments with floating point, and faced with "./fpc/rtl/inc/softfpu.pp" unit. Its' current state

is

far from finishing of porting stage, so I had to make some changes to get

it

up and compile with originally foreseen functionality. This is roughly a draft patch -- just conversion of unfinished porting of

C-

syntax; it omits some details like 'public'/'alias:'/'compilerproc'

placing

(since I have no idea about these modifiers). In addition, fixed several lost 'exit's, 'var'-modifier for 'shortShift128Left', some

range-warnings..

Ambiguities were checked against "John R. Hauser's SoftFloat Release 2b". Missing parts were also ported from there. But almost no serious testing

was

Show quoted text 7 lines
performed yet by now due to lack of time. Could this patch be reviewed and accepted/adapted/rejected? --- WBR, Max

Reply by email

Max Nazhalov

Wednesday, June 12, 2013, 4:00:52 AM, Florian wrote:

FK> Am 09.06.2013 18:22, schrieb Max Nazhalov:

> > Could this patch be reviewed and accepted/adapted/rejected?

FK> Thanks, I applied it and fixed a few more things.

Thanks a lot! Just two addition notes:

1. Catched another 4 missing exits

Index: softfpu.pp
===================================================================
--- softfpu.pp  (revision 24880)
+++ softfpu.pp  (working copy)
@@ -3468,6 +3468,7 @@
             End;
         end;
         float32_round_to_int.float32 := packFloat32( aSign, 0, 0 );
+        exit;
       End;
     lastBitMask := 1;
     {_____________________________!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
@@ -3774,6 +3775,7 @@
         if ( (aSig0) OR ( ( bExp = $FF ) AND  (bSig0) ) ) then
         Begin
             float32_mul.float32 := propagateFloat32NaN( a.float32, b.float32 );
+            exit;
         End;
         if ( ( bExp OR  bSig ) = 0 ) then
         Begin
@@ -3863,6 +3865,7 @@
             if ( bSig  0) then
             Begin
               float32_div.float32 := propagateFloat32NaN( a.float32, b.float32 );
+              exit;
             End;
             float_raise( float_flag_invalid );
             float32_div.float32 := float32_default_nan;
@@ -4849,6 +4852,7 @@
                exit;
             End;
             packFloat64( zSign, $7FF, 0, 0, out );
+            exit;
         End;
         if ( aExp = 0 ) then
         Begin

2. r24872 seems to revert r24864 by Pierre Muller (see above in mail list) -- was this intended?..

WBR, Max

Reply by email

Florian Klaempfl
to Max Nazhalov
Max Nazhalov wrote 11 lines
Wednesday, June 12, 2013, 4:00:52 AM, Florian wrote: FK> Am 09.06.2013 18:22, schrieb Max Nazhalov: >> >> Could this patch be reviewed and accepted/adapted/rejected? FK> Thanks, I applied it and fixed a few more things. Thanks a lot! Just two addition notes: 1. Catched another 4 missing exits

Thanks, applied.

2. r24872 seems to revert r24864 by Pierre Muller (see above in mail list) -- was this intended?..

This was a mistake, I fixed it.

Reply by email