2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. _picochip-built-in-functions:
8 picoChip Built-in Functions
9 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 GCC provides an interface to selected machine instructions from the
12 picoChip instruction set.
14 .. function:: int __builtin_sbc (int value)
16 Sign bit count. Return the number of consecutive bits in :samp:`{value}`
17 that have the same value as the sign bit. The result is the number of
18 leading sign bits minus one, giving the number of redundant sign bits in
21 .. function:: int __builtin_byteswap (int value)
23 Byte swap. Return the result of swapping the upper and lower bytes of
26 .. function:: int __builtin_brev (int value)
28 Bit reversal. Return the result of reversing the bits in
29 :samp:`{value}`. Bit 15 is swapped with bit 0, bit 14 is swapped with bit 1,
32 .. function:: int __builtin_adds (int x, int y)
34 Saturating addition. Return the result of adding :samp:`{x}` and :samp:`{y}`,
35 storing the value 32767 if the result overflows.
37 .. function:: int __builtin_subs (int x, int y)
39 Saturating subtraction. Return the result of subtracting :samp:`{y}` from
40 :samp:`{x}`, storing the value -32768 if the result overflows.
42 .. function:: void __builtin_halt (void)
44 Halt. The processor stops execution. This built-in is useful for
45 implementing assertions.