Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
isa_pseudo_gen.cxx File Reference
#include <cstddef>
#include <cstdlib>
#include <cstdarg>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <alloca.h>
#include <vector>
#include <list>
#include "topcode.h"
#include "gen_util.h"
#include "targ_isa_operands.h"
#include "isa_pseudo_gen.h"
Include dependency graph for isa_pseudo_gen.cxx:

Go to the source code of this file.

Classes

struct  pseudo_op
struct  expr

Defines

#define MAX_REQUIRE   10
#define MAX_MAP   (ISA_OPERAND_max_results + ISA_OPERAND_max_operands)
#define FNAME   "targ_isa_pseudo"

Typedefs

typedef struct pseudo_op PSEUDO_OP_INFO
typedef enum expr_kind EXPR_KIND
typedef struct expr EXPR

Enumerations

enum  DIRECTION {
  DIR_POS = 1, DIR_NEG = 2, DIR_EQ = 4, DIR_POSNEG = 3,
  DIR_POSEQ = 5, DIR_NEGEQ = 6, DIR_STAR = 7, UNKNOWN_DIRECTION,
  MACHINE_TO_PSEUDO, PSEUDO_TO_MACHINE
}
enum  expr_kind { EXPR_BOOL, EXPR_ARG_LVALUE, EXPR_ARG_RVALUE }

Functions

void ISA_Pseudo_Begin (const char *)
static int save_expr (const char *s, EXPR_KIND kind)
void Machine_To_Pseudo (TOP pseudo, TOP machine)
void Pseudo_To_Machine (TOP machine, TOP pseudo)
void Require (const char *bool_expr)
void Map_Arg (const char *lvalue, const char *expr)
static int compare_pseudos (const void *p1, const void *p2)
static void verify_machine_to_pseudo (PSEUDO_OP_INFO **vec, int i)
void order_pseudos (int *machine_to_pseudo_index, int *pseudo_to_machine_index)
void ISA_Pseudo_End (void)

Variables

static int num_pseudos
static list< PSEUDO_OP_INFO * > pseudos
static PSEUDO_OP_INFOcur_pseudo
static int max_require
static int max_map
static EXPR exprs
static EXPRlast_expr = &exprs
static const char *const interface []

Define Documentation

#define FNAME   "targ_isa_pseudo"
#define MAX_MAP   (ISA_OPERAND_max_results + ISA_OPERAND_max_operands)

Definition at line 63 of file isa_pseudo_gen.cxx.

Referenced by Map_Arg().

#define MAX_REQUIRE   10

Definition at line 62 of file isa_pseudo_gen.cxx.

Referenced by Require().


Typedef Documentation

typedef struct expr EXPR
typedef enum expr_kind EXPR_KIND
typedef struct pseudo_op PSEUDO_OP_INFO

Enumeration Type Documentation

enum DIRECTION
Enumerator:
DIR_POS 
DIR_NEG 
DIR_EQ 
DIR_POSNEG 
DIR_POSEQ 
DIR_NEGEQ 
DIR_STAR 
UNKNOWN_DIRECTION 
MACHINE_TO_PSEUDO 
PSEUDO_TO_MACHINE 

Definition at line 65 of file isa_pseudo_gen.cxx.

enum expr_kind
Enumerator:
EXPR_BOOL 
EXPR_ARG_LVALUE 
EXPR_ARG_RVALUE 

Definition at line 88 of file isa_pseudo_gen.cxx.


Function Documentation

static int compare_pseudos ( const void *  p1,
const void *  p2 
) [static]

Definition at line 262 of file isa_pseudo_gen.cxx.

References pseudo_op::dir, pseudo_op::from_opc, pseudo_op::nrequire, and PSEUDO_TO_MACHINE.

Referenced by order_pseudos().

void ISA_Pseudo_Begin ( const char *  )

Definition at line 139 of file isa_pseudo_gen.cxx.

Referenced by main().

void Machine_To_Pseudo ( TOP  pseudo,
TOP  machine 
)

Definition at line 173 of file isa_pseudo_gen.cxx.

References bzero(), cur_pseudo, pseudo_op::dir, pseudo_op::from_opc, MACHINE_TO_PSEUDO, num_pseudos, pseudos, and pseudo_op::to_opc.

Referenced by main().

Here is the call graph for this function:

void Map_Arg ( const char *  lvalue,
const char *  expr 
)

Definition at line 235 of file isa_pseudo_gen.cxx.

References cur_pseudo, exit(), EXPR_ARG_LVALUE, EXPR_ARG_RVALUE, fprintf(), idx, pseudo_op::map, MAX_MAP, max_map, pseudo_op::nmap, NULL, save_expr(), and pseudo_op::to_opc.

Referenced by main().

Here is the call graph for this function:

void order_pseudos ( int *  machine_to_pseudo_index,
int *  pseudo_to_machine_index 
)
void Pseudo_To_Machine ( TOP  machine,
TOP  pseudo 
)

Definition at line 189 of file isa_pseudo_gen.cxx.

References bzero(), cur_pseudo, pseudo_op::dir, pseudo_op::from_opc, num_pseudos, PSEUDO_TO_MACHINE, pseudos, and pseudo_op::to_opc.

Referenced by main().

Here is the call graph for this function:

void Require ( const char *  bool_expr)
static int save_expr ( const char *  s,
EXPR_KIND  kind 
) [static]

Definition at line 147 of file isa_pseudo_gen.cxx.

References exprs, expr::kind, kind, last_expr, expr::next, NULL, expr::s, and strcpy.

Referenced by Map_Arg(), and Require().

static void verify_machine_to_pseudo ( PSEUDO_OP_INFO **  vec,
int  i 
) [static]

Definition at line 289 of file isa_pseudo_gen.cxx.

References exit(), fprintf(), pseudo_op::from_opc, pseudo_op::nrequire, and num_pseudos.

Referenced by order_pseudos().

Here is the call graph for this function:


Variable Documentation

Definition at line 84 of file isa_pseudo_gen.cxx.

Referenced by Machine_To_Pseudo(), Map_Arg(), Pseudo_To_Machine(), and Require().

EXPR exprs [static]

Definition at line 100 of file isa_pseudo_gen.cxx.

Referenced by ISA_Pseudo_End(), and save_expr().

const char* const interface[] [static]

Definition at line 103 of file isa_pseudo_gen.cxx.

Referenced by ISA_Pseudo_End().

EXPR* last_expr = &exprs [static]

Definition at line 101 of file isa_pseudo_gen.cxx.

Referenced by save_expr().

int max_map [static]

Definition at line 86 of file isa_pseudo_gen.cxx.

Referenced by ISA_Pseudo_End(), and Map_Arg().

int max_require [static]

Definition at line 85 of file isa_pseudo_gen.cxx.

Referenced by ISA_Pseudo_End(), and Require().

list<PSEUDO_OP_INFO *> pseudos [static]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines