This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 6/6][ARM] Implement support for ACLE Coprocessor MCRR and MRRC intrinsics
- From: "Andre Vieira (lists)" <Andre dot SimoesDiasVieira at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Dec 2016 11:52:46 +0000
- Subject: Re: [PATCH 6/6][ARM] Implement support for ACLE Coprocessor MCRR and MRRC intrinsics
- Authentication-results: sourceware.org; auth=none
- References: <5822F3CB.3040202@arm.com> <5822F692.2060705@arm.com>
On 09/11/16 10:12, Andre Vieira (lists) wrote:
> Hi,
>
> This patch implements support for the ARM ACLE Coprocessor MCR and MRC
> intrinsics. See below a table mapping the intrinsics to their respective
> instructions:
>
> +-------------------------------------------------------------------+---------------------------------------+
> | Intrinsic signature |
> Instruction pattern |
> +-------------------------------------------------------------------+---------------------------------------+
> |void __arm_mcrr(coproc, opc1, uint64_t value, CRm) |
> MCRR coproc, opc1, Rt, Rt2, CRm |
> +-------------------------------------------------------------------+---------------------------------------+
> |void __arm_mcrr2(coproc, opc1, uint64_t value, CRm) |
> MCRR2 coproc, opc1, Rt, Rt2, CRm |
> +-------------------------------------------------------------------+---------------------------------------+
> |uint64_t __arm_mrrc(coproc, opc1, CRm) |
> MRRC coproc, opc1, Rt, Rt2, CRm |
> +-------------------------------------------------------------------+---------------------------------------+
> |uint64_t __arm_mrrc2(coproc, opc1, CRm) |
> MRRC2 coproc, opc1, Rt, Rt2, CRm |
> +-------------------------------------------------------------------+---------------------------------------+
> Note that any untyped variable in the intrinsic signature is required to
> be a compiler-time constant and has the type 'unsigned int'. We do some
> boundary checks for coproc:[0-15], opc1[0-7] CR*:[0-31]. If either of
> these requirements are not met a diagnostic is issued.
>
> I added a new arm_arch variable for ARMv5TE to use when deciding whether
> or not the MCRR and MRCC intrinsics are available.
>
> Is this OK for trunk?
>
> Regards,
> Andre
>
> gcc/ChangeLog:
> 2016-11-09 Andre Vieira <andre.simoesdiasvieira@arm.com>
>
> * config/arm/arm.md (<mcrr>): New.
> (<mrrc>): New.
> * config/arm/arm.c (arm_arch5te): New.
> (arm_option_override): Set arm_arch5te.
> (arm_coproc_builtin_available): Add support for mcrr, mcrr2, mrrc
> and mrrc2.
> * config/arm/arm-builtins.c (MCRR_QUALIFIERS): Define to...
> (arm_mcrr_qualifiers): ... this. New.
> (MRRC_QUALIFIERS): Define to...
> (arm_mrrc_qualifiers): ... this. New.
> * config/arm/arm_acle.h (__arm_mcrr, __arm_mcrr2, __arm_mrrc,
> __arm_mrrc2): New.
> * config/arm/arm_acle_builtins.def (mcrr, mcrr2, mrrc, mrrc2): New.
> * config/arm/iterators.md (MCRRI, mcrr, MCRR): New.
> (MRRCI, mrrc, MRRC): New.
> * config/arm/unspecs.md (VUNSPEC_MCRR, VUNSPEC_MCRR2, VUNSPEC_MRRC,
> VUNSPEC_MRRC2): New.
>
> gcc/testsuite/ChangeLog:
>
> 2016-11-09 Andre Vieira <andre.simoesdiasvieira@arm.com>
>
> * gcc.target/arm/acle/mcrr: New.
> * gcc.target/arm/acle/mcrr2: New.
> * gcc.target/arm/acle/mrrc: New.
> * gcc.target/arm/acle/mrrc2: New.
>
Hi,
I realize I forgot to mention that for these intrinsics 'Rt' will hold
the low half and 'Rt2' the higher half of either the argument 'value'
for MCRR{,2} or the return value for MRRC{,2}.
Cheers,
Andre