From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/gcc~13/sh-built-in-functions.html | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 devdocs/gcc~13/sh-built-in-functions.html (limited to 'devdocs/gcc~13/sh-built-in-functions.html') diff --git a/devdocs/gcc~13/sh-built-in-functions.html b/devdocs/gcc~13/sh-built-in-functions.html new file mode 100644 index 00000000..2edd1462 --- /dev/null +++ b/devdocs/gcc~13/sh-built-in-functions.html @@ -0,0 +1,31 @@ +

6.60.32 SH Built-in Functions

The following built-in functions are supported on the SH1, SH2, SH3 and SH4 families of processors:

+Built-in Function: void __builtin_set_thread_pointer (void *ptr) +
+

Sets the ‘GBR’ register to the specified value ptr. This is usually used by system code that manages threads and execution contexts. The compiler normally does not generate code that modifies the contents of ‘GBR’ and thus the value is preserved across function calls. Changing the ‘GBR’ value in user code must be done with caution, since the compiler might use ‘GBR’ in order to access thread local variables.

+
+Built-in Function: void * __builtin_thread_pointer (void) +
+

Returns the value that is currently set in the ‘GBR’ register. Memory loads and stores that use the thread pointer as a base address are turned into ‘GBR’ based displacement loads and stores, if possible. For example:

+
struct my_tcb
+{
+   int a, b, c, d, e;
+};
+
+int get_tcb_value (void)
+{
+  // Generate ‘mov.l @(8,gbr),r0’ instruction
+  return ((my_tcb*)__builtin_thread_pointer ())->c;
+}
+
+
+Built-in Function: unsigned int __builtin_sh_get_fpscr (void) +

Returns the value that is currently set in the ‘FPSCR’ register.

+
+Built-in Function: void __builtin_sh_set_fpscr (unsigned int val) +

Sets the ‘FPSCR’ register to the specified value val, while preserving the current values of the FR, SZ and PR bits.

+
+

+ © Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
+ https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/SH-Built-in-Functions.html +

+
-- cgit v1.2.3