Hi Kyrill, On Thu, Oct 31, 2024 at 02:05:00PM +0000, Kyrylo Tkachov wrote: > Hi Yury, > > > On 31 Oct 2024, at 14:23, Yury Khrustalev <yury.khrusta...@arm.com> wrote: > > > > From: Szabolcs Nagy <szabolcs.n...@arm.com> > > > > Add new builtins for GCS: > > > > void *__builtin_aarch64_gcspr (void) > > uint64_t __builtin_aarch64_gcspopm (void) > > void *__builtin_aarch64_gcsss (void *) > > > > + ftype = build_function_type_list (ptr_type_node, NULL); > > + aarch64_builtin_decls[AARCH64_BUILTIN_GCSPR] > > + = aarch64_general_add_builtin ("__builtin_aarch64_gcspr", ftype, > > + AARCH64_BUILTIN_GCSPR); > > Are these builtins intended to eventually implement the ACLE intrinsics like > __gcspr ()?
Yes, I will shortly send updated patch series that will include patch for __gcs* () ACLE intrinsics. > I see that in the spec the type signature of that is const void * __gcspr > (void). > So I think you want to use const_ptr_type_node rather than just ptr_type_node > in the ftype. Yes, the spec [1] indeed suggests `const void *` for GCS pointers in the corresponding ACLE intrinsics, however current implementation uses `void *` intentionally as explained in the commit message above: GCS pointer can be writable in some cases via the gcsss operation or via the GCSSTR instruction. I will comment in [1] to reflect this. [1] https://github.com/ARM-software/acle/pull/260 > > + = aarch64_general_add_builtin ("__builtin_aarch64_gcsss", ftype, > > + AARCH64_BUILTIN_GCSSS); > > Same here. As above. > Looks ok to me otherwise. > Thanks, > Kyrill > > > +} > > +