[0/4] Rename the Advanced SIMD intrinsic flags

Message ID 20241204180244.4077058-1-richard.sandiford@arm.com
Headers
Series Rename the Advanced SIMD intrinsic flags |

Message

Richard Sandiford Dec. 4, 2024, 6:02 p.m. UTC
  The arm_neon.h intrinsic definitions use a bitmask of flags to
indicate what side-effects the intrinsic might have.  However,
their names are a bit confusing:

- FLAG_AUTO_FP was originally suggested as a way of saying
  "automatically derive FLAG_FP from the mode", i.e. automatically
  decide whether the function might read the FPCR or might raise
  FP exceptions.  The current flag instead suppresses this behaviour.

- FLAG_NONE suggests that the intrinsic has no side-effects,
  but it actually has the suggested meaning of FLAG_AUTO_FP,
  i.e. work out the flags from the mode.

This tripped me up when adding the flags to the vluti intrinsics:
I'd used NONE, but wanted the semantics attached to AUTO_FP.

This series renames some flags in the hope of making this easier
to follow.  I realise it might not seem like stage 3 material,
but I think it is a naming/maintenance bug.

Tested on aarch64-linux-gnu.  I'll commit tomorrow evening if there
are no comments before then, but let me know if you'd like more time.

Richard Sandiford (4):
  aarch64: Rename FLAG_AUTO_FP to FLAG_QUIET
  aarch64: Rename FLAG_NONE to FLAG_DEFAULT
  aarch64: Reintroduce FLAG_AUTO_FP
  aarch64: Mark vluti* intrinsics as QUIET

 gcc/config/aarch64/aarch64-builtins.cc        |  45 +-
 gcc/config/aarch64/aarch64-simd-builtins.def  | 762 +++++++++---------
 .../aarch64/aarch64-simd-pragma-builtins.def  |  24 +-
 3 files changed, 416 insertions(+), 415 deletions(-)
  

Comments

Kyrylo Tkachov Dec. 5, 2024, 9:25 a.m. UTC | #1
> On 4 Dec 2024, at 19:02, Richard Sandiford <richard.sandiford@arm.com> wrote:
> 
> The arm_neon.h intrinsic definitions use a bitmask of flags to
> indicate what side-effects the intrinsic might have.  However,
> their names are a bit confusing:
> 
> - FLAG_AUTO_FP was originally suggested as a way of saying
>  "automatically derive FLAG_FP from the mode", i.e. automatically
>  decide whether the function might read the FPCR or might raise
>  FP exceptions.  The current flag instead suppresses this behaviour.
> 
> - FLAG_NONE suggests that the intrinsic has no side-effects,
>  but it actually has the suggested meaning of FLAG_AUTO_FP,
>  i.e. work out the flags from the mode.
> 
> This tripped me up when adding the flags to the vluti intrinsics:
> I'd used NONE, but wanted the semantics attached to AUTO_FP.
> 
> This series renames some flags in the hope of making this easier
> to follow.  I realise it might not seem like stage 3 material,
> but I think it is a naming/maintenance bug.

Fine with me. Patches to make the code more readable/maintainable are good to have even in stage 3 IMO.
Adjusting the flags for the vluti* intrinsics is fixing the support for a new GCC 15 feature so there’s no risk of regression for existing functionality.

Thanks,
Kyrill


> 
> Tested on aarch64-linux-gnu.  I'll commit tomorrow evening if there
> are no comments before then, but let me know if you'd like more time.
> 
> Richard Sandiford (4):
>  aarch64: Rename FLAG_AUTO_FP to FLAG_QUIET
>  aarch64: Rename FLAG_NONE to FLAG_DEFAULT
>  aarch64: Reintroduce FLAG_AUTO_FP
>  aarch64: Mark vluti* intrinsics as QUIET
> 
> gcc/config/aarch64/aarch64-builtins.cc        |  45 +-
> gcc/config/aarch64/aarch64-simd-builtins.def  | 762 +++++++++---------
> .../aarch64/aarch64-simd-pragma-builtins.def  |  24 +-
> 3 files changed, 416 insertions(+), 415 deletions(-)
> 
> -- 
> 2.25.1
>