[v2,02/15] string/memchr: Add mechanism to set function attributes
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Testing passed
|
Commit Message
This patch introduces the __CODEGEN_ATTRIBUTES macro which can be
used to set function attributes when building the code.
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
---
string/memchr.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
On 27/05/24 08:18, Christoph Müllner wrote:
> This patch introduces the __CODEGEN_ATTRIBUTES macro which can be
> used to set function attributes when building the code.
>
> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
> ---
> string/memchr.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/string/memchr.c b/string/memchr.c
> index 08b5c41667..a2bcd0419e 100644
> --- a/string/memchr.c
> +++ b/string/memchr.c
> @@ -29,6 +29,10 @@
> # define __memchr MEMCHR
> #endif
>
> +#ifndef __CODEGEN_ATTRIBUTES
> +# define __CODEGEN_ATTRIBUTES
> +#endif
This seems more straightforward than add a generic header, since it would
overridden by each ifunc variant. I am not sure about tying the same
identifier to the __always_inline macro, but it should be ok since only
riscv actually uses it.
> +
> static __always_inline const char *
> sadd (uintptr_t x, uintptr_t y)
> {
> @@ -36,6 +40,7 @@ sadd (uintptr_t x, uintptr_t y)
> }
>
> /* Search no more than N bytes of S for C. */
> +__CODEGEN_ATTRIBUTES
> void *
> __memchr (void const *s, int c_in, size_t n)
> {
@@ -29,6 +29,10 @@
# define __memchr MEMCHR
#endif
+#ifndef __CODEGEN_ATTRIBUTES
+# define __CODEGEN_ATTRIBUTES
+#endif
+
static __always_inline const char *
sadd (uintptr_t x, uintptr_t y)
{
@@ -36,6 +40,7 @@ sadd (uintptr_t x, uintptr_t y)
}
/* Search no more than N bytes of S for C. */
+__CODEGEN_ATTRIBUTES
void *
__memchr (void const *s, int c_in, size_t n)
{