[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - Which instructions raise FPU exceptions?

Which instructions raise FPU exceptions?

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

Which instructions raise FPU exceptions?

Postby alexrp » Thu Jan 23, 2014 2:18 pm

It's stated under what circumstances FPU exceptions are raised, but it's not clear which instructions actually do it. I'm inclined to think all floating point instructions (in FPU mode) except for FLOAT and FIX. Is this accurate? If so, this ought to be documented.
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: Which instructions raise FPU exceptions?

Postby timpart » Fri Jan 24, 2014 7:23 am

Well based on Floating Point, rather than definite knowledge of the chip

FABS Only raises invalid since the exponent doesn't change and over/underflow impossible

FADD / FSUB All. Overflow with large numbers of same sign, underflow with very small non zero numbers of opposite sign.

FMUL All Overflow if sum of exponents too large, underflow if too small.

FMAD / FMSUB All since they are based on the above

FIX Invalid possible, Overflow too if won't fit in an integer, but description of when this happens is wrong I presume. Underflow if non zero but < 1 ? Description is wrong.

FLOAT None I presume. I think Andreas commented on this one previously. Perhaps he can confirm or deny my comments above.

Tim
timpart
 
Posts: 302
Joined: Mon Dec 17, 2012 3:25 am
Location: UK

Re: Which instructions raise FPU exceptions?

Postby alexrp » Tue Feb 04, 2014 1:51 pm

Thanks Tim!

@aolofsson can you chime in here too?
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: Which instructions raise FPU exceptions?

Postby aolofsson » Wed Feb 05, 2014 2:05 pm

Sorry for the delay! Thanks Tim for the analysis, I tried to write the rules based on generic input/results below. Let me know if it helps.

Invalid Exception:
-When there is a NAN input (for all floating point instructions (not FIX/FLOAT)
-When the input to FIX instruction is infinity

Underflow Exception
-When the result is denormal (for all floating point instructions, not FIX/FLOAT)
-When input to FIX instruction is denormal

Overflow Exception
-When result is infinity, but inputs are not (for all floating point instructions, not FIX/FLOAT)
-When input to FIX operation is out of range

(no exceptions for FLOAT instruction)

Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Which instructions raise FPU exceptions?

Postby alexrp » Wed Feb 05, 2014 8:20 pm

Excellent. Thanks!
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: Which instructions raise FPU exceptions?

Postby alexrp » Sat Feb 08, 2014 1:10 am

Actually, four more questions:

1. What does out of range mean for FIX?
2. I assume that even though FIX can raise exceptions, it should still return sensible results as documented?
3. For FMADD/FMSUB, regarding overflow, the RD value before the computation counts as an input to consider for infinity, right?
4. Does FABS raise exceptions as the other instructions? I somehow got the impression that this instruction is special, but I might just be making that up. :)
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: Which instructions raise FPU exceptions?

Postby aolofsson » Tue Feb 11, 2014 4:39 am

1. What does out of range mean for FIX?
A:(means that the floating point value cannot be expressed with a fixed point number)
2. I assume that even though FIX can raise exceptions, it should still return sensible results as documented?
A:(probably returns infinity..will need to check)
3. For FMADD/FMSUB, regarding overflow, the RD value before the computation counts as an input to consider for infinity, right?
A:(yes)
4. Does FABS raise exceptions as the other instructions? I somehow got the impression that this instruction is special, but I might just be making that up. :)
A:Like a regular floating point instruction but with less inputs
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Which instructions raise FPU exceptions?

Postby alexrp » Tue Feb 11, 2014 7:54 am

Regarding (1), does that just mean NaN then? All other cases (denormal, infinity) are covered by invalid/underflow, right?
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: Which instructions raise FPU exceptions?

Postby timpart » Tue Feb 11, 2014 12:24 pm

timpart
 
Posts: 302
Joined: Mon Dec 17, 2012 3:25 am
Location: UK

Re: Which instructions raise FPU exceptions?

Postby alexrp » Tue Feb 11, 2014 2:09 pm

The behavior of FIX in general is actually quite the mystery to me.

https://github.com/adapteva/epiphany-gd ... -fp.c#L526

This seems to contradict the manual in several ways...
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Next

Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 2 guests

cron