[PATCH 6/6][ARM] Implement support for ACLE Coprocessor MCRR and MRRC intrinsics

Kyrill Tkachov kyrylo.tkachov@foss.arm.com
Fri Jan 6 15:15:00 GMT 2017


On 06/01/17 14:58, Andre Vieira (lists) wrote:
> On 05/01/17 11:11, Kyrill Tkachov wrote:
>> Hi Andre,
>>
>> 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?
>> Same as with the previous two patches the define_insns need constraints
>> and also I believe you'll want to rebase this patch on top of Richard's
>> rework of the
>> architecture feature bits for the ARMv5TE hunk.
>>
>> Thanks,
>> Kyrill
>>
>>> 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,
>
> Reworked this patch according to comments, rebased and fixed the
> availability of MCRR2/MRRC2 to only be available for ARMv6 and later.
>
> Is this OK for trunk?

Ok.
Thanks,
Kyrill

> Regards,
> Andre
>
> gcc/ChangeLog:
> 2017-01-xx  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:
>
> 2017-01-xx  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.



More information about the Gcc-patches mailing list