flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > fp data expressions

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4238
Location: 2018
edfed
while trying to code for FPu, i saw that it is unpossible to make math expressions to declare FP datas.
Code:
dq ((0.1*2.5654)/516 -45)*12+constant
;returns an error.
    
Post 04 Dec 2007, 00:55
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
You are telling this as a bug or feature request?
Post 04 Dec 2007, 01:11
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4238
Location: 2018
edfed
feature request.
it's not a bug because it's not provided by FASM Sad
Post 04 Dec 2007, 01:17
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
yes. FP data operations are not so easy to implement, and might be potential threat to SSSO principe.

My suggestion is to precompute value and use comment.
Post 04 Dec 2007, 01:18
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:

and might be potential threat to SSSO principe.

How? as an assembler which has an 80386 as minimun requirement then it would be implemented with no FPU so there is no room for minimun discrepancies that can be found between CPU (or emulators) vendors or even differencies between CPU models of same vendor.
Post 04 Dec 2007, 01:33
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Loco: FASM doesn't use FPU, it uses custom FP format, to assure result is precise. (I know because Tomasz's code "inspired" me in fp2a and a2fp routines for FASMLIB, and for bignum article too.). FASM has to use custom format, because you can't do bunch of operations with 64bit mantissa and then expect all 64bits of result to be valid.

You are right, I said it wrong. It would cause loss of precision. If all FPUs are quaranteed to give same result for same input, then SSSO wouldn't be broken.
Post 04 Dec 2007, 01:43
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:

Loco: FASM doesn't use FPU

I've never said it uses FPU and also discouraged the idea of using it because of the minimal FPU implementation differencies and the fact that it would add an extra minimun requirement. I have said implementing it with no FPU (no FPU instructions at all).
Post 04 Dec 2007, 02:01
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
sorry, misread your post.

Implementing something like "custom FP format division" would be really hell i quess. Multiplication is feasible, addition and subtraction is easy.

I am not sure, maybe tomasz with his maths knows some way how to do division "easy way" too, but I don't. I would file this as feature request, but reality is that there are many more important things to come, so I would postpone this until those are done.
Post 04 Dec 2007, 02:16
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.