* [PATCH] aarch64: Standardized codes by using macro __glibc_{un,}likely and AARCH64_R
@ 2023-03-13 3:18 caiyinyu
2023-03-13 9:07 ` Szabolcs Nagy
0 siblings, 1 reply; 3+ messages in thread
From: caiyinyu @ 2023-03-13 3:18 UTC (permalink / raw)
To: libc-alpha
Cc: adhemerval.zanella, marcus.shawcroft, szabolcs.nagy, xry111, caiyinyu
---
sysdeps/aarch64/dl-machine.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
index 4170b9269f..da4f08dec6 100644
--- a/sysdeps/aarch64/dl-machine.h
+++ b/sysdeps/aarch64/dl-machine.h
@@ -83,7 +83,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
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 ( profile)
+ if (__glibc_unlikely (profile))
{
got[2] = (ElfW(Addr)) &_dl_runtime_profile;
@@ -172,9 +172,9 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
ElfW(Addr) *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info);
- if (__builtin_expect (r_type == AARCH64_R(RELATIVE), 0))
+ if (__glibc_unlikely (r_type == AARCH64_R(RELATIVE)))
*reloc_addr = map->l_addr + reloc->r_addend;
- else if (__builtin_expect (r_type == R_AARCH64_NONE, 0))
+ else if (__glibc_unlikely (r_type == AARCH64_R(NONE)))
return;
else
{
@@ -311,7 +311,7 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[],
ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info);
/* Check for unexpected PLT reloc type. */
- if (__builtin_expect (r_type == AARCH64_R(JUMP_SLOT), 1))
+ if (__glibc_likely (r_type == AARCH64_R(JUMP_SLOT)))
{
if (__glibc_unlikely (map->l_info[DT_AARCH64 (VARIANT_PCS)] != NULL))
{
@@ -341,7 +341,7 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[],
else
*reloc_addr = map->l_mach.plt;
}
- else if (__builtin_expect (r_type == AARCH64_R(TLSDESC), 1))
+ else if (__glibc_likely (r_type == AARCH64_R(TLSDESC)))
{
const Elf_Symndx symndx = ELFW (R_SYM) (reloc->r_info);
const ElfW (Sym) *symtab = (const void *)D_PTR (map, l_info[DT_SYMTAB]);
--
2.31.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] aarch64: Standardized codes by using macro __glibc_{un,}likely and AARCH64_R
2023-03-13 3:18 [PATCH] aarch64: Standardized codes by using macro __glibc_{un,}likely and AARCH64_R caiyinyu
@ 2023-03-13 9:07 ` Szabolcs Nagy
0 siblings, 0 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2023-03-13 9:07 UTC (permalink / raw)
To: caiyinyu, libc-alpha; +Cc: adhemerval.zanella, marcus.shawcroft, xry111
The 03/13/2023 11:18, caiyinyu wrote:
> ---
> sysdeps/aarch64/dl-machine.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
> index 4170b9269f..da4f08dec6 100644
> --- a/sysdeps/aarch64/dl-machine.h
> +++ b/sysdeps/aarch64/dl-machine.h
> @@ -83,7 +83,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
> 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 ( profile)
> + if (__glibc_unlikely (profile))
> {
profile is unlikely, but this check only runs once
so i don't think this is useful.
the rest looks ok... but is there a reason to clean
this up now? there are many __builtin_expect in the
codebase and fixing them likely makes backporting
patches harder without much benefit.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] aarch64: Standardized codes by using macro __glibc_{un,}likely and AARCH64_R
@ 2023-03-13 12:11 caiyinyu
0 siblings, 0 replies; 3+ messages in thread
From: caiyinyu @ 2023-03-13 12:11 UTC (permalink / raw)
To: Szabolcs Nagy, libc-alpha; +Cc: adhemerval.zanella, marcus.shawcroft, xry111
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-13 12:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13 3:18 [PATCH] aarch64: Standardized codes by using macro __glibc_{un,}likely and AARCH64_R caiyinyu
2023-03-13 9:07 ` Szabolcs Nagy
2023-03-13 12:11 caiyinyu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).