Hi all,

Besides the builtins in aarch64-simd-builtins.def there are a number of 
builtins defined in aarch64-builtins.c itself.
They could also benefit from the attributes generated by aarch64_get_attributes.
However aarch64_get_attributes and its helpers are only set up to handle a 
aarch64_simd_builtin_datum.

This patch changes these functions to instead take a flag and mode value that 
are extracted from
aarch64_simd_builtin_datum.flags and aarch64_simd_builtin_datum.mode anyway.
Then the various builtin init functions in aarch64-builtins.c can pass down 
their own FLAG_* flags
that they want to derive attributes from.
I'm not too happy with changing the helper functions in this way, but it seemed 
like the least bad option.

Richard, does this look like an ok approach to you?

Bootstrapped and tested on aarch64-none-linux-gnu.

Thanks,
Kyrill

gcc/ChangeLog:

        * config/aarch64/aarch64-builtins.c (aarch64_call_properties):
        Take a flag and mode value as arguments.
        (aarch64_modifies_global_state_p): Likewise.
        (aarch64_reads_global_state_p): Likewise.
        (aarch64_could_trap_p): Likewise.
        (aarch64_get_attributes): Likewise.
        (aarch64_init_simd_builtins): Adjust callsite of above.
        (aarch64_init_fcmla_laneq_builtins): Use aarch64_get_attributes to get
        function attributes to apply to builtins.
        (aarch64_init_crc32_builtins): Likewise.
        (aarch64_init_builtin_rsqrt): Likewise.

Attachment: attrs.patch
Description: attrs.patch

Reply via email to