[PATCH][AVX512] Fix rounding operand.

Uros Bizjak ubizjak@gmail.com
Thu Jan 30 16:22:00 GMT 2014


On Thu, Jan 30, 2014 at 1:50 PM, Ilya Tocar <tocarip.intel@gmail.com> wrote:

> I've found some problems with embedded rounding implementation.
> First constants are already defined in smmintrin.h, so we shouldn't
> redefine them.
> Second problem is bigger: currently rounding argument to intrinsic
> is one of _MM_FROUND_TO_NEAREST_INT, _MM_FROUND_TO_NEG_INF,
> _MM_FROUND_TO_POS_INF, _MM_FROUND_TO_ZERO, _MM_FROUND_CUR_DIRECTION,
> _MM_FROUND_NO_EXC, but actually it should be
> _MM_FROUND_NO_EXC or _MM_FROUND_CUR_DIRECTION for SAE and
> _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC for rounding. That's
> how Icc does it, because while currently rounding implies sae it may be
> not true in future. I've splited rounding and sae in print_operand into
> 'R' and 'r' because we can't distinguish between 8 and 8 | 0. I've
> also run sed on tests to correct rounding arguments. While patch is huge
> most of it is result of sed. It bootstraps, passes make check/SPEC2006.i
> Ok for trunk?
>
> Here is ChangeLog.
>
> 2014-01-30  Ilya Tocar  <ilya.tocar@intel.com>
>
>         * config/i386/avx512fintrin.h (_MM_FROUND_TO_NEAREST_INT),
>         (_MM_FROUND_TO_NEG_INF), (_MM_FROUND_TO_POS_INF),
>         (_MM_FROUND_TO_ZERO), (_MM_FROUND_CUR_DIRECTION): Are already defined
>         in smmintrin.h, remove them.
>         (_MM_FROUND_NO_EXC): Same as above, bit also wrong value.
>         * config/i386/i386.c (ix86_print_operand): Split sae and rounding.
>         * config/i386/i386.md (ROUND_SAE): Fix value.
>         * config/i386/predicates.md (const_4_or_8_to_11_operand): New.
>         (const48_operand): New.
>         * config/i386/subst.md (round), (round_expand): Use
>         const_4_or_8_to_11_operand.
>         (round_saeonly), (round_saeonly_expand): Use const48_operand.
>
> 2014-01-30  Ilya Tocar  <ilya.tocar@intel.com>
>
>         * gcc.target/i386/avx-1.c: Use correct rounding values.
>         * gcc.target/i386/avx512f-vaddpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vaddps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vaddsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vaddss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtdq2ps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtpd2dq-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtpd2ps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtpd2udq-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtps2dq-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtps2udq-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtsd2si-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtsd2si64-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtsd2ss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtsd2usi-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtsd2usi64-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtsi2sd64-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtsi2ss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtsi2ss64-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtss2si-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtss2si64-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtss2usi-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtss2usi64-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtudq2ps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtusi2sd64-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtusi2ss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vcvtusi2ss64-1.c: Ditto.
>         * gcc.target/i386/avx512f-vdivpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vdivps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vdivsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vdivss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmaddXXXpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmaddXXXps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmaddXXXsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmaddXXXss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmaddsubXXXpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmaddsubXXXps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmsubXXXpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmsubXXXps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmsubXXXsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmsubXXXss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmsubaddXXXpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfmsubaddXXXps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfnmaddXXXpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfnmaddXXXps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfnmaddXXXsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfnmaddXXXss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfnmsubXXXpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfnmsubXXXps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfnmsubXXXsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vfnmsubXXXss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vmulpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vmulps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vmulsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vmulss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vscalefpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vscalefps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vscalefsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vscalefss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vsqrtpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vsqrtps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vsqrtsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vsqrtss-1.c: Ditto.
>         * gcc.target/i386/avx512f-vsubpd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vsubps-1.c: Ditto.
>         * gcc.target/i386/avx512f-vsubsd-1.c: Ditto.
>         * gcc.target/i386/avx512f-vsubss-1.c: Ditto.
>         * gcc.target/i386/sse-13.c: Ditto.
>         * gcc.target/i386/sse-14.c: Ditto.
>         * gcc.target/i386/sse-22.c: Ditto.
>         * gcc.target/i386/sse-23.c: Ditto.

OK, at least the non-trivial part. I gave up on the mechanical part.

Thanks,
Uros.



More information about the Gcc-patches mailing list