Hello!

Attached patch fixes omission from "(int) rint ()" conversion to
__builtin_irint (). We can vectorize this function when out_mode is
SImode, no matter how the builtin is called. Throw in also
BUILT_IN_LLRINT, just for completion ...

2011-11-07  Uros Bizjak  <ubiz...@gmail.com>

        * config/i386/i386.c (ix86_builtin_vectorized_function): Handle
        BUILT_IN_IRINT, BUILT_IN_IRINTF, BUILT_IN_LLRINT and BUILT_IN_LLRINTF.

Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu
{,-m32}, committed to mainline SVN.

BTW: It would be nice if convert.c also converted "(int) lrint ()" to
__builtin_lrint (), but this is somehow beyond my middle-end skills...

Uros.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c  (revision 181110)
+++ config/i386/i386.c  (working copy)
@@ -29268,13 +29268,17 @@ ix86_builtin_vectorized_function (tree fndecl, tre
        }
       break;
 
+    case BUILT_IN_IRINT:
     case BUILT_IN_LRINT:
+    case BUILT_IN_LLRINT:
       if (out_mode == SImode && out_n == 4
          && in_mode == DFmode && in_n == 2)
        return ix86_builtins[IX86_BUILTIN_VEC_PACK_SFIX];
       break;
 
+    case BUILT_IN_IRINTF:
     case BUILT_IN_LRINTF:
+    case BUILT_IN_LLRINTF:
       if (out_mode == SImode && in_mode == SFmode)
        {
          if (out_n == 4 && in_n == 4)

Reply via email to