[llvm-commits] llvm-gcc: implement CEIL_DIV_EXPR

Duncan Sands baldrick at free.fr
Fri Apr 13 12:21:10 PDT 2007


CEIL_DIV_EXPR performs integer division with rounding
towards positive infinity, thus 3 cdiv 2 = 2 while
-3 cdiv 2 = -1.  Testing is tricky, because CEIL_DIV_EXPR
is only generated in unusual circumstances, giving little
coverage, so I modified the llvm- and mainline gcc compilers
to output CEIL_DIV_EXPR for normal division, and compared
the results for all possible signed and unsigned i8 values
for the left- and right-hand sides.

Best wishes,

Duncan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ceil_div_expr.diff
Type: text/x-diff
Size: 5225 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070413/e7256eb5/attachment.diff>


More information about the llvm-commits mailing list