search for: safediv

Displaying 5 results from an estimated 5 matches for "safediv".

2014 Apr 25
2
[LLVMdev] Proposal: add intrinsics for safe division
... Instead of returning an i1 flag for all overflow cases, you could return an i2 status enum that says 0 for neither overflow condition, 1 for x/0, and 2 for INT_MIN/-1.  Then, you get the following matrix for how Java and JavaScript would map to this and how it would be lowered: - Java on x86: use safediv and check if the if the status is 1.  If it's 1 then throw.  This lowers to a bunch of branches fairly late in the backend. - JavaScript on x86 with |0: use safediv and ignore the status.  Also loweres to a bunch of branches, which is as good as as it gets. - JavaScript on x86 without |0: use...
2014 Apr 25
4
[LLVMdev] Proposal: add intrinsics for safe division
On April 25, 2014 at 9:52:35 AM, Eric Christopher (echristo at gmail.com) wrote: Hi Michael, > I’d like to propose to extend LLVM IR intrinsics set, adding new ones for > safe-division. There are intrinsics for detecting overflow errors, like > sadd.with.overflow, and the intrinsics I’m proposing will augment this set. > > The new intrinsics will return a structure with two
2014 Apr 25
3
[LLVMdev] Proposal: add intrinsics for safe division
...istore, where the consensus was that we'd rather have explicit null checks and branches. Lol.  Since you brought that up, I figure I might as well throw this out: probably some VMs will want a guaranteed trap on divide-by-zero as a free way of throwing the exception.  I actually think that the safediv intrinsic would ultimately make this easier.  The client would generate code like "if (extractelement (safediv (...), 1) == 1) trap" and that could be pattern-matched to mean "emit code that deterministically traps on divide by zero".  I don't think we have the vocabulary ne...
2014 Apr 24
4
[LLVMdev] Proposal: add intrinsics for safe division
...are welcome. Best regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140424/f5c7111f/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: 1-safediv-intrinsics.patch Type: application/octet-stream Size: 28806 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140424/f5c7111f/attachment.obj> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermai...
2014 Apr 26
2
[LLVMdev] Proposal: add intrinsics for safe division
I am very much in favor of having a div instruction with well defined div-by-zero and overflow behavior. The undefined behavior on certain values for LLVM intrinsics has been a major pain point for us in Julia, because adding the extra branches just kills performance and we know that there is an X86 instruction that just does what we want. Anyway, this was brought up briefly above, but want to