https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100312

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 50699
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50699&action=edit
not working patch

This one misses the RTL expansion part.  I'm too lazy to writing duplicate code
to handle this.  The following works but is a bit ugly.  Meh, the builtins
stuff _is_ ugly (adding extra flags to bdesc would be nicer but a lot of
boiler-plate work and the question is whether all the rest is "nice enough"
or in need of serious overhaul anyway...)

diff --git a/gcc/config/i386/i386-builtins.c b/gcc/config/i386/i386-builtins.c
index 128bd39816c..fa05cd6cf65 100644
--- a/gcc/config/i386/i386-builtins.c
+++ b/gcc/config/i386/i386-builtins.c
@@ -521,7 +521,17 @@ ix86_init_mmx_sse_builtins (void)
        continue;

       ftype = (enum ix86_builtin_func_type) d->flag;
-      def_builtin (d->mask, d->mask2, d->name, ftype, d->code);
+      if (d->code == IX86_BUILTIN_MASKLOADPD
+         || d->code == IX86_BUILTIN_MASKLOADPS
+         || d->code == IX86_BUILTIN_MASKLOADPD256
+         || d->code == IX86_BUILTIN_MASKLOADPS256
+         || d->code == IX86_BUILTIN_MASKLOADD
+         || d->code == IX86_BUILTIN_MASKLOADQ
+         || d->code == IX86_BUILTIN_MASKLOADD256
+         || d->code == IX86_BUILTIN_MASKLOADQ256)
+       def_builtin_pure (d->mask, d->mask2, d->name, ftype, d->code);
+      else
+       def_builtin (d->mask, d->mask2, d->name, ftype, d->code);
     }
   BDESC_VERIFYS (IX86_BUILTIN__BDESC_SPECIAL_ARGS_LAST,
                 IX86_BUILTIN__BDESC_SPECIAL_ARGS_FIRST,

Reply via email to