[PATCH, middle-end]: Implement lrint and llrint functions as built-ins
Uros Bizjak
uros@kss-loka.si
Mon Mar 21 12:06:00 GMT 2005
Hello!
This patch implements lrint and llrint functions as built-in intrinsic
functions. Attached to this message is only a middle-end part. In a
followup message, an x87 implementation will be attached.
This patch was bootstrapped and regtested (together with x87
implementation) on i686-pc-linux-gnu, c and c++. A testcase that checks
new built-ins is also implemented.
OK for mainline?
2005-03-21 Uros Bizjak <uros@kss-loka.si>
* optabs.h (enum optab_index): Add new OTI_lrint and OTI_llrint.
(lrint_optab, llrint_optab): Define corresponding macros.
* optabs.c (init_optabs): Initialize lrint_optab and llrint_optab.
* genopinit.c (optabs): Implement lrint_optab using lrintsi2
pattern and llrint_optab using llrintdi2 patterns.
* builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LRINT{,F,L}
using lrint_optab and BUILT_IN_LLRINT{,F,L} using llrint_optab.
(expand_builtin): Expand BUILT_IN_LRINT{,F,L} and
BUILT_IN_LLRINT{,F,L} using expand_builtin_mathfn if
flag_unsafe_math_optimizations is set.
testsuite:
* gcc.dg/builtins-46.c: Also check lrint* and llrint*.
Uros.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lrint.diff_
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050321/5326d796/attachment.ksh>
More information about the Gcc-patches
mailing list