Displaying 3 results from an estimated 3 matches for "minus_one_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
...mal
> normal:
> %div = sdiv %x, %y
>
> *** JavaScript, with "|0" ***
> %divbyzero_bit = cmp %y, 0
> br i1 %divbyzero_bit, label %division_by_zero, label %chkovf
> division_by_zero:
> br label %end
> chkovf:
> %tmin_bit = cmp %x, min<T>
> %minus_one_bit = cmp %y, -1
> %ovf_bit = and %tmin_bit, %minus_one_bit
> br i1 %ovf_bit, label %ovf, label %normal
> ovf:
> br label %end
> normal:
> %div.0 = sdiv %x, %y
> br label %end
> end:
> %div = phi [%div.0, %normal], [min<T>, %ovf], [0, %division_by_zero]
>...
2014 Apr 29
2
[LLVMdev] Proposal: add intrinsics for safe division
...JavaScript, with "|0" ***
>> %divbyzero_bit = cmp %y, 0
>> br i1 %divbyzero_bit, label %division_by_zero, label %chkovf
>> division_by_zero:
>> br label %end
>> chkovf:
>> %tmin_bit = cmp %x, min<T>
>> %minus_one_bit = cmp %y, -1
>> %ovf_bit = and %tmin_bit, %minus_one_bit
>> br i1 %ovf_bit, label %ovf, label %normal
>> ovf:
>> br label %end
>> normal:
>> %div.0 = sdiv %x, %y
>> br label %end
>> end:
>> %div =...