Commit d0ffc434 authored by Julian Kranz's avatar Julian Kranz

Gdrr

- Continued to implement gdrr
parent 6a2f4e24
......@@ -12,25 +12,24 @@
typedef void gdrr_sem_stmt_t;
typedef void gdrr_sem_stmts_t;
typedef void gdrr_sem_linear_t;
typedef void gdrr_sem_var_t;
typedef void gdrr_sem_op_t;
typedef void gdrr_sem_address_t;
typedef void gdrr_branch_hint;
typedef void gdrr_sem_id;
struct gddr_sem_stmts_callbacks {
struct gdrr_sem_stmts_callbacks {
gdrr_sem_stmts_t *(*sem_cons)(gdrr_sem_stmt_t *hd, gdrr_sem_stmts_t *tl);
gdrr_sem_stmts_t *(*sem_nil)(void);
};
struct gddr_sem_stmts_list_callbacks {
gdrr_sem_stmts_t *(*list_init)(void);
struct gdrr_sem_stmts_list_callbacks {
gdrr_sem_stmts_t *(*list_next)(gdrr_sem_stmt_t *next, gdrr_sem_stmts_t *list);
gdrr_sem_stmts_t *(*list_init)(void);
};
struct gddr_sem_stmt_callbacks {
struct gdrr_sem_stmt_callbacks {
gdrr_sem_stmt_t *(*sem_assign)(gdrr_sem_var_t *lhs, gdrr_sem_op_t *rhs);
gdrr_sem_stmt_t *(*sem_load)(gdrr_sem_var_t *lhs, __word size,
gdrr_sem_address_t *address);
......@@ -44,7 +43,7 @@ struct gddr_sem_stmt_callbacks {
gdrr_sem_address_t *target);
};
struct gddr_sem_op_callbacks {
struct gdrr_sem_op_callbacks {
gdrr_sem_op_t *(*sem_lin)(__word size, gdrr_sem_linear_t *opnd1);
gdrr_sem_op_t *(*sem_mul)(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2);
......@@ -85,17 +84,22 @@ struct gddr_sem_op_callbacks {
gdrr_sem_op_t *(*sem_arb)(__word size);
};
struct gddr_callbacks {
struct gdrr_sem_var_callbacks {
gdrr_sem_var_t *(*sem_var)(gdrr_sem_id *id, __word offset);
};
struct gdrr_callbacks {
union {
struct gddr_sem_stmts_callbacks sem_stmts;
struct gddr_sem_stmts_list_callbacks sem_stmts_list;
struct gdrr_sem_stmts_callbacks sem_stmts;
struct gdrr_sem_stmts_list_callbacks sem_stmts_list;
};
struct gddr_sem_stmt_callbacks sem_stmt;
struct gddr_sem_op_callbacks sem_op;
struct gdrr_sem_stmt_callbacks sem_stmt;
struct gdrr_sem_op_callbacks sem_op;
struct gdrr_sem_var_callbacks sem_var;
};
gdrr_sem_stmt_t *gdrr_convert(__obj semantics, struct gddr_callbacks *callbacks);
gdrr_sem_stmt_t *gdrr_convert(__obj semantics, struct gdrr_callbacks *callbacks);
gdrr_sem_stmt_t *gdrr_convert_list(__obj semantics,
struct gddr_callbacks *callbacks);
struct gdrr_callbacks *callbacks);
#endif /* GDRR_H_ */
......@@ -12,84 +12,93 @@
#include "gdrr.h"
static gdrr_sem_op_t *gdrr_convert_sem_op(__obj sem_op_obj,
struct gddr_callbacks *callbacks) {
struct gdrr_callbacks *callbacks) {
gdrr_sem_op_t *sem_op = NULL;
__obj rec = __DECON(sem_op_obj);
__obj size = __RECORD_SELECT(rec, ___size);
__word size_word = __CASETAGINT(size);
switch(__CASETAGCON(sem_op_obj)) {
case __SEM_LIN: {
sem_op = callbacks->sem_op.sem_lin(0, NULL);
sem_op = callbacks->sem_op.sem_lin(size_word, NULL);
break;
}
case __SEM_MUL: {
sem_op = callbacks->sem_op.sem_mul(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_mul(size_word, NULL, NULL);
break;
}
case __SEM_DIV: {
sem_op = callbacks->sem_op.sem_div(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_div(size_word, NULL, NULL);
break;
}
case __SEM_DIVS: {
sem_op = callbacks->sem_op.sem_divs(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_divs(size_word, NULL, NULL);
break;
}
case __SEM_MOD: {
sem_op = callbacks->sem_op.sem_mod(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_mod(size_word, NULL, NULL);
break;
}
case __SEM_SHL: {
sem_op = callbacks->sem_op.sem_shl(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_shl(size_word, NULL, NULL);
break;
}
case __SEM_SHR: {
sem_op = callbacks->sem_op.sem_shr(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_shr(size_word, NULL, NULL);
break;
}
case __SEM_SHRS: {
sem_op = callbacks->sem_op.sem_shrs(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_shrs(size_word, NULL, NULL);
break;
}
case __SEM_AND: {
sem_op = callbacks->sem_op.sem_and(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_and(size_word, NULL, NULL);
break;
}
case __SEM_OR: {
sem_op = callbacks->sem_op.sem_or(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_or(size_word, NULL, NULL);
break;
}
case __SEM_XOR: {
sem_op = callbacks->sem_op.sem_xor(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_xor(size_word, NULL, NULL);
break;
}
case __SEM_SX: {
sem_op = callbacks->sem_op.sem_sx(0, 0, NULL);
__obj fromsize = __RECORD_SELECT(rec, ___fromsize);
sem_op = callbacks->sem_op.sem_sx(size_word, __CASETAGINT(fromsize),
NULL);
break;
}
case __SEM_ZX: {
sem_op = callbacks->sem_op.sem_zx(0, 0, NULL);
__obj fromsize = __RECORD_SELECT(rec, ___fromsize);
sem_op = callbacks->sem_op.sem_zx(size_word, __CASETAGINT(fromsize),
NULL);
break;
}
case __SEM_CMPEQ: {
sem_op = callbacks->sem_op.sem_cmpeq(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_cmpeq(size_word, NULL, NULL);
break;
}
case __SEM_CMPNEQ: {
sem_op = callbacks->sem_op.sem_cmpneq(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_cmpneq(size_word, NULL, NULL);
break;
}
case __SEM_CMPLES: {
sem_op = callbacks->sem_op.sem_cmples(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_cmples(size_word, NULL, NULL);
break;
}
case __SEM_CMPLEU: {
sem_op = callbacks->sem_op.sem_cmpleu(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_cmpleu(size_word, NULL, NULL);
break;
}
case __SEM_CMPLTS: {
sem_op = callbacks->sem_op.sem_cmplts(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_cmplts(size_word, NULL, NULL);
break;
}
case __SEM_CMPLTU: {
sem_op = callbacks->sem_op.sem_cmpltu(0, NULL, NULL);
sem_op = callbacks->sem_op.sem_cmpltu(size_word, NULL, NULL);
break;
}
case __SEM_ARB: {
......@@ -101,8 +110,18 @@ static gdrr_sem_op_t *gdrr_convert_sem_op(__obj sem_op_obj,
return sem_op;
}
static gdrr_sem_var_t *gdrr_convert_sem_var(__obj sem_var_obj,
struct gdrr_callbacks *callbacks) {
__obj rec = __DECON(sem_var_obj);
__obj id = __RECORD_SELECT(rec, ___id);
__obj offset = __RECORD_SELECT(rec, ___offset);
return callbacks->sem_var.sem_var(NULL, __CASETAGINT(offset));
}
static gdrr_sem_stmt_t *gdrr_convert_sem_stmt(__obj sem_stmt_obj,
struct gddr_callbacks *callbacks) {
struct gdrr_callbacks *callbacks) {
gdrr_sem_stmt_t *sem_stmt = NULL;
__obj rec = __DECON(sem_stmt_obj);
......@@ -110,7 +129,8 @@ static gdrr_sem_stmt_t *gdrr_convert_sem_stmt(__obj sem_stmt_obj,
case __SEM_ASSIGN: {
__obj lhs = __RECORD_SELECT(rec, ___lhs);
__obj rhs = __RECORD_SELECT(rec, ___rhs);
sem_stmt = callbacks->sem_stmt.sem_assign(NULL,
sem_stmt = callbacks->sem_stmt.sem_assign(
gdrr_convert_sem_var(lhs, callbacks),
gdrr_convert_sem_op(rhs, callbacks));
break;
}
......@@ -118,7 +138,8 @@ static gdrr_sem_stmt_t *gdrr_convert_sem_stmt(__obj sem_stmt_obj,
__obj lhs = __RECORD_SELECT(rec, ___lhs);
__obj size = __RECORD_SELECT(rec, ___size);
__obj address = __RECORD_SELECT(rec, ___address);
sem_stmt = callbacks->sem_stmt.sem_load(NULL, 0, NULL);
sem_stmt = callbacks->sem_stmt.sem_load(
gdrr_convert_sem_var(lhs, callbacks), __CASETAGINT(size), NULL);
break;
}
case __SEM_STORE: {
......@@ -129,28 +150,28 @@ static gdrr_sem_stmt_t *gdrr_convert_sem_stmt(__obj sem_stmt_obj,
break;
}
case __SEM_ITE: {
__obj cond = __RECORD_SELECT(rec, ___cond);
__obj then_branch = __RECORD_SELECT(rec, ___then_branch);
__obj else_branch = __RECORD_SELECT(rec, ___else_branch);
__obj cond = __RECORD_SELECT(rec, ___cond);
__obj then_branch = __RECORD_SELECT(rec, ___then_branch);
__obj else_branch = __RECORD_SELECT(rec, ___else_branch);
sem_stmt = callbacks->sem_stmt.sem_ite(NULL, NULL, NULL);
break;
}
case __SEM_WHILE: {
__obj cond = __RECORD_SELECT(rec, ___cond);
__obj body = __RECORD_SELECT(rec, ___body);
__obj cond = __RECORD_SELECT(rec, ___cond);
__obj body = __RECORD_SELECT(rec, ___body);
sem_stmt = callbacks->sem_stmt.sem_while(NULL, NULL);
break;
}
case __SEM_CBRANCH: {
__obj cond = __RECORD_SELECT(rec, ___cond);
__obj target_true = __RECORD_SELECT(rec, ___target_true);
__obj target_false = __RECORD_SELECT(rec, ___target_false);
__obj cond = __RECORD_SELECT(rec, ___cond);
__obj target_true = __RECORD_SELECT(rec, ___target_true);
__obj target_false = __RECORD_SELECT(rec, ___target_false);
sem_stmt = callbacks->sem_stmt.sem_cbranch(NULL, NULL, NULL);
break;
}
case __SEM_BRANCH: {
__obj hint = __RECORD_SELECT(rec, ___hint);
__obj target = __RECORD_SELECT(rec, ___target);
__obj hint = __RECORD_SELECT(rec, ___hint);
__obj target = __RECORD_SELECT(rec, ___target);
sem_stmt = callbacks->sem_stmt.sem_branch(NULL, NULL);
break;
}
......@@ -160,7 +181,7 @@ static gdrr_sem_stmt_t *gdrr_convert_sem_stmt(__obj sem_stmt_obj,
}
static gdrr_sem_stmts_t *gdrr_convert_sem_stmts(__obj sem_stmts_obj,
struct gddr_callbacks *callbacks) {
struct gdrr_callbacks *callbacks) {
gdrr_sem_stmts_t *sem_stmts = NULL;
if(__CASETAGCON(sem_stmts_obj) == __SEM_CONS) {
......@@ -179,7 +200,7 @@ static gdrr_sem_stmts_t *gdrr_convert_sem_stmts(__obj sem_stmts_obj,
}
static gdrr_sem_stmts_t *gdrr_convert_sem_stmts_list(__obj sem_stmts_obj,
struct gddr_callbacks *callbacks) {
struct gdrr_callbacks *callbacks) {
gdrr_sem_stmts_t *list = callbacks->sem_stmts_list.list_init();
while(__CASETAGCON(sem_stmts_obj) == __SEM_CONS) {
......@@ -196,11 +217,11 @@ static gdrr_sem_stmts_t *gdrr_convert_sem_stmts_list(__obj sem_stmts_obj,
return list;
}
gdrr_sem_stmt_t *gdrr_convert(__obj semantics, struct gddr_callbacks *callbacks) {
gdrr_sem_stmt_t *gdrr_convert(__obj semantics, struct gdrr_callbacks *callbacks) {
return gdrr_convert_sem_stmts(semantics, callbacks);
}
gdrr_sem_stmt_t *gdrr_convert_list(__obj semantics,
struct gddr_callbacks *callbacks) {
struct gdrr_callbacks *callbacks) {
return gdrr_convert_sem_stmts_list(semantics, callbacks);
}
......@@ -9,18 +9,18 @@ type sem_id =
| VIRT_LTU # <u
| VIRT_T of int
type sem_arity1 = {size: int, opnd1: sem_linear}
type sem_arity2 = {size: int, opnd1: sem_linear, opnd2: sem_linear}
type sem_cmp = {size: int, opnd1: sem_linear, opnd2: sem_linear}
type sem_arity1 = {size:int, opnd1:sem_linear}
type sem_arity2 = {size:int, opnd1:sem_linear, opnd2:sem_linear}
type sem_cmp = {size:int, opnd1:sem_linear, opnd2:sem_linear}
type sem_address = {size: int, address: sem_linear}
type sem_address = {size:int, address: sem_linear}
type sem_var = {id:sem_id, offset:int}
type sem_linear =
SEM_LIN_VAR of sem_var
| SEM_LIN_IMM of {imm:int}
| SEM_LIN_ADD of {opnd1: sem_linear, opnd2: sem_linear}
| SEM_LIN_SUB of {opnd1: sem_linear, opnd2: sem_linear}
| SEM_LIN_ADD of {opnd1:sem_linear, opnd2:sem_linear}
| SEM_LIN_SUB of {opnd1:sem_linear, opnd2:sem_linear}
| SEM_LIN_SCALE of {imm:int, opnd:sem_linear}
type sem_op =
......@@ -35,24 +35,24 @@ type sem_op =
| SEM_AND of sem_arity2
| SEM_OR of sem_arity2
| SEM_XOR of sem_arity2
| SEM_SX of {size: int, fromsize: int, opnd1: sem_linear}
| SEM_ZX of {size: int, fromsize: int, opnd1: sem_linear}
| SEM_SX of {size:int, fromsize:int, opnd1:sem_linear}
| SEM_ZX of {size:int, fromsize:int, opnd1:sem_linear}
| SEM_CMPEQ of sem_cmp
| SEM_CMPNEQ of sem_cmp
| SEM_CMPLES of sem_cmp
| SEM_CMPLEU of sem_cmp
| SEM_CMPLTS of sem_cmp
| SEM_CMPLTU of sem_cmp
| SEM_ARB of {size: int}
| SEM_ARB of {size:int}
type sem_stmt =
SEM_ASSIGN of {lhs: sem_var, rhs: sem_op}
| SEM_LOAD of {lhs: sem_var, size: int, address: sem_address}
| SEM_STORE of {address: sem_address, rhs: sem_op}
| SEM_ITE of {cond: sem_linear, then_branch: sem_stmts, else_branch: sem_stmts}
| SEM_WHILE of {cond: sem_linear, body: sem_stmts}
| SEM_CBRANCH of {cond: sem_linear, target-true: sem_address, target-false: sem_address}
| SEM_BRANCH of {hint: branch_hint, target: sem_address}
SEM_ASSIGN of {lhs:sem_var, rhs:sem_op}
| SEM_LOAD of {lhs:sem_var, size:int, address:sem_address}
| SEM_STORE of {address:sem_address, rhs:sem_op}
| SEM_ITE of {cond:sem_linear, then_branch:sem_stmts, else_branch:sem_stmts}
| SEM_WHILE of {cond:sem_linear, body:sem_stmts}
| SEM_CBRANCH of {cond:sem_linear, target-true:sem_address, target-false:sem_address}
| SEM_BRANCH of {hint:branch_hint, target:sem_address}
type branch_hint =
HINT_JUMP
......@@ -64,8 +64,8 @@ type sem_stmts =
| SEM_NIL
type sem_writeback =
SEM_WRITE_VAR of {size: int, id: sem_var}
| SEM_WRITE_MEM of {size: int, address: sem_linear, segment:seg_override}
SEM_WRITE_VAR of {size:int, id:sem_var}
| SEM_WRITE_MEM of {size:int, address:sem_linear, segment:seg_override}
val rreil-sizeOf op =
case op of
......
......@@ -6,170 +6,176 @@
#include <dis.h>
#include <gdrr.h>
gdrr_sem_stmts_t *list_next(gdrr_sem_stmt_t *next, gdrr_sem_stmts_t *list) {
static gdrr_sem_stmts_t *list_next(gdrr_sem_stmt_t *next, gdrr_sem_stmts_t *list) {
printf("next statement\n");
return NULL;
}
gdrr_sem_stmts_t *list_init() {
static gdrr_sem_stmts_t *list_init() {
printf("init\n");
return NULL;
}
gdrr_sem_stmt_t *sem_assign(gdrr_sem_var_t *lhs, gdrr_sem_op_t *rhs) {
static gdrr_sem_stmt_t *sem_assign(gdrr_sem_var_t *lhs, gdrr_sem_op_t *rhs) {
printf("assign\n");
return NULL;
}
gdrr_sem_stmt_t *sem_load(gdrr_sem_var_t *lhs, __word size, gdrr_sem_address_t *address) {
static gdrr_sem_stmt_t *sem_load(gdrr_sem_var_t *lhs, __word size, gdrr_sem_address_t *address) {
printf("load\n");
return NULL;
}
gdrr_sem_stmt_t *sem_store(gdrr_sem_var_t *lhs, gdrr_sem_op_t *rhs) {
static gdrr_sem_stmt_t *sem_store(gdrr_sem_var_t *lhs, gdrr_sem_op_t *rhs) {
printf("store\n");
return NULL;
}
gdrr_sem_stmt_t *sem_ite(gdrr_sem_linear_t *cond, gdrr_sem_stmts_t *then_branch, gdrr_sem_stmts_t *else_branch) {
static gdrr_sem_stmt_t *sem_ite(gdrr_sem_linear_t *cond, gdrr_sem_stmts_t *then_branch, gdrr_sem_stmts_t *else_branch) {
printf("ite\n");
return NULL;
}
gdrr_sem_stmt_t *sem_while(gdrr_sem_linear_t *cond, gdrr_sem_stmts_t *body) {
static gdrr_sem_stmt_t *sem_while(gdrr_sem_linear_t *cond, gdrr_sem_stmts_t *body) {
printf("while\n");
return NULL;
}
gdrr_sem_stmt_t *sem_cbranch(gdrr_sem_linear_t *cond,
static gdrr_sem_stmt_t *sem_cbranch(gdrr_sem_linear_t *cond,
gdrr_sem_address_t *target_true, gdrr_sem_address_t *target_false) {
printf("cbranch\n");
return NULL;
}
gdrr_sem_stmt_t *sem_branch(gdrr_branch_hint *branch_hint,
static gdrr_sem_stmt_t *sem_branch(gdrr_branch_hint *branch_hint,
gdrr_sem_address_t *target) {
printf("branch\n");
return NULL;
}
gdrr_sem_op_t *sem_lin(__word size, gdrr_sem_linear_t *opnd1) {
printf("=> lin\n");
static gdrr_sem_op_t *sem_lin(__word size, gdrr_sem_linear_t *opnd1) {
printf("=> lin {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_mul(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_mul(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> mul\n");
printf("=> mul {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_div(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_div(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> div\n");
printf("=> div {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_divs(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_divs(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> divs\n");
printf("=> divs {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_mod(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_mod(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> mod\n");
printf("=> mod {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_shl(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_shl(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> shl\n");
printf("=> shl {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_shr(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_shr(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> shr\n");
printf("=> shr {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_shrs(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_shrs(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> shrs\n");
printf("=> shrs {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_and(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_and(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> and\n");
printf("=> and {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_or(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_or(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> or\n");
printf("=> or {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_xor(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_xor(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> xor\n");
printf("=> xor {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_sx(__word size, __word fromsize,
static gdrr_sem_op_t *sem_sx(__word size, __word fromsize,
gdrr_sem_linear_t *opnd1) {
printf("=> sx\n");
printf("=> sx {size=%lu, fromsize=%lu}\n", size, fromsize);
return NULL;
}
gdrr_sem_op_t *sem_zx(__word size, __word fromsize,
static gdrr_sem_op_t *sem_zx(__word size, __word fromsize,
gdrr_sem_linear_t *opnd1) {
printf("=> zx\n");
printf("=> zx {size=%lu, fromsize=%lu}\n", size, fromsize);
return NULL;
}
gdrr_sem_op_t *sem_cmpeq(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_cmpeq(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> cmpeq\n");
printf("=> cmpeq {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_cmpneq(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_cmpneq(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> cmpneq\n");
printf("=> cmpneq {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_cmples(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_cmples(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> cmples\n");
printf("=> cmples {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_cmpleu(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_cmpleu(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> cmpleu\n");
printf("=> cmpleu {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_cmplts(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_cmplts(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> cmplts\n");
printf("=> cmplts {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_cmpltu(__word size, gdrr_sem_linear_t *opnd1,
static gdrr_sem_op_t *sem_cmpltu(__word size, gdrr_sem_linear_t *opnd1,
gdrr_sem_linear_t *opnd2) {
printf("=> cmpltu\n");
printf("=> cmpltu {size=%lu}\n", size);
return NULL;
}
gdrr_sem_op_t *sem_arb(__word size) {
printf("=> arb\n");
static gdrr_sem_op_t *sem_arb(__word size) {
printf("=> arb {size=%lu}\n", size);
return NULL;
}
static gdrr_sem_var_t *sem_var(gdrr_sem_id *id, __word offset) {
printf("=> var {offset=%lu}\n", offset);
return NULL;
}
......@@ -207,7 +213,7 @@ done:
__pretty(__rreil_pretty__,r,fmt,1024);
puts(fmt);
struct gddr_callbacks callbacks;
struct gdrr_callbacks callbacks;
callbacks.sem_stmts_list.list_init = &list_init;
callbacks.sem_stmts_list.list_next = &list_next;
......@@ -234,12 +240,15 @@ done:
callbacks.sem_op.sem_zx = &sem_zx;
callbacks.sem_op.sem_cmpeq = &sem_cmpeq;
callbacks.sem_op.sem_cmpneq = &sem_cmpneq;
callbacks.sem_op.sem_cmples = &sem_cmpleu;
callbacks.sem_op.sem_cmples = &sem_cmples;
callbacks.sem_op.sem_cmpleu = &sem_cmpleu;
callbacks.sem_op.sem_cmplts = &sem_cmplts;
callbacks.sem_op.sem_cmpltu = &sem_cmpltu;
callbacks.sem_op.sem_arb = &sem_arb;
gdrr_convert(r, &callbacks);
callbacks.sem_var.sem_var = &sem_var;
gdrr_convert_list(r, &callbacks);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment