libFirm
Target Setup and Information

Modules

 Machine Triple
 Functions to work with machine triples.
 
 Target platform information
 The functions in this API return information about the operating system or runtime system.
 

Functions

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

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.