libFirm
Loading...
Searching...
No Matches
Target Setup and Information

Topics

 Machine Triple
 
 
 Target platform information
 
 

Functions

int ir_target_set (const char *target_triple)
 Prepares code generation for the target specifiy by target_triple.
 
int ir_target_set_triple (ir_machine_triple_t const *machine)
 Prepares code generation for the target specified by machine.
 
int ir_target_option (char const *option)
 Configures the current target.
 
void ir_target_init (void)
 Initializes the code generation target.
 
char const * ir_target_experimental (void)
 Returns a message if the current target is considered experimental.
 
int ir_target_big_endian (void)
 Returns 1 if target uses big endian byte order, 0 if little endian.
 
unsigned ir_target_biggest_alignment (void)
 Returns the biggest alignment required for any target data access.
 
unsigned ir_target_pointer_size (void)
 Returns the size of a pointer in bytes for the target.
 
int ir_target_supports_pic (void)
 Returns 1 if target supports position independent code, 0 otherwise.
 
int ir_target_fast_unaligned_memaccess (void)
 Returns 1 if unaligned memory accesses are (nearly) as fast as aligned ones, 0 otherwise.
 
ir_modeir_target_float_arithmetic_mode (void)
 Returns supported float arithmetic mode or NULL if mode_D and mode_F are supported natively.
 
float_int_conversion_overflow_style_t ir_target_float_int_overflow_style (void)
 Returns a.
 

Detailed Description

Function Documentation

◆ ir_target_big_endian()

int ir_target_big_endian ( void )

Returns 1 if target uses big endian byte order, 0 if little endian.

◆ ir_target_biggest_alignment()

unsigned ir_target_biggest_alignment ( void )

Returns the biggest alignment required for any target data access.

◆ ir_target_experimental()

char const * ir_target_experimental ( void )

Returns a message if the current target is considered experimental.

◆ ir_target_fast_unaligned_memaccess()

int ir_target_fast_unaligned_memaccess ( void )

Returns 1 if unaligned memory accesses are (nearly) as fast as aligned ones, 0 otherwise.

◆ ir_target_float_arithmetic_mode()

ir_mode * ir_target_float_arithmetic_mode ( void )

Returns supported float arithmetic mode or NULL if mode_D and mode_F are supported natively.

Some backends like x87 can only do arithmetic in a specific float mode (load/store are still done in the "normal" float/double modes).

◆ ir_target_float_int_overflow_style()

float_int_conversion_overflow_style_t ir_target_float_int_overflow_style ( void )

Returns a.

See also
float_int_conversion_overflow_style_t that specifies what happens when a float value is converted to an integer and overflow occurs.

◆ ir_target_init()

void ir_target_init ( void )

Initializes the code generation target.

This must be called after using ir_target_set() or ir_target_set_triple() and possibly ir_target_option(). This defines mode_P and finalizes target and platform information which may be queried after.

◆ ir_target_option()

int ir_target_option ( char const * option)

Configures the current target.

Passes an option to furhter configure the currently selected target. This is allowed after calling ir_target_set() or ir_target_set_triple() but not after calling ir_target_init().

Some available options:

  • omitfp[=0/1] Try to produce code without using a frame pointer.
  • pic[=0/1] Produce position independent code.
  • noplt[=0/1] Avoid using a PLT in position independent code.
  • verboseasm[=0/1] Annotate assembler with verbose comments
  • help Print a list of available options.

The exact set of options is target and platform specific.

Returns
-1 if 'help' was found, 0 if the argument could not be parsed, 1 if the option could be set.

◆ ir_target_pointer_size()

unsigned ir_target_pointer_size ( void )

Returns the size of a pointer in bytes for the target.

◆ ir_target_set()

int ir_target_set ( const char * target_triple)

Prepares code generation for the target specifiy by target_triple.

See also
Machine Triple describes the format of target_triple. Note that preparation isn't finished until ir_target_init() is called.
Returns
1 if successfull, 0 if target_triple is malformed or unsupported.

◆ ir_target_set_triple()

int ir_target_set_triple ( ir_machine_triple_t const * machine)

Prepares code generation for the target specified by machine.

Note that preparation isn't finished until ir_target_init() is called.

Returns
1 if successfull, 0 if machine is malformed or unsupported.

◆ ir_target_supports_pic()

int ir_target_supports_pic ( void )

Returns 1 if target supports position independent code, 0 otherwise.