This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH PR83789] Fix for Altivec builtin failure


Hi,
Please find below a patch to fix PR83789.
The altivec builtin '__builtin_altivec_lvx' fails for the 32-bit powerpc-linux target.
This is observed in gcc-7 onwards and does not affect powerpc64-linux target.

This is regression tested for powerpc-linux.
Please let me know if this patch is OK.

Regards,
Kaushik M Phatak

2018-02-01  Kaushik Phatak  <kaushik.phatak@kpit.com>

        PR target/83789
        * config/rs6000/rs6000.c (altivec_expand_builtin): Provide
           support for 32-bit target for altivec builtin.



Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 256400)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -15799,8 +15799,10 @@
 					exp, target, false);
     case ALTIVEC_BUILTIN_LVX:
     case ALTIVEC_BUILTIN_LVX_V4SI:
-      return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx_v4si_2op,
-					exp, target, false);
+      return altivec_expand_lv_builtin (((TARGET_64BIT)
+					 ? CODE_FOR_altivec_lvx_v4si_2op
+					 : CODE_FOR_altivec_lvx_v4si_internal),
+					   exp, target, false);
     case ALTIVEC_BUILTIN_LVX_V8HI:
       return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx_v8hi_2op,
 					exp, target, false);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]