On Wed, Mar 16, 2011 at 7:56 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
>>> Attached [RFC] patch vectorizes calls to floor, ceil, trunc and rint >>> (and their float variants) functions using roundps/roundpd SSE4.1 >>> instruction. >>> >>> 2011-02-27 Uros Bizjak <ubiz...@gmail.com> >>> >>> * config/i386/i386.md (ROUND_FLOOR): New constant. >>> (ROUND_CEIL): Ditto. >>> (ROUND_TRUNC): Ditto. >>> (ROUND_MXCSR): Ditto. >>> (ROUND_NO_EXC): Ditto. >>> (rint<mode>2): Use new defines instead of numerical constant. >>> (floor<mode>2): Ditto. >>> (ceil<mode>2): Ditto. >>> (btrunc<mode>2): Ditto. >>> * config/i386/i386-builtin-types.def: Define ROUND function type >>> aliases. >>> * config/i386/i386.c (enum ix86_builtins): Add >>> IX86_BUILTIN_{FLOOR,CEIL,TRUNC,RINT}{PS,PD}{,256} defines. >>> (struct builtin_description): Add >>> __builtin_ia32_{floor,ceil,trunc,rint}{pd,ps}{,256} descriptions. >>> (ix86_expand_sse_round): New static function. >>> (ix86_expand_args_builtin): Call ix86_expand_sse_round for ROUND >>> function types. >>> (ix86_builtin_vectorized_function): Handle >>> BUILT_IN_{FLOOR,CEIL,TRUNC,RINT}{,F} builtins. >>> >>> Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu >>> (--with-fpmath=avx). Currently, it does not include test cases, but it >>> is RFC at this gcc development stage anyway. >> >> This caused: >> >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48154 >> >> We need to check TARGET_ROUND before using __builtin_ia32_truncps. > > This patch fixes the compilation. OK for trunk? > > Thanks. > > > -- > H.J. > --- > 2011-03-16 H.J. Lu <hongjiu...@intel.com> > > PR target/48154 > * config/i386/i386.c (ix86_builtin_vectorized_function): Check > TARGET_ROUND for BUILT_IN_{FLOOR,CEIL,TRUNC,RINT}{,F} builtins. This is OK. Thanks, Uros.