diff options
author | Dimitar Dimitrov <dimitar@dinux.eu> | 2020-11-01 15:09:27 +0200 |
---|---|---|
committer | Dimitar Dimitrov <dimitar@dinux.eu> | 2020-11-19 19:39:49 +0200 |
commit | 5ace1776b88d4b0fc371414d0b3983015e22fead (patch) | |
tree | 0185ff9ee4bdfc8940b18eee4e5c4eb4555a0f1e /gcc/doc/extend.texi | |
parent | 0b0061f4d83cd8eb181f7114a077237b95a0c144 (diff) | |
download | gcc-5ace1776b88d4b0fc371414d0b3983015e22fead.zip gcc-5ace1776b88d4b0fc371414d0b3983015e22fead.tar.gz gcc-5ace1776b88d4b0fc371414d0b3983015e22fead.tar.bz2 |
pru: Add builtins for HALT and LMBD
Add builtins for HALT and LMBD, per Texas Instruments document
SPRUHV7C. Use the new LMBD pattern to define an expand for clz.
Binutils [1] and sim [2] support for LMBD instruction are merged now.
[1] https://sourceware.org/pipermail/binutils/2020-October/113901.html
[2] https://sourceware.org/pipermail/gdb-patches/2020-November/173141.html
gcc/ChangeLog:
* config/pru/alu-zext.md: Add lmbd patterns for zero_extend
variants.
* config/pru/pru.c (enum pru_builtin): Add HALT and LMBD.
(pru_init_builtins): Ditto.
(pru_builtin_decl): Ditto.
(pru_expand_builtin): Ditto.
* config/pru/pru.h (CLZ_DEFINED_VALUE_AT_ZERO): Define PRU
value for CLZ with zero value parameter.
* config/pru/pru.md: Add halt, lmbd and clz patterns.
* doc/extend.texi: Document PRU builtins.
gcc/testsuite/ChangeLog:
* gcc.target/pru/halt.c: New test.
* gcc.target/pru/lmbd.c: New test.
Diffstat (limited to 'gcc/doc/extend.texi')
-rw-r--r-- | gcc/doc/extend.texi | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index c084dd1..cdf9108 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -14154,6 +14154,7 @@ instructions, but allow the compiler to schedule those calls. * PowerPC Hardware Transactional Memory Built-in Functions:: * PowerPC Atomic Memory Operation Functions:: * PowerPC Matrix-Multiply Assist Built-in Functions:: +* PRU Built-in Functions:: * RISC-V Built-in Functions:: * RX Built-in Functions:: * S/390 System z Built-in Functions:: @@ -21934,6 +21935,33 @@ vec_t __builtin_vsx_xvcvspbf16 (vec_t); vec_t __builtin_vsx_xvcvbf16spn (vec_t); @end smallexample +@node PRU Built-in Functions +@subsection PRU Built-in Functions + +GCC provides a couple of special builtin functions to aid in utilizing +special PRU instructions. + +The built-in functions supported are: + +@table @code +@item __delay_cycles (long long @var{cycles}) +This inserts an instruction sequence that takes exactly @var{cycles} +cycles (between 0 and 0xffffffff) to complete. The inserted sequence +may use jumps, loops, or no-ops, and does not interfere with any other +instructions. Note that @var{cycles} must be a compile-time constant +integer - that is, you must pass a number, not a variable that may be +optimized to a constant later. The number of cycles delayed by this +builtin is exact. + +@item __halt (void) +This inserts a HALT instruction to stop processor execution. + +@item unsigned int __lmbd (unsigned int @var{wordval}, unsigned int @var{bitval}) +This inserts LMBD instruction to calculate the left-most bit with value +@var{bitval} in value @var{wordval}. Only the least significant bit +of @var{bitval} is taken into account. +@end table + @node RISC-V Built-in Functions @subsection RISC-V Built-in Functions |