]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/gcc/extensions-to-the-c-language-family/target-builtins/picochip-built-in-functions.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gcc / extensions-to-the-c-language-family / target-builtins / picochip-built-in-functions.rst
1 ..
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.
5
6 .. _picochip-built-in-functions:
7
8 picoChip Built-in Functions
9 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
11 GCC provides an interface to selected machine instructions from the
12 picoChip instruction set.
13
14 .. function:: int __builtin_sbc (int value)
15
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
19 :samp:`{value}`.
20
21 .. function:: int __builtin_byteswap (int value)
22
23 Byte swap. Return the result of swapping the upper and lower bytes of
24 :samp:`{value}`.
25
26 .. function:: int __builtin_brev (int value)
27
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,
30 and so on.
31
32 .. function:: int __builtin_adds (int x, int y)
33
34 Saturating addition. Return the result of adding :samp:`{x}` and :samp:`{y}`,
35 storing the value 32767 if the result overflows.
36
37 .. function:: int __builtin_subs (int x, int y)
38
39 Saturating subtraction. Return the result of subtracting :samp:`{y}` from
40 :samp:`{x}`, storing the value -32768 if the result overflows.
41
42 .. function:: void __builtin_halt (void)
43
44 Halt. The processor stops execution. This built-in is useful for
45 implementing assertions.