aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2017-07-21 08:20:51 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2017-07-21 08:20:51 +0000
commit74360f142c0d98a4f643f3417133bea0b7fca75e (patch)
treeacc7f8eb3edd4ab013c36c157fe5e7ed1518903b /gcc
parentba61fc5308e838edce8bbb2fb6f1899bcd9789d5 (diff)
downloadgcc-74360f142c0d98a4f643f3417133bea0b7fca75e.zip
gcc-74360f142c0d98a4f643f3417133bea0b7fca75e.tar.gz
gcc-74360f142c0d98a4f643f3417133bea0b7fca75e.tar.bz2
invoke.texi (AVR Built-in Functions): Re-layout section.
gcc/ * doc/invoke.texi (AVR Built-in Functions): Re-layout section. From-SVN: r250419
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/doc/extend.texi77
2 files changed, 42 insertions, 39 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 121af77..b024884 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2017-07-21 Georg-Johann Lay <avr@gjlay.de>
+
+ * doc/invoke.texi (AVR Built-in Functions): Re-layout section.
+
2016-07-21 Jan Hubicka <hubicka@ucw.cz>
* cfgcleanup.c (flow_find_cross_jump): Do not crossjump across
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index b6244a0..da5b0af 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -12748,54 +12748,37 @@ or if not a specific built-in is implemented or not. For example, if
@code{__builtin_avr_nop} is available the macro
@code{__BUILTIN_AVR_NOP} is defined to @code{1} and undefined otherwise.
-The following built-in functions map to the respective machine
+@table @code
+
+@item void __builtin_avr_nop (void)
+@itemx void __builtin_avr_sei (void)
+@itemx void __builtin_avr_cli (void)
+@itemx void __builtin_avr_sleep (void)
+@itemx void __builtin_avr_wdr (void)
+@itemx unsigned char __builtin_avr_swap (unsigned char)
+@itemx unsigned int __builtin_avr_fmul (unsigned char, unsigned char)
+@itemx int __builtin_avr_fmuls (char, char)
+@itemx int __builtin_avr_fmulsu (char, unsigned char)
+These built-in functions map to the respective machine
instruction, i.e.@: @code{nop}, @code{sei}, @code{cli}, @code{sleep},
@code{wdr}, @code{swap}, @code{fmul}, @code{fmuls}
resp. @code{fmulsu}. The three @code{fmul*} built-ins are implemented
as library call if no hardware multiplier is available.
-@smallexample
-void __builtin_avr_nop (void)
-void __builtin_avr_sei (void)
-void __builtin_avr_cli (void)
-void __builtin_avr_sleep (void)
-void __builtin_avr_wdr (void)
-unsigned char __builtin_avr_swap (unsigned char)
-unsigned int __builtin_avr_fmul (unsigned char, unsigned char)
-int __builtin_avr_fmuls (char, char)
-int __builtin_avr_fmulsu (char, unsigned char)
-@end smallexample
-
-In order to delay execution for a specific number of cycles, GCC
-implements
-@smallexample
-void __builtin_avr_delay_cycles (unsigned long ticks)
-@end smallexample
-
-@noindent
-@code{ticks} is the number of ticks to delay execution. Note that this
+@item void __builtin_avr_delay_cycles (unsigned long ticks)
+Delay execution for @var{ticks} cycles. Note that this
built-in does not take into account the effect of interrupts that
-might increase delay time. @code{ticks} must be a compile-time
+might increase delay time. @var{ticks} must be a compile-time
integer constant; delays with a variable number of cycles are not supported.
-@smallexample
-char __builtin_avr_flash_segment (const __memx void*)
-@end smallexample
-
-@noindent
+@item char __builtin_avr_flash_segment (const __memx void*)
This built-in takes a byte address to the 24-bit
@ref{AVR Named Address Spaces,address space} @code{__memx} and returns
the number of the flash segment (the 64 KiB chunk) where the address
points to. Counting starts at @code{0}.
If the address does not point to flash memory, return @code{-1}.
-@smallexample
-unsigned char __builtin_avr_insert_bits (unsigned long map,
- unsigned char bits,
- unsigned char val)
-@end smallexample
-
-@noindent
+@item uint8_t __builtin_avr_insert_bits (uint32_t map, uint8_t bits, uint8_t val)
Insert bits from @var{bits} into @var{val} and return the resulting
value. The nibbles of @var{map} determine how the insertion is
performed: Let @var{X} be the @var{n}-th nibble of @var{map}
@@ -12840,13 +12823,29 @@ __builtin_avr_insert_bits (0xffff3210, bits, val)
__builtin_avr_insert_bits (0x01234567, bits, 0)
@end smallexample
-@smallexample
-void __builtin_avr_nops (unsigned count)
-@end smallexample
+@item void __builtin_avr_nops (unsigned count)
+Insert @var{count} @code{NOP} instructions.
+The number of instructions must be a compile-time integer constant.
+
+@end table
@noindent
-Insert @code{count} @code{NOP} instructions.
-The number of instructions must be a compile-time integer constant.
+There are many more AVR-specific built-in functions that are used to
+implement the ISO/IEC TR 18037 ``Embedded C'' fixed-point functions of
+section 7.18a.6. You don't need to use these built-ins directly.
+Instead, use the declarations as supplied by the @code{stdfix.h} header
+with GNU-C99:
+
+@smallexample
+#include <stdfix.h>
+
+// Re-interpret the bit representation of unsigned 16-bit
+// integer @var{uval} as Q-format 0.16 value.
+unsigned fract get_bits (uint_ur_t uval)
+@{
+ return urbits (uval);
+@}
+@end smallexample
@node Blackfin Built-in Functions
@subsection Blackfin Built-in Functions