Displaying 3 results from an estimated 3 matches for "divbyzero_bit".
2014 Apr 26
3
[LLVMdev] Proposal: add intrinsics for safe division
On Apr 25, 2014, at 2:21 PM, Eric Christopher <echristo at gmail.com> wrote:
>> In short, I agree with your observations that these intrinsics are not an
>> obvious slam-dunk compared to making the explicit control flow, but I think
>> that the intrinsics do give enough flexibility on the LLVM side that it
>> would be great if front-ends used them rather than rolling
2014 Apr 26
2
[LLVMdev] Proposal: add intrinsics for safe division
...e of the intrinsics (here I omit types for
> conciseness, assuming result type of the safe.sdiv intrinsic being {i32,
> i1, i1}) :
>
> *** C/C-like ***
> %div = sdiv %x, %y
>
> *** Java, Go ***
> %divr = call %safe.sdiv(%x, %y)
> %div = extractvalue %divr, 0
> %divbyzero_bit = extractvalue %divr, 1
> br i1 %divbyzero_bit, label %throw, label %normal
>
> *** JavaScript, with "|0" ***
> %divr = call %safe.sdiv(%x, %y)
> %div = extractvalue %divr, 0
>
> *** JavaScript without "|0", Ruby and maybe others ***
> %divr = cal...
2014 Apr 29
2
[LLVMdev] Proposal: add intrinsics for safe division
...uming result type of the safe.sdiv
>> intrinsic being {i32, i1, i1}) :
>>
>> *** C/C-like ***
>> %div = sdiv %x, %y
>>
>> *** Java, Go ***
>> %divr = call %safe.sdiv(%x, %y)
>> %div = extractvalue %divr, 0
>> %divbyzero_bit = extractvalue %divr, 1
>> br i1 %divbyzero_bit, label %throw, label %normal
>>
>> *** JavaScript, with "|0" ***
>> %divr = call %safe.sdiv(%x, %y)
>> %div = extractvalue %divr, 0
>>
>> *** JavaScript without "|0&quo...