about summary refs log tree commit diff
path: root/sysdeps/tile/tilegx/strchr.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@mellanox.com>2017-12-05 10:24:56 -0500
committerChris Metcalf <cmetcalf@mellanox.com>2017-12-05 10:24:56 -0500
commitf18b8dc7d7ef3f01804e241d40f92faf480264c0 (patch)
treeafdff9b17e2e45a11f18d5ea87a22c6705949d73 /sysdeps/tile/tilegx/strchr.c
parent446d22e91d3113be57a4b0d1151cf337458c3bec (diff)
downloadglibc-f18b8dc7d7ef3f01804e241d40f92faf480264c0.tar.gz
glibc-f18b8dc7d7ef3f01804e241d40f92faf480264c0.tar.xz
glibc-f18b8dc7d7ef3f01804e241d40f92faf480264c0.zip
tilegx: work around vector insn bug in gcc
Avoid an issue in gcc where some of the vector (aka SIMD) ops will
sometimes end up getting wrongly optimized out.  We use these
instructions in many of the string implementations.  If/when we
have an upstreamed fix for this problem in gcc we can conditionalize
the use of the extended assembly workaround in glibc.
Diffstat (limited to 'sysdeps/tile/tilegx/strchr.c')
-rw-r--r--sysdeps/tile/tilegx/strchr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/tile/tilegx/strchr.c b/sysdeps/tile/tilegx/strchr.c
index 36dfd31391..1a5eb5c927 100644
--- a/sysdeps/tile/tilegx/strchr.c
+++ b/sysdeps/tile/tilegx/strchr.c
@@ -38,16 +38,16 @@ strchr (const char *s, int c)
      match neither zero nor goal (we make sure the high bit of each byte
      is 1, and the low 7 bits are all the opposite of the goal byte).  */
   const uint64_t before_mask = MASK (s_int);
-  uint64_t v = (*p | before_mask) ^ (goal & __insn_v1shrui (before_mask, 1));
+  uint64_t v = (*p | before_mask) ^ (goal & v1shrui (before_mask, 1));
 
   uint64_t zero_matches, goal_matches;
   while (1)
     {
       /* Look for a terminating '\0'. */
-      zero_matches = __insn_v1cmpeqi (v, 0);
+      zero_matches = v1cmpeqi (v, 0);
 
       /* Look for the goal byte. */
-      goal_matches = __insn_v1cmpeq (v, goal);
+      goal_matches = v1cmpeq (v, goal);
 
       if (__builtin_expect ((zero_matches | goal_matches) != 0, 0))
         break;