GNU PROLOG with UTF8 support
Macros | Functions | Variables
x86_64_any.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
Include dependency graph for x86_64_any.c:

Macros

#define STRING_PREFIX   ".LC"
 
#define DOUBLE_PREFIX   ".LCD"
 
#define UN
 
#define CONT_LABEL_FMT   ".Lcont%d"
 
#define MAX_C_ARGS_IN_C_CODE   32 /* must be a multiple of 2 */
 
#define RESERVED_STACK_SPACE   MAX_C_ARGS_IN_C_CODE * 8
 
#define MAX_DOUBLES_IN_PRED   2048
 
#define MAX_GPR_ARGS   6
 
#define MAX_FPR_ARGS   8
 
#define LITTLE_INT(X)   ((X) >= INT_MIN && (X) <= INT_MAX)
 
#define ASM_REG_BANK   "%r12"
 
#define BEFORE_ARG
 
#define BEFORE_FPR_ARG
 
#define AFTER_ARG   }
 
#define AFTER_FPR_ARG   }
 

Functions

static char * Off_Reg_Bank (int offset)
 
void Asm_Start (void)
 
void Asm_Stop (void)
 
void Code_Start (char *label, int prolog, int global)
 
void Code_Stop (void)
 
void Label (char *label)
 
void Reload_E_In_Register (void)
 
void Pl_Jump (char *label)
 
void Prep_CP (void)
 
void Here_CP (void)
 
void Pl_Call (char *label)
 
void Pl_Fail (void)
 
void Pl_Ret (void)
 
void Jump (char *label)
 
void Move_From_Reg_X (int index)
 
void Move_From_Reg_Y (int index)
 
void Move_To_Reg_X (int index)
 
void Move_To_Reg_Y (int index)
 
void Call_C_Start (char *fct_name, int fc, int nb_args, int nb_args_in_words, char **p_inline)
 
int Call_C_Arg_Int (int offset, PlLong int_val)
 
int Call_C_Arg_Double (int offset, double dbl_val)
 
int Call_C_Arg_String (int offset, int str_no)
 
int Call_C_Arg_Mem_L (int offset, int adr_of, char *name, int index)
 
int Call_C_Arg_Reg_X (int offset, int adr_of, int index)
 
int Call_C_Arg_Reg_Y (int offset, int adr_of, int index)
 
int Call_C_Arg_Foreign_L (int offset, int adr_of, int index)
 
int Call_C_Arg_Foreign_D (int offset, int adr_of, int index)
 
void Call_C_Invoke (char *fct_name, int fc, int nb_args, int nb_args_in_words)
 
void Call_C_Stop (char *fct_name, int nb_args, char **p_inline)
 
void Jump_Ret (void)
 
void Fail_Ret (void)
 
void Move_Ret_To_Mem_L (char *name, int index)
 
void Move_Ret_To_Reg_X (int index)
 
void Move_Ret_To_Reg_Y (int index)
 
void Move_Ret_To_Foreign_L (int index)
 
void Move_Ret_To_Foreign_D (int index)
 
void Cmp_Ret_And_Int (PlLong int_val)
 
void Jump_If_Equal (char *label)
 
void Jump_If_Greater (char *label)
 
void C_Ret (void)
 
void Dico_String_Start (int nb_consts)
 
void Dico_String (int str_no, char *asciiz)
 
void Dico_String_Stop (int nb_consts)
 
void Dico_Long_Start (int nb_longs)
 
void Dico_Long (char *name, int global, VType vtype, PlLong value)
 
void Dico_Long_Stop (int nb_longs)
 
void Data_Start (char *initializer_fct)
 
void Data_Stop (char *initializer_fct)
 

Variables

static double dbl_tbl [MAX_DOUBLES_IN_PRED]
 
static int nb_dbl = 0
 
static int dbl_lc_no = 0
 
char asm_reg_e [20]
 
char asm_reg_b [20]
 
char asm_reg_cp [20]
 
int w_label = 0
 
static int gpr_arg_no
 
static const char * gpr_arg [MAX_GPR_ARGS]
 
static int fpr_arg_no
 
static const char * fpr_arg [MAX_FPR_ARGS]
 
int can_produce_pic_code = 1
 
char * comment_prefix = "#"
 
char * local_symb_prefix = ".L"
 
int strings_need_null = 0
 
int call_c_reverse_args = 0
 
char * inline_asm_data [] = { NULL }
 

Macro Definition Documentation

#define AFTER_ARG   }
#define AFTER_FPR_ARG   }
#define ASM_REG_BANK   "%r12"
#define BEFORE_ARG
Value:
{ \
char r[10], *r_aux; \
int r_eq_r_aux = 0; \
\
{ \
strcpy(r, gpr_arg[gpr_arg_no++]); \
r_aux = r; \
r_eq_r_aux = 1; \
} \
else \
{ \
int nwords = offset - gpr_arg_no - fpr_arg_no; \
\
sprintf(r, "%d(%%rsp)", nwords * 8); \
r_aux = "%rax"; \
}
static int fpr_arg_no
Definition: x86_64_any.c:144
static const char * gpr_arg[MAX_GPR_ARGS]
Definition: x86_64_any.c:138
#define MAX_GPR_ARGS
Definition: x86_64_any.c:136
static int gpr_arg_no
Definition: x86_64_any.c:137
#define BEFORE_FPR_ARG
Value:
{ \
char r[10], *r_aux; \
int r_eq_r_aux = 0; \
\
{ \
strcpy(r, fpr_arg[fpr_arg_no++]); \
r_aux = r; \
r_eq_r_aux = 1; \
} \
else \
{ \
int nwords = offset - gpr_arg_no - fpr_arg_no; \
\
sprintf(r, "%d(%%rsp)", nwords * 8); \
r_aux = "%xmm8"; \
}
static int fpr_arg_no
Definition: x86_64_any.c:144
#define MAX_FPR_ARGS
Definition: x86_64_any.c:143
static const char * fpr_arg[MAX_FPR_ARGS]
Definition: x86_64_any.c:145
static int gpr_arg_no
Definition: x86_64_any.c:137
#define CONT_LABEL_FMT   ".Lcont%d"
#define DOUBLE_PREFIX   ".LCD"
#define LITTLE_INT (   X)    ((X) >= INT_MIN && (X) <= INT_MAX)
#define MAX_C_ARGS_IN_C_CODE   32 /* must be a multiple of 2 */
#define MAX_DOUBLES_IN_PRED   2048
#define MAX_FPR_ARGS   8
#define MAX_GPR_ARGS   6
#define RESERVED_STACK_SPACE   MAX_C_ARGS_IN_C_CODE * 8
#define STRING_PREFIX   ".LC"
#define UN

Function Documentation

void Asm_Start ( void  )

Here is the call graph for this function:

void Asm_Stop ( void  )

Here is the call graph for this function:

void C_Ret ( void  )

Here is the call graph for this function:

int Call_C_Arg_Double ( int  offset,
double  dbl_val 
)

Here is the call graph for this function:

int Call_C_Arg_Foreign_D ( int  offset,
int  adr_of,
int  index 
)

Here is the call graph for this function:

int Call_C_Arg_Foreign_L ( int  offset,
int  adr_of,
int  index 
)

Here is the call graph for this function:

int Call_C_Arg_Int ( int  offset,
PlLong  int_val 
)

Here is the call graph for this function:

int Call_C_Arg_Mem_L ( int  offset,
int  adr_of,
char *  name,
int  index 
)

Here is the call graph for this function:

int Call_C_Arg_Reg_X ( int  offset,
int  adr_of,
int  index 
)

Here is the call graph for this function:

int Call_C_Arg_Reg_Y ( int  offset,
int  adr_of,
int  index 
)

Here is the call graph for this function:

int Call_C_Arg_String ( int  offset,
int  str_no 
)

Here is the call graph for this function:

void Call_C_Invoke ( char *  fct_name,
int  fc,
int  nb_args,
int  nb_args_in_words 
)

Here is the call graph for this function:

void Call_C_Start ( char *  fct_name,
int  fc,
int  nb_args,
int  nb_args_in_words,
char **  p_inline 
)
void Call_C_Stop ( char *  fct_name,
int  nb_args,
char **  p_inline 
)
void Cmp_Ret_And_Int ( PlLong  int_val)

Here is the call graph for this function:

void Code_Start ( char *  label,
int  prolog,
int  global 
)

Here is the call graph for this function:

void Code_Stop ( void  )

Here is the call graph for this function:

void Data_Start ( char *  initializer_fct)

Here is the call graph for this function:

void Data_Stop ( char *  initializer_fct)
void Dico_Long ( char *  name,
int  global,
VType  vtype,
PlLong  value 
)

Here is the call graph for this function:

void Dico_Long_Start ( int  nb_longs)

Here is the call graph for this function:

void Dico_Long_Stop ( int  nb_longs)

Here is the call graph for this function:

void Dico_String ( int  str_no,
char *  asciiz 
)

Here is the call graph for this function:

void Dico_String_Start ( int  nb_consts)

Here is the call graph for this function:

void Dico_String_Stop ( int  nb_consts)
void Fail_Ret ( void  )

Here is the call graph for this function:

void Here_CP ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void Jump ( char *  label)

Here is the call graph for this function:

void Jump_If_Equal ( char *  label)

Here is the call graph for this function:

void Jump_If_Greater ( char *  label)

Here is the call graph for this function:

void Jump_Ret ( void  )

Here is the call graph for this function:

void Label ( char *  label)

Here is the call graph for this function:

Here is the caller graph for this function:

void Move_From_Reg_X ( int  index)

Here is the call graph for this function:

void Move_From_Reg_Y ( int  index)

Here is the call graph for this function:

void Move_Ret_To_Foreign_D ( int  index)

Here is the call graph for this function:

void Move_Ret_To_Foreign_L ( int  index)

Here is the call graph for this function:

void Move_Ret_To_Mem_L ( char *  name,
int  index 
)

Here is the call graph for this function:

void Move_Ret_To_Reg_X ( int  index)

Here is the call graph for this function:

void Move_Ret_To_Reg_Y ( int  index)

Here is the call graph for this function:

void Move_To_Reg_X ( int  index)

Here is the call graph for this function:

void Move_To_Reg_Y ( int  index)

Here is the call graph for this function:

static char * Off_Reg_Bank ( int  offset)
static

Here is the caller graph for this function:

void Pl_Call ( char *  label)

Here is the call graph for this function:

void Pl_Fail ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void Pl_Jump ( char *  label)

Here is the call graph for this function:

Here is the caller graph for this function:

void Pl_Ret ( void  )

Here is the call graph for this function:

void Prep_CP ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void Reload_E_In_Register ( void  )

Here is the call graph for this function:

Variable Documentation

char asm_reg_b[20]
char asm_reg_cp[20]
char asm_reg_e[20]
int call_c_reverse_args = 0
int can_produce_pic_code = 1
char* comment_prefix = "#"
int dbl_lc_no = 0
static
double dbl_tbl[MAX_DOUBLES_IN_PRED]
static
const char* fpr_arg[MAX_FPR_ARGS]
static
Initial value:
= {
"%xmm0", "%xmm1", "%xmm2", "%xmm3",
"%xmm4", "%xmm5", "%xmm6", "%xmm7"
}
int fpr_arg_no
static
const char* gpr_arg[MAX_GPR_ARGS]
static
Initial value:
= {
"%rdi", "%rsi", "%rdx",
"%rcx", "%r8", "%r9"
}
int gpr_arg_no
static
char* inline_asm_data[] = { NULL }
char* local_symb_prefix = ".L"
int nb_dbl = 0
static
int strings_need_null = 0
int w_label = 0