aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 0b572af..4b77599 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -16974,6 +16974,23 @@ __builtin_avr_insert_bits (0x01234567, bits, 0);
@end smallexample
@enddefbuiltin
+@defbuiltin{uint8_t __builtin_avr_mask1 (uint8_t @var{mask}, uint8_t @var{offs})}
+Rotate the 8-bit constant value @var{mask} by an offset of @var{offs},
+where @var{mask} is in @{ 0x01, 0xfe, 0x7f, 0x80 @}.
+This built-in can be use as an alternative to 8-bit expressions like
+@code{1 << offs} when their computation consumes too much
+time, and @var{offs} is known to be in the range 0@dots{}7.
+@example
+__builtin_avr_mask1 (1, offs) // same like 1 << offs
+__builtin_avr_mask1 (~1, offs) // same like ~(1 << offs)
+__builtin_avr_mask1 (0x80, offs) // same like 0x80 >> offs
+__builtin_avr_mask1 (~0x80, offs) // same like ~(0x80 >> offs)
+@end example
+The open coded C versions take at least @code{5 + 4 * @var{offs}} cycles
+(and 5 instructions), whereas the built-in takes 7 cycles and instructions
+(8 cycles and instructions in the case of @code{@var{mask} = 0x7f}).
+@enddefbuiltin
+
@defbuiltin{void __builtin_avr_nops (uint16_t @var{count})}
Insert @var{count} @code{NOP} instructions.
The number of instructions must be a compile-time integer constant.