r333865 - [X86] Fix a couple places that were using macro arguments twice when of the usages could just be undefined.

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 3 19:56:18 PDT 2018


Author: ctopper
Date: Sun Jun  3 19:56:18 2018
New Revision: 333865

URL: http://llvm.org/viewvc/llvm-project?rev=333865&view=rev
Log:
[X86] Fix a couple places that were using macro arguments twice when of the usages could just be undefined.

One of the arguments was being used when the passthru argument is unused due to the mask being all 1s. But in that case the actual value doesn't matter so we should use undef instead to avoid expanding the macro argument unnecessarily.

Modified:
    cfe/trunk/lib/Headers/avx512fintrin.h

Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=333865&r1=333864&r2=333865&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Sun Jun  3 19:56:18 2018
@@ -2519,7 +2519,8 @@ _mm512_maskz_div_ps(__mmask16 __U, __m51
 
 #define _mm512_roundscale_ps(A, B) \
   (__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(A), (int)(B), \
-                                         (__v16sf)(__m512)(A), (__mmask16)-1, \
+                                         (__v16sf)_mm512_undefined_ps(), \
+                                         (__mmask16)-1, \
                                          _MM_FROUND_CUR_DIRECTION)
 
 #define _mm512_mask_roundscale_ps(A, B, C, imm) \
@@ -2550,7 +2551,8 @@ _mm512_maskz_div_ps(__mmask16 __U, __m51
 
 #define _mm512_roundscale_pd(A, B) \
   (__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(A), (int)(B), \
-                                          (__v8df)(__m512d)(A), (__mmask8)-1, \
+                                          (__v8df)_mm512_undefined_pd(), \
+                                          (__mmask8)-1, \
                                           _MM_FROUND_CUR_DIRECTION)
 
 #define _mm512_mask_roundscale_pd(A, B, C, imm) \




More information about the cfe-commits mailing list