-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathutils.h
More file actions
32 lines (26 loc) · 706 Bytes
/
utils.h
File metadata and controls
32 lines (26 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef _UTILS_H
#define _UTILS_H
#include <stdio.h>
#include <stdint.h>
#include "env.h"
#include "aluop.h"
#include "cond.h"
#include "branch.h"
static inline void print_preamble(struct CPUState *env, uint32_t inst)
{
printf("%4x:\t%08x \t", env->pc, inst);
}
static inline void print_inst(const char *name, uint32_t inst)
{
printf("%s%s%s", name, sflag(inst) ? "s" : "", cond_name(inst));
}
static inline void print_inst_without_s(const char *name, uint32_t inst)
{
printf("%s%s", name, cond_name(inst));
}
static inline void print_inst_ldst(const char *name, uint32_t inst)
{
uint32_t B = getbit(inst, BIT22);
printf("%s%s%s", name, (B ? "b" : ""), cond_name(inst));
}
#endif