Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Built-in Functions Specific to Particular Target Machines   [Contents][Index]


7.13.34 SH Built-in Functions

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

Built-in Function:void__builtin_set_thread_pointer(void *ptr)

Sets the ‘GBR’ register to the specified valueptr. This is usuallyused by system code that manages threads and execution contexts. The compilernormally does not generate code that modifies the contents of ‘GBR’ andthus 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 areturned 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 intval)

Sets the ‘FPSCR’ register to the specified valueval, whilepreserving the current values of the FR, SZ and PR bits.


Next:SPARC VIS Built-in Functions, Previous:S/390 System z Built-in Functions, Up:Built-in Functions Specific to Particular Target Machines   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp