[PATCH] Adding RBIT gcc builtin for ARM

2019-06-19 Thread Ayan Shafqat
The attached patch contains __builtin_arm_rbit which generates RBIT instruction for ARM targets. Please let me know if you any questions or comments, or commit this patch for me as I do not have write access to SVN. Thanks Ayan commit a692b5b4965840babbdaf5e2b9b1feb1995d351d Author: Ayan

[PATCH] ARM ACLE: add inline definitions for __fma and __fmaf in aarch64 and aarch32 headers

2025-03-04 Thread Ayan Shafqat
the existing ARM backend configurations. Please let me know if you have any questions or need further modifications. Thanks, Ayan [1] ARM ACLE Document: https://arm-software.github.io/acle/main/acle.html#fused-multiply-accumulate-fma Signed-off-by: Ayan Shafqat diff --git a/gcc/config/aarch64

[PATCH 1/2] aarch64: Add FMA and FMAF intrinsics and tests

2025-03-09 Thread Ayan Shafqat
for AArch64, confirming that the generated code uses the expected fused multiply-accumulate instructions (fmadd). [1] https://arm-software.github.io/acle/main/acle.html#fused-multiply-accumulate-fma Signed-off-by: Ayan Shafqat --- gcc/config/aarch64/arm_acle.h | 14

[PATCH 2/2] arm: Add FMA and FMAF intrinsics with corresponding tests

2025-03-09 Thread Ayan Shafqat
arm-cortexa9_neon-linux-gnueabihf, confirming that the generated code uses the expected fused multiply-accumulate instructions: vfma.f32 for single precision vmfa.f64 for double precision Signed-off-by: Ayan Shafqat [1] https://arm-software.github.io/acle/main/acle.html#fused-multiply

Re: [PATCH 1/2] aarch64: Add FMA and FMAF intrinsics and tests

2025-03-11 Thread Ayan Shafqat
Hello Kyrylo, On Tue, Mar 11, 2025 at 08:55:46AM +, Kyrylo Tkachov wrote: > This looks ok to me. > GCC is currently in a regression fixing stage so normally such a change would > wait until stage 1 reopens. > But this looks like a pretty safe change so I’m not against taking it now. > Do you

[PATCH 1/3] AArch64: Use BUILTIN_VHSDF_HSDF for vector and scalar sqrt builtins

2025-03-11 Thread Ayan Shafqat
that `BUILTIN_VHSDF_HSDF` handles those cases. Signed-off-by: Ayan Shafqat Signed-off-by: Andrew Pinski --- gcc/config/aarch64/aarch64-simd-builtins.def | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def b/gcc/config/aarch64

[PATCH 2/3] AArch64: Add __sqrt and __sqrtf intrinsics to arm_acle.h

2025-03-11 Thread Ayan Shafqat
library or optimization levels. Signed-off-by: Ayan Shafqat --- gcc/config/aarch64/arm_acle.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64/arm_acle.h index 7976c117daf..d972a4e7e7e 100644 --- a/gcc/config/aarch64/arm_acle.h

[PATCH 3/3] AArch64: Add tests for __sqrt and __sqrtf intrinsic

2025-03-11 Thread Ayan Shafqat
not fall back to library calls, regardless of optimization levels. Signed-off-by: Ayan Shafqat --- .../gcc.target/aarch64/acle/acle_sqrt.c | 17 + 1 file changed, 17 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/acle_sqrt.c diff --git a/gcc

[PATCH 1/2] arm: Add support for NEON vsqrt builtins (hf, sf, df)

2025-03-13 Thread Ayan Shafqat
mode is selected for each precision variant. Signed-off-by: Ayan Shafqat Signed-off-by: Andrew Pinski --- gcc/config/arm/arm-builtins.cc | 3 +++ gcc/config/arm/arm_vfp_builtins.def | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config/arm/arm-builtins.cc b/gcc

[PATCH v2 1/2] Aarch64: Add FMA and FMAF intrinsic and corresponding tests

2025-03-13 Thread Ayan Shafqat
This patch introduces inline definitions for the __fma and __fmaf functions in arm_acle.h for Aarch64 targets. These definitions rely on __builtin_fma and __builtin_fmaf to ensure proper inlining and to meet the ACLE requirements [1]. The patch has been tested locally using a crosstool-NG sysroot

[PATCH v2 2/2] arm: Add FMA and FMAF intrinsics with corresponding tests

2025-03-13 Thread Ayan Shafqat
This patch introduces inline definitions for the __fma and __fmaf functions in arm_acle.h for arm targets. These definitions rely on __builtin_fma and __builtin_fmaf to ensure proper inlining and to meet the ACLE requirements [1]. The patch has been tested locally using a crosstool-NG sysroot for

[PATCH v2 1/3] Aarch64: Use BUILTIN_VHSDF_HSDF for vector and scalar sqrt builtins

2025-03-13 Thread Ayan Shafqat
that `BUILTIN_VHSDF_HSDF` handles those cases. gcc/ChangeLog: * config/aarch64/aarch64-simd-builtins.def: Change BUILTIN_VHSDF_DF to BUILTIN_VHSDF_HSDF Signed-off-by: Ayan Shafqat Signed-off-by: Andrew Pinski --- gcc/config/aarch64/aarch64-simd-builtins.def | 5 + 1 file

[PATCH v2 2/3] Aarch64: Add __sqrt and __sqrtf intrinsics to arm_acle.h

2025-03-13 Thread Ayan Shafqat
library or optimization levels. gcc/ChangeLog: * config/aarch64/arm_acle.h (__sqrt, __sqrtf): New function. Signed-off-by: Ayan Shafqat --- gcc/config/aarch64/arm_acle.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64

[PATCH v2 3/3] Aarch64: Add tests for __sqrt and __sqrtf intrinsic

2025-03-13 Thread Ayan Shafqat
not fall back to library calls, regardless of optimization levels. gcc/testsuite/ChangeLog: * gcc.target/aarch64/acle/acle_sqrt.c: New test. Signed-off-by: Ayan Shafqat --- .../gcc.target/aarch64/acle/acle_sqrt.c | 17 + 1 file changed, 17 insertions(+) create

[PATCH 2/3] Aarch64: Add __sqrt and __sqrtf intrinsics to arm_acle.h

2025-03-13 Thread Ayan Shafqat
library or optimization levels. gcc/ChangeLog: * config/aarch64/arm_acle.h (__sqrt, __sqrtf): New function. Signed-off-by: Ayan Shafqat --- gcc/config/aarch64/arm_acle.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64

[PATCH 2/2] arm: Add ACLE sqrt intrinsic using NEON vsqrt builtins

2025-03-14 Thread Ayan Shafqat
definitions for __sqrt() and __sqrtf(). new file: gcc/testsuite/gcc.target/arm/acle/acle_sqrt.c * Create tests to compile and check for vsqrt.f64 and vsqrt.f32 instructions. [1] https://developer.arm.com/documentation/101028/0012/3--C-language-extensions Signed-off-by: Ayan Shafqat --- gcc

[PATCH v2 2/2] arm: Add ACLE sqrt intrinsic using NEON vsqrt builtins

2025-03-16 Thread Ayan Shafqat
--C-language-extensions gcc/ChangeLog: * config/arm/arm_acle.h (__sqrt, __sqrtf): New functions gcc/testsuite/ChangeLog: * gcc.target/arm/acle/acle_sqrt.c: New test. Signed-off-by: Ayan Shafqat --- gcc/config/arm/arm_acle.h | 18 ++ gcc

[PATCH v2 1/2] arm: Add support for NEON vsqrt builtins (hf, sf, df)

2025-03-16 Thread Ayan Shafqat
mode is selected for each precision variant. Signed-off-by: Ayan Shafqat Signed-off-by: Andrew Pinski gcc/ChangeLog: * config/arm/arm-builtins.cc (df_UP): New macro. * config/arm/arm_vfp_builtins.def (VAR1, VAR3): Change VAR1 to VAR3, for HF, SF, and DF modes. --- gcc

Re: [PATCH 2/3] Aarch64: Add __sqrt and __sqrtf intrinsics to arm_acle.h

2025-03-16 Thread Ayan Shafqat
025 at 05:23:00PM -0400, Ayan Shafqat wrote: > > This patch introduces two new inline functions, __sqrt and __sqrtf, in > > +__sqrt(double __x) > Just formatting nits, there should be space in between the function name > and ( and only one space between double and __x. Tha

Re: [PATCH v2 3/3] Aarch64: Add tests for __sqrt and __sqrtf intrinsic

2025-03-16 Thread Ayan Shafqat
Hello Jakub: Thank you very much for your feedback. See additional replies below. On Thu, Mar 13, 2025 at 10:31:44PM +0100, Jakub Jelinek wrote: > On Thu, Mar 13, 2025 at 05:25:26PM -0400, Ayan Shafqat wrote: > > gcc/testsuite/ChangeLog: > > > > * gcc.target/aarch64/

[PATCH v2 2/2] Aarch64: Add __sqrt and __sqrtf intrinsics and corresponding tests

2025-03-16 Thread Ayan Shafqat
expanded to hardware instructions and do not fall back to library calls, regardless of optimization levels. gcc/ChangeLog: * config/aarch64/arm_acle.h (__sqrt, __sqrtf): New function. gcc/testsuite/ChangeLog: * gcc.target/aarch64/acle/acle_sqrt.c: New test. Signed-off-by: Ayan Shafqat

[PATCH v2 1/2] Aarch64: Use BUILTIN_VHSDF_HSDF for vector and scalar sqrt builtins

2025-03-16 Thread Ayan Shafqat
that `BUILTIN_VHSDF_HSDF` handles those cases. gcc/ChangeLog: * config/aarch64/aarch64-simd-builtins.def: Change BUILTIN_VHSDF_DF to BUILTIN_VHSDF_HSDF Signed-off-by: Ayan Shafqat Signed-off-by: Andrew Pinski --- gcc/config/aarch64/aarch64-simd-builtins.def | 5 + 1 file

[PATCH v3 2/2] arm: Add FMA and FMAF intrinsics with corresponding tests

2025-03-16 Thread Ayan Shafqat
This patch introduces inline definitions for the __fma and __fmaf functions in arm_acle.h for arm targets. These definitions rely on __builtin_fma and __builtin_fmaf to ensure proper inlining and to meet the ACLE requirements [1]. The patch has been tested locally using a crosstool-NG sysroot for

Re: [PATCH 1/2] aarch64: Add FMA and FMAF intrinsics and tests

2025-03-15 Thread Ayan Shafqat
On Thu, Mar 13, 2025 at 08:31:24AM +, Kyrylo Tkachov wrote: > > I forgot during the review, but a patch needs a ChangeLog entry. > Could you provide one please to add to the commit log? > I have submitted the patch again in the mailing list: https://gcc.gnu.org/pipermail/gcc-patches/2025-Marc

[PATCH v3 1/2] Aarch64: Add FMA and FMAF intrinsic and corresponding tests

2025-03-17 Thread Ayan Shafqat
This patch introduces inline definitions for the __fma and __fmaf functions in arm_acle.h for Aarch64 targets. These definitions rely on __builtin_fma and __builtin_fmaf to ensure proper inlining and to meet the ACLE requirements [1]. The patch has been tested locally using a crosstool-NG sysroot