Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Typedefs | Enumerations | Functions | Variables
tc-i386.c File Reference
#include "as.h"
#include "safe-ctype.h"
#include "subsegs.h"
#include "dwarf2dbg.h"
#include "dw2gencfi.h"
#include "elf/x86-64.h"

Go to the source code of this file.

Classes

union  i386_op
struct  _i386_insn

Defines

#define REGISTER_WARNINGS   1
#define INFER_ADDR_PREFIX   1
#define SCALE1_WHEN_NO_INDEX   1
#define DEFAULT_ARCH   "i386"
#define INLINE
#define Operand_PCrel   1
#define PREFIX_SEPARATOR   '/'
#define is_mnemonic_char(x)   (mnemonic_chars[(unsigned char) x])
#define is_operand_char(x)   (operand_chars[(unsigned char) x])
#define is_register_char(x)   (register_chars[(unsigned char) x])
#define is_space_char(x)   ((x) == ' ')
#define is_identifier_char(x)   (identifier_chars[(unsigned char) x])
#define is_digit_char(x)   (digit_chars[(unsigned char) x])
#define END_STRING_AND_SAVE(s)   do { *save_stack_p++ = *(s); *(s) = '\0'; } while (0)
#define RESTORE_END_STRING(s)   do { *(s) = *--save_stack_p; } while (0)
#define NUM_FLAG_CODE   ((int) CODE_64BIT + 1)
#define UNCOND_JUMP   0
#define COND_JUMP   1
#define COND_JUMP86   2
#define CODE16   1
#define SMALL   0
#define SMALL16   (SMALL | CODE16)
#define BIG   2
#define BIG16   (BIG | CODE16)
#define ENCODE_RELAX_STATE(type, size)   ((relax_substateT) (((type) << 2) | (size)))
#define TYPE_FROM_RELAX_STATE(s)   ((s) >> 2)
#define DISP_SIZE_FROM_RELAX_STATE(s)   ((((s) & 3) == BIG ? 4 : (((s) & 3) == BIG16 ? 2 : 1)))
#define MATCH(overlap, given, template)
#define CONSISTENT_REGISTER_MATCH(m0, g0, t0, m1, g1, t1)
#define lex_got(reloc, adjust, types)   NULL
#define GCC_ASM_O_HACK   0
#define MAX_LITTLENUMS   6
#define OPTION_32   (OPTION_MD_BASE + 0)
#define OPTION_64   (OPTION_MD_BASE + 1)
#define OPTION_DIVIDE   (OPTION_MD_BASE + 2)
#define OPTION_MARCH   (OPTION_MD_BASE + 3)
#define OPTION_MTUNE   (OPTION_MD_BASE + 4)
#define T_NIL   -1
#define T_CONST   1
#define T_REG   2
#define T_BYTE   3
#define T_WORD   4
#define T_DWORD   5
#define T_FWORD   6
#define T_QWORD   7
#define T_TBYTE   8
#define T_XMMWORD   9
#define T_SHORT   10
#define T_OFFSET   11
#define T_PTR   12
#define T_ID   13
#define T_SHL   14
#define T_SHR   15
#define NUM_ADDRESS_REGS   (!!i.base_reg + !!i.index_reg)

Typedefs

typedef struct _i386_insn

Enumerations

enum  flag_code { CODE_32BIT, CODE_16BIT, CODE_64BIT }

Functions

static void set_code_flag (int)
static void set_16bit_gcc_code_flag (int)
static void set_intel_syntax (int)
static void set_cpu_arch (int)
static void signed_cons (int)
static char * output_invalid (int c)
static int i386_operand (char *)
static int i386_intel_operand (char *, int)
static const reg_entryparse_register (char *, char **)
static char * parse_insn (char *, char *)
static char * parse_operands (char *, const char *)
static void swap_operands (void)
static void swap_2_operands (int, int)
static void optimize_imm (void)
static void optimize_disp (void)
static int match_template (void)
static int check_string (void)
static int process_suffix (void)
static int check_byte_reg (void)
static int check_long_reg (void)
static int check_qword_reg (void)
static int check_word_reg (void)
static int finalize_imm (void)
static int process_operands (void)
static const seg_entrybuild_modrm_byte (void)
static void output_insn (void)
static void output_imm (fragS *, offsetT)
static void output_disp (fragS *, offsetT)
static void s_bss (int)

Variables

static const char * default_arch = DEFAULT_ARCH
const char extra_symbol_chars [] = "*%-(["
const char * i386_comment_chars = "#"
const char line_comment_chars [] = "#/"
const char line_separator_chars [] = ";"
const char EXP_CHARS [] = "eE"
const char FLT_CHARS [] = "fFdDxX"
static char mnemonic_chars [256]
static char register_chars [256]
static char operand_chars [256]
static char identifier_chars [256]
static char digit_chars [256]
static char operand_special_chars [] = "%$-+(,)*._~/<>|&^!:[@]"
static char save_stack [32]
static char * save_stack_p
static i386_insn i
static const templatescurrent_templates
static expressionS disp_expressions [MAX_MEMORY_OPERANDS]
static expressionS im_expressions [MAX_IMMEDIATE_OPERANDS]
static int this_operand

Class Documentation

union i386_op

Definition at line 108 of file tc-i386.c.

Collaboration diagram for i386_op:
Class Members
expressionS * disps
expressionS * imms
const reg_entry * regs
struct _i386_insn

Definition at line 115 of file tc-i386.c.

Collaboration diagram for _i386_insn:
Class Members
unsigned int disp_operands
unsigned int flags
unsigned int imm_operands
unsigned int mem_operands
unsigned int operands
unsigned int reg_operands
char suffix
template tm
unsigned int types

Define Documentation

#define BIG   2
#define BIG16   (BIG | CODE16)
#define CODE16   1
#define COND_JUMP   1
#define COND_JUMP86   2
#define CONSISTENT_REGISTER_MATCH (   m0,
  g0,
  t0,
  m1,
  g1,
  t1 
)
Value:
(((g0) & Reg) == 0 || ((g1) & Reg) == 0                 \
   || ((g0) & Reg) == ((g1) & Reg)                      \
   || ((((m0) & Acc) ? Reg : (t0)) & (((m1) & Acc) ? Reg : (t1)) & Reg) == 0 )
#define DEFAULT_ARCH   "i386"

Definition at line 54 of file tc-i386.c.

#define DISP_SIZE_FROM_RELAX_STATE (   s)    ((((s) & 3) == BIG ? 4 : (((s) & 3) == BIG16 ? 2 : 1)))
#define ENCODE_RELAX_STATE (   type,
  size 
)    ((relax_substateT) (((type) << 2) | (size)))
#define END_STRING_AND_SAVE (   s)    do { *save_stack_p++ = *(s); *(s) = '\0'; } while (0)

Definition at line 247 of file tc-i386.c.

#define GCC_ASM_O_HACK   0
#define INFER_ADDR_PREFIX   1

Definition at line 42 of file tc-i386.c.

#define INLINE

Definition at line 61 of file tc-i386.c.

#define is_digit_char (   x)    (digit_chars[(unsigned char) x])

Definition at line 236 of file tc-i386.c.

#define is_identifier_char (   x)    (identifier_chars[(unsigned char) x])

Definition at line 235 of file tc-i386.c.

#define is_mnemonic_char (   x)    (mnemonic_chars[(unsigned char) x])

Definition at line 231 of file tc-i386.c.

#define is_operand_char (   x)    (operand_chars[(unsigned char) x])

Definition at line 232 of file tc-i386.c.

#define is_register_char (   x)    (register_chars[(unsigned char) x])

Definition at line 233 of file tc-i386.c.

#define is_space_char (   x)    ((x) == ' ')

Definition at line 234 of file tc-i386.c.

#define lex_got (   reloc,
  adjust,
  types 
)    NULL
#define MATCH (   overlap,
  given,
  template 
)
Value:
((overlap & ~JumpAbsolute)                              \
   && (((given) & (BaseIndex | JumpAbsolute))                  \
       == ((overlap) & (BaseIndex | JumpAbsolute))))
#define MAX_LITTLENUMS   6
#define NUM_ADDRESS_REGS   (!!i.base_reg + !!i.index_reg)
#define NUM_FLAG_CODE   ((int) CODE_64BIT + 1)

Definition at line 272 of file tc-i386.c.

#define Operand_PCrel   1

Definition at line 142 of file tc-i386.c.

#define OPTION_32   (OPTION_MD_BASE + 0)
#define OPTION_64   (OPTION_MD_BASE + 1)
#define OPTION_DIVIDE   (OPTION_MD_BASE + 2)
#define OPTION_MARCH   (OPTION_MD_BASE + 3)
#define OPTION_MTUNE   (OPTION_MD_BASE + 4)
#define PREFIX_SEPARATOR   '/'

Definition at line 199 of file tc-i386.c.

#define REGISTER_WARNINGS   1

Definition at line 38 of file tc-i386.c.

#define RESTORE_END_STRING (   s)    do { *(s) = *--save_stack_p; } while (0)

Definition at line 249 of file tc-i386.c.

#define SCALE1_WHEN_NO_INDEX   1

Definition at line 50 of file tc-i386.c.

#define SMALL   0
#define SMALL16   (SMALL | CODE16)
#define T_BYTE   3
#define T_CONST   1
#define T_DWORD   5
#define T_FWORD   6
#define T_ID   13
#define T_NIL   -1
#define T_OFFSET   11
#define T_PTR   12
#define T_QWORD   7
#define T_REG   2
#define T_SHL   14
#define T_SHORT   10
#define T_SHR   15
#define T_TBYTE   8
#define T_WORD   4
#define T_XMMWORD   9
#define TYPE_FROM_RELAX_STATE (   s)    ((s) >> 2)
#define UNCOND_JUMP   0

Typedef Documentation

typedef struct _i386_insn

Definition at line 170 of file tc-i386.c.


Enumeration Type Documentation

enum flag_code
Enumerator:
CODE_32BIT 
CODE_16BIT 
CODE_64BIT 

Definition at line 268 of file tc-i386.c.


Function Documentation

static const seg_entry* build_modrm_byte ( void  ) [static]
static int check_byte_reg ( void  ) [static]
static int check_long_reg ( void  ) [static]
static int check_qword_reg ( void  ) [static]
static int check_string ( void  ) [static]
static int check_word_reg ( void  ) [static]
static int finalize_imm ( void  ) [static]
static int i386_intel_operand ( char *  ,
int   
) [static]
static int i386_operand ( char *  ) [static]
static int match_template ( void  ) [static]
static void optimize_disp ( void  ) [static]
static void optimize_imm ( void  ) [static]
static void output_disp ( fragS *  ,
offsetT   
) [static]
static void output_imm ( fragS *  ,
offsetT   
) [static]
static void output_insn ( void  ) [static]
static char* output_invalid ( int  c) [static]
static char* parse_insn ( char *  ,
char *   
) [static]
static char* parse_operands ( char *  ,
const char *   
) [static]
static const reg_entry* parse_register ( char *  ,
char **   
) [static]
static int process_operands ( void  ) [static]
static int process_suffix ( void  ) [static]
static void s_bss ( int  ) [static]
static void set_16bit_gcc_code_flag ( int  ) [static]
static void set_code_flag ( int  ) [static]
static void set_cpu_arch ( int  ) [static]
static void set_intel_syntax ( int  ) [static]
static void signed_cons ( int  ) [static]
static void swap_2_operands ( int  ,
int   
) [static]
static void swap_operands ( void  ) [static]

Variable Documentation

Definition at line 256 of file tc-i386.c.

const char* default_arch = DEFAULT_ARCH [static]

Definition at line 103 of file tc-i386.c.

char digit_chars[256] [static]

Definition at line 228 of file tc-i386.c.

Definition at line 259 of file tc-i386.c.

const char EXP_CHARS[] = "eE"

Definition at line 216 of file tc-i386.c.

const char extra_symbol_chars[] = "*%-(["

Definition at line 174 of file tc-i386.c.

const char FLT_CHARS[] = "fFdDxX"

Definition at line 221 of file tc-i386.c.

i386_insn i [static]

Definition at line 253 of file tc-i386.c.

Definition at line 198 of file tc-i386.c.

char identifier_chars[256] [static]

Definition at line 227 of file tc-i386.c.

Definition at line 260 of file tc-i386.c.

const char line_comment_chars[] = "#/"

Definition at line 210 of file tc-i386.c.

Definition at line 212 of file tc-i386.c.

char mnemonic_chars[256] [static]

Definition at line 224 of file tc-i386.c.

char operand_chars[256] [static]

Definition at line 226 of file tc-i386.c.

char operand_special_chars[] = "%$-+(,)*._~/<>|&^!:[@]" [static]

Definition at line 239 of file tc-i386.c.

char register_chars[256] [static]

Definition at line 225 of file tc-i386.c.

char save_stack[32] [static]

Definition at line 245 of file tc-i386.c.

char* save_stack_p [static]

Definition at line 246 of file tc-i386.c.

int this_operand [static]

Definition at line 263 of file tc-i386.c.