Question on arithmetic overflow detection support in C2
John Rose
john.r.rose at oracle.com
Tue Jun 19 00:55:13 PDT 2012
On Jun 18, 2012, at 9:38 PM, Vladimir Kozlov wrote:
> will be difficult. Almost all data nodes produce only one result and this rule is used in all parts of C2 (from parser to RA).
Yes; we won't have a good story for producing multiple values from IR nodes.
But, for a workaround to this, look at UseDivMod. The idea is to let the IR nodes for the two results float separately, and fuse them when convenient at the end of the compilation.
In this pattern, consider paired node types:
AddI(a, b): I
AddIOverflow(a, b): I
It's probably not necessary to change the semantics of Bool. Just do something like this:
If(Bool(ne, AddIOverflow(a, b)))
The AddIOverflow works like a CmpI, and produces condition codes. There's no need for special ov conditions, IMO.
The "magic" for accessing the HW overflow bit can be specified in a AD file match rule that recognizes a Bool and an AddIOverflow next to each other.
— John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120619/f630e648/attachment.html
More information about the hotspot-compiler-dev
mailing list