Question on arithmetic overflow detection support in C2
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev