[Cfp-interest] exceptions and flags
Ian McIntosh
ianm at ca.ibm.com
Wed Jun 4 13:13:13 PDT 2014
In addition to trapping, the PowerPC architecture allows compilers to
detect any exceptions including underflow by using a slightly different
opcode then a conditional branch. If trapping on exceptions was already
turned on then doing it this way requires turning it off for the duration.
- Ian McIntosh IBM Canada Lab Compiler Back End Support
and Development
|------------>
| From: |
|------------>
>-----------------------------------------------------------------------------------------------------------------------------------------|
|Jim Thomas <jaswthomas at sbcglobal.net> |
>-----------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>-----------------------------------------------------------------------------------------------------------------------------------------|
|CFP <cfp-interest at ucbtest.org>, |
>-----------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>-----------------------------------------------------------------------------------------------------------------------------------------|
|2014-06-04 03:33 PM |
>-----------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>-----------------------------------------------------------------------------------------------------------------------------------------|
|Re: [Cfp-interest] exceptions and flags |
>-----------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Sent by: |
|------------>
>-----------------------------------------------------------------------------------------------------------------------------------------|
|cfp-interest-bounces at oakapple.net |
>-----------------------------------------------------------------------------------------------------------------------------------------|
So 754-2008 does not explicitly recommendation a means to detect underflow
exceptions, but its recommendation that languages provide alternate
exception handling entails detecting underflow exceptions. Maybe Part 5
could leave detection of tiny exact underflow cases as a recommended
option, which would allow the simpler slower implementation using flags.
-Jim
On Jun 3, 2014, at 9:32 PM, David Hough CFP <pcfp at oakapple.net> wrote:
>> Does all HW provide a way for SW to detect an underflow exception?
>
> The only way I know is to enable the underflow trap. If the trap works
> as recommended by 754-1985, then that suffices.
>
> But 754-1985 chapter 8 only recommends traps (to implementations) while
> 754-2008 chapter 8 only recommends alternate exception handling (to
languages).
> Alternate exception handling replaces traps as far as programming
environments
> go, but the traps are still a very likely implementation mechanism.
_______________________________________________
Cfp-interest mailing list
Cfp-interest at oakapple.net
http://mailman.oakapple.net/mailman/listinfo/cfp-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20140604/73f2386e/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20140604/73f2386e/attachment.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20140604/73f2386e/attachment-0001.gif
More information about the Cfp-interest
mailing list