about summary refs log tree commit diff
path: root/sysdeps/s390/s390-64
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2014-02-10 14:45:42 +0100
committerOndřej Bílka <neleai@seznam.cz>2014-02-10 15:07:12 +0100
commita1ffb40e32741f992c743e7b16c061fefa3747ac (patch)
tree246a29a87b26cfd5d07b17070f85eb3785018de9 /sysdeps/s390/s390-64
parent1448f3244714a9dabb5240ec18b094f100887d5c (diff)
downloadglibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'sysdeps/s390/s390-64')
-rw-r--r--sysdeps/s390/s390-64/dl-machine.h14
-rw-r--r--sysdeps/s390/s390-64/utf16-utf32-z9.c10
-rw-r--r--sysdeps/s390/s390-64/utf8-utf16-z9.c26
-rw-r--r--sysdeps/s390/s390-64/utf8-utf32-z9.c32
4 files changed, 41 insertions, 41 deletions
diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h
index e919223c6a..2f3716987c 100644
--- a/sysdeps/s390/s390-64/dl-machine.h
+++ b/sysdeps/s390/s390-64/dl-machine.h
@@ -103,7 +103,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 	 to intercept the calls to collect information.	 In this case we
 	 don't store the address in the GOT so that all future calls also
 	 end in this function.	*/
-      if (__builtin_expect (profile, 0))
+      if (__glibc_unlikely (profile))
 	{
 	  got[2] = (Elf64_Addr) &_dl_runtime_profile;
 
@@ -255,7 +255,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
   const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
 
 #if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
-  if (__builtin_expect (r_type == R_390_RELATIVE, 0))
+  if (__glibc_unlikely (r_type == R_390_RELATIVE))
     {
 # if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
       /* This is defined in rtld.c, but nowhere in the static libc.a;
@@ -273,7 +273,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
     }
   else
 #endif
-  if (__builtin_expect (r_type == R_390_NONE, 0))
+  if (__glibc_unlikely (r_type == R_390_NONE))
     return;
   else
     {
@@ -294,7 +294,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 	{
 	case R_390_IRELATIVE:
 	  value = map->l_addr + reloc->r_addend;
-	  if (__builtin_expect (!skip_ifunc, 1))
+	  if (__glibc_likely (!skip_ifunc))
 	    value = elf_ifunc_invoke (value);
 	  *reloc_addr = value;
 	  break;
@@ -432,7 +432,7 @@ elf_machine_lazy_rel (struct link_map *map,
   Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
   const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
   /* Check for unexpected PLT reloc type.  */
-  if (__builtin_expect (r_type == R_390_JMP_SLOT, 1))
+  if (__glibc_likely (r_type == R_390_JMP_SLOT))
     {
       if (__builtin_expect (map->l_mach.plt, 0) == 0)
 	*reloc_addr += l_addr;
@@ -441,10 +441,10 @@ elf_machine_lazy_rel (struct link_map *map,
 	  map->l_mach.plt
 	  + (((Elf64_Addr) reloc_addr) - map->l_mach.gotplt) * 4;
     }
-  else if (__builtin_expect (r_type == R_390_IRELATIVE, 1))
+  else if (__glibc_likely (r_type == R_390_IRELATIVE))
     {
       Elf64_Addr value = map->l_addr + reloc->r_addend;
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
 	value = elf_ifunc_invoke (value);
       *reloc_addr = value;
     }
diff --git a/sysdeps/s390/s390-64/utf16-utf32-z9.c b/sysdeps/s390/s390-64/utf16-utf32-z9.c
index f7d9e07957..11a098fa99 100644
--- a/sysdeps/s390/s390-64/utf16-utf32-z9.c
+++ b/sysdeps/s390/s390-64/utf16-utf32-z9.c
@@ -54,7 +54,7 @@
       if (dir == to_utf16)						\
 	{								\
           /* Emit the UTF-16 Byte Order Mark.  */			\
-          if (__builtin_expect (outbuf + 2 > outend, 0))		\
+          if (__glibc_unlikely (outbuf + 2 > outend))			      \
 	    return __GCONV_FULL_OUTPUT;					\
 									\
 	  put16u (outbuf, BOM_UTF16);					\
@@ -63,7 +63,7 @@
       else								\
 	{								\
           /* Emit the UTF-32 Byte Order Mark.  */			\
-	  if (__builtin_expect (outbuf + 4 > outend, 0))		\
+	  if (__glibc_unlikely (outbuf + 4 > outend))			      \
 	    return __GCONV_FULL_OUTPUT;					\
 									\
 	  put32u (outbuf, BOM_UTF32);					\
@@ -236,13 +236,13 @@ gconv_end (struct __gconv_step *data)
       {									\
         /* An isolated low-surrogate was found.  This has to be         \
 	   considered ill-formed.  */					\
-        if (__builtin_expect (u1 >= 0xdc00, 0))				\
+        if (__glibc_unlikely (u1 >= 0xdc00))				      \
 	  {								\
 	    STANDARD_FROM_LOOP_ERR_HANDLER (2);				\
 	  }								\
 	/* It's a surrogate character.  At least the first word says	\
 	   it is.  */							\
-	if (__builtin_expect (inptr + 4 > inend, 0))			\
+	if (__glibc_unlikely (inptr + 4 > inend))			      \
 	  {								\
 	    /* We don't have enough input for another complete input	\
 	       character.  */						\
@@ -306,7 +306,7 @@ gconv_end (struct __gconv_step *data)
 	uint16_t out;							\
 									\
 	/* Generate a surrogate character.  */				\
-	if (__builtin_expect (outptr + 4 > outend, 0))			\
+	if (__glibc_unlikely (outptr + 4 > outend))			      \
 	  {								\
 	    /* Overflow in the output buffer.  */			\
 	    result = __GCONV_FULL_OUTPUT;				\
diff --git a/sysdeps/s390/s390-64/utf8-utf16-z9.c b/sysdeps/s390/s390-64/utf8-utf16-z9.c
index 863677455c..74754211c1 100644
--- a/sysdeps/s390/s390-64/utf8-utf16-z9.c
+++ b/sysdeps/s390/s390-64/utf8-utf16-z9.c
@@ -50,7 +50,7 @@
       && data->__invocation_counter == 0)				\
     {									\
       /* Emit the UTF-16 Byte Order Mark.  */				\
-      if (__builtin_expect (outbuf + 2 > outend, 0))			\
+      if (__glibc_unlikely (outbuf + 2 > outend))			      \
 	return __GCONV_FULL_OUTPUT;					\
 									\
       put16u (outbuf, BOM_UTF16);					\
@@ -197,7 +197,7 @@ gconv_end (struct __gconv_step *data)
 	      if ((inptr[i] & 0xc0) != 0x80)				\
 		break;							\
 								\
-	    if (__builtin_expect (inptr + i == inend, 1))		\
+	    if (__glibc_likely (inptr + i == inend))			      \
 	      {								\
 		result = __GCONV_INCOMPLETE_INPUT;			\
 		break;							\
@@ -210,7 +210,7 @@ gconv_end (struct __gconv_step *data)
     /* Next input byte.  */						\
     uint16_t ch = *inptr;						\
 									\
-    if (__builtin_expect (ch < 0x80, 1))				\
+    if (__glibc_likely (ch < 0x80))					      \
       {									\
 	/* One byte sequence.  */					\
 	++inptr;							\
@@ -228,13 +228,13 @@ gconv_end (struct __gconv_step *data)
 	    cnt = 2;							\
 	    ch &= 0x1f;							\
 	  }								\
-        else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))		\
+        else if (__glibc_likely ((ch & 0xf0) == 0xe0))			      \
 	  {								\
 	    /* We expect three bytes.  */				\
 	    cnt = 3;							\
 	    ch &= 0x0f;							\
 	  }								\
-	else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1))		\
+	else if (__glibc_likely ((ch & 0xf8) == 0xf0))			      \
 	  {								\
 	    /* We expect four bytes.  */				\
 	    cnt = 4;							\
@@ -255,7 +255,7 @@ gconv_end (struct __gconv_step *data)
 	    STANDARD_FROM_LOOP_ERR_HANDLER (i);				\
 	  }								\
 									\
-	if (__builtin_expect (inptr + cnt > inend, 0))			\
+	if (__glibc_unlikely (inptr + cnt > inend))			      \
 	  {								\
 	    /* We don't have enough input.  But before we report	\
 	       that check that all the bytes are correct.  */		\
@@ -263,7 +263,7 @@ gconv_end (struct __gconv_step *data)
 	      if ((inptr[i] & 0xc0) != 0x80)				\
 		break;							\
 									\
-	    if (__builtin_expect (inptr + i == inend, 1))		\
+	    if (__glibc_likely (inptr + i == inend))			      \
 	      {								\
 		result = __GCONV_INCOMPLETE_INPUT;			\
 		break;							\
@@ -278,7 +278,7 @@ gconv_end (struct __gconv_step *data)
 	       low) are needed.  */					\
 	    uint16_t zabcd, high, low;					\
 									\
-	    if (__builtin_expect (outptr + 4 > outend, 0))		\
+	    if (__glibc_unlikely (outptr + 4 > outend))			      \
 	      {								\
 		/* Overflow in the output buffer.  */			\
 		result = __GCONV_FULL_OUTPUT;				\
@@ -368,7 +368,7 @@ gconv_end (struct __gconv_step *data)
 									\
     uint16_t c = get16 (inptr);						\
 									\
-    if (__builtin_expect (c <= 0x007f, 1))				\
+    if (__glibc_likely (c <= 0x007f))					      \
       {									\
 	/* Single byte UTF-8 char.  */					\
 	*outptr = c & 0xff;						\
@@ -378,7 +378,7 @@ gconv_end (struct __gconv_step *data)
       {									\
         /* Two byte UTF-8 char.  */					\
 									\
-	if (__builtin_expect (outptr + 2 > outend, 0))			\
+	if (__glibc_unlikely (outptr + 2 > outend))			      \
 	  {								\
 	    /* Overflow in the output buffer.  */			\
 	    result = __GCONV_FULL_OUTPUT;				\
@@ -397,7 +397,7 @@ gconv_end (struct __gconv_step *data)
       {									\
 	/* Three byte UTF-8 char.  */					\
 									\
-	if (__builtin_expect (outptr + 3 > outend, 0))			\
+	if (__glibc_unlikely (outptr + 3 > outend))			      \
 	  {								\
 	    /* Overflow in the output buffer.  */			\
 	    result = __GCONV_FULL_OUTPUT;				\
@@ -419,14 +419,14 @@ gconv_end (struct __gconv_step *data)
         /* Four byte UTF-8 char.  */					\
 	uint16_t low, uvwxy;						\
 									\
-	if (__builtin_expect (outptr + 4 > outend, 0))			\
+	if (__glibc_unlikely (outptr + 4 > outend))			      \
 	  {								\
 	    /* Overflow in the output buffer.  */			\
 	    result = __GCONV_FULL_OUTPUT;				\
 	    break;							\
 	  }								\
 	inptr += 2;							\
-	if (__builtin_expect (inptr + 2 > inend, 0))			\
+	if (__glibc_unlikely (inptr + 2 > inend))			      \
 	  {								\
 	    result = __GCONV_INCOMPLETE_INPUT;				\
 	    break;							\
diff --git a/sysdeps/s390/s390-64/utf8-utf32-z9.c b/sysdeps/s390/s390-64/utf8-utf32-z9.c
index 5120837037..cb74f34075 100644
--- a/sysdeps/s390/s390-64/utf8-utf32-z9.c
+++ b/sysdeps/s390/s390-64/utf8-utf32-z9.c
@@ -52,7 +52,7 @@
       && data->__invocation_counter == 0)				\
     {									\
       /* Emit the Byte Order Mark.  */					\
-      if (__builtin_expect (outbuf + 4 > outend, 0))			\
+      if (__glibc_unlikely (outbuf + 4 > outend))			      \
 	return __GCONV_FULL_OUTPUT;					\
 									\
       put32u (outbuf, BOM);						\
@@ -201,7 +201,7 @@ gconv_end (struct __gconv_step *data)
 	      if ((inptr[i] & 0xc0) != 0x80)				\
 		break;							\
 									\
-	    if (__builtin_expect (inptr + i == inend, 1))		\
+	    if (__glibc_likely (inptr + i == inend))			      \
 	      {								\
 		result = __GCONV_INCOMPLETE_INPUT;			\
 		break;							\
@@ -214,7 +214,7 @@ gconv_end (struct __gconv_step *data)
     /* Next input byte.  */						\
     uint32_t ch = *inptr;						\
 									\
-    if (__builtin_expect (ch < 0x80, 1))				\
+    if (__glibc_likely (ch < 0x80))					      \
       {									\
 	/* One byte sequence.  */					\
 	++inptr;							\
@@ -232,25 +232,25 @@ gconv_end (struct __gconv_step *data)
 	    cnt = 2;							\
 	    ch &= 0x1f;							\
 	  }								\
-        else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))		\
+        else if (__glibc_likely ((ch & 0xf0) == 0xe0))			      \
 	  {								\
 	    /* We expect three bytes.  */				\
 	    cnt = 3;							\
 	    ch &= 0x0f;							\
 	  }								\
-	else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1))		\
+	else if (__glibc_likely ((ch & 0xf8) == 0xf0))			      \
 	  {								\
 	    /* We expect four bytes.  */				\
 	    cnt = 4;							\
 	    ch &= 0x07;							\
 	  }								\
-	else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1))		\
+	else if (__glibc_likely ((ch & 0xfc) == 0xf8))			      \
 	  {								\
 	    /* We expect five bytes.  */				\
 	    cnt = 5;							\
 	    ch &= 0x03;							\
 	  }								\
-	else if (__builtin_expect ((ch & 0xfe) == 0xfc, 1))		\
+	else if (__glibc_likely ((ch & 0xfe) == 0xfc))			      \
 	  {								\
 	    /* We expect six bytes.  */					\
 	    cnt = 6;							\
@@ -271,7 +271,7 @@ gconv_end (struct __gconv_step *data)
 	    STANDARD_FROM_LOOP_ERR_HANDLER (i);				\
 	  }								\
 									\
-	if (__builtin_expect (inptr + cnt > inend, 0))			\
+	if (__glibc_unlikely (inptr + cnt > inend))			      \
 	  {								\
 	    /* We don't have enough input.  But before we report	\
 	       that check that all the bytes are correct.  */		\
@@ -279,7 +279,7 @@ gconv_end (struct __gconv_step *data)
 	      if ((inptr[i] & 0xc0) != 0x80)				\
 		break;							\
 									\
-	    if (__builtin_expect (inptr + i == inend, 1))		\
+	    if (__glibc_likely (inptr + i == inend))			      \
 	      {								\
 		result = __GCONV_INCOMPLETE_INPUT;			\
 		break;							\
@@ -338,19 +338,19 @@ gconv_end (struct __gconv_step *data)
 	cnt = 2;							      \
 	ch &= 0x1f;							      \
       }									      \
-    else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))			      \
+    else if (__glibc_likely ((ch & 0xf0) == 0xe0))			      \
       {									      \
 	/* We expect three bytes.  */					      \
 	cnt = 3;							      \
 	ch &= 0x0f;							      \
       }									      \
-    else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1))			      \
+    else if (__glibc_likely ((ch & 0xf8) == 0xf0))			      \
       {									      \
 	/* We expect four bytes.  */					      \
 	cnt = 4;							      \
 	ch &= 0x07;							      \
       }									      \
-    else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1))			      \
+    else if (__glibc_likely ((ch & 0xfc) == 0xf8))			      \
       {									      \
 	/* We expect five bytes.  */					      \
 	cnt = 5;							      \
@@ -431,7 +431,7 @@ gconv_end (struct __gconv_step *data)
 								\
     uint32_t wc = *((const uint32_t *) inptr);			\
 								\
-    if (__builtin_expect (wc <= 0x7f, 1))			\
+    if (__glibc_likely (wc <= 0x7f))					      \
       {								\
         /* Single UTF-8 char.  */				\
         *outptr = (uint8_t)wc;					\
@@ -440,7 +440,7 @@ gconv_end (struct __gconv_step *data)
     else if (wc <= 0x7ff)					\
       {								\
         /* Two UTF-8 chars.  */					\
-        if (__builtin_expect (outptr + 2 > outend, 0))		\
+        if (__glibc_unlikely (outptr + 2 > outend))			      \
 	  {							\
 	    /* Overflow in the output buffer.  */		\
 	    result = __GCONV_FULL_OUTPUT;			\
@@ -458,7 +458,7 @@ gconv_end (struct __gconv_step *data)
     else if (wc <= 0xffff)					\
       {								\
 	/* Three UTF-8 chars.  */				\
-	if (__builtin_expect (outptr + 3 > outend, 0))		\
+	if (__glibc_unlikely (outptr + 3 > outend))			      \
 	  {							\
 	    /* Overflow in the output buffer.  */		\
 	    result = __GCONV_FULL_OUTPUT;			\
@@ -478,7 +478,7 @@ gconv_end (struct __gconv_step *data)
       else if (wc <= 0x10ffff)					\
 	{							\
 	  /* Four UTF-8 chars.  */				\
-	  if (__builtin_expect (outptr + 4 > outend, 0))	\
+	  if (__glibc_unlikely (outptr + 4 > outend))			      \
 	    {							\
 	      /* Overflow in the output buffer.  */		\
 	      result = __GCONV_FULL_OUTPUT;			\