Rizin
unix-like reverse engineering framework and cli tools
libps_internal.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2017 deroad <wargio@libero.it>
2
// SPDX-License-Identifier: LGPL-3.0-only
3
4
#ifndef LIBPS_INTERNAL_H
5
#define LIBPS_INTERNAL_H
6
#include <
rz_types.h
>
7
8
#define TYPE_NONE 0
9
#define TYPE_REG 1
10
#define TYPE_IMM 2
11
#define TYPE_MEM 3
12
#define TYPE_CR 4
13
14
#define OP(x) ((((ut32)(x)) & 0x3f) << 26)
15
#define OP_MASK OP(0x3f)
16
17
#define OPS(op, xop) (OP(op) | ((((ut32)(xop)) & 0x1f) << 1))
18
#define OPSC(op, xop, rc) (OPS((op), (xop)) | ((rc)&1))
19
#define OPS_MASK OPSC(0x3f, 0x1f, 1)
20
#define OPS_MASK_DOT OPSC(0x3f, 0x1f, 1)
21
22
#define OPM(op, xop) (OP(op) | ((((ut32)(xop)) & 0x3f) << 1))
23
#define OPMC(op, xop, rc) (OPM((op), (xop)) | ((rc)&1))
24
#define OPM_MASK OPMC(0x3f, 0x3f, 0)
25
26
#define OPL(op, xop) (OP(op) | ((((ut32)(xop)) & 0x3ff) << 1))
27
#define OPLC(op, xop, rc) (OPL((op), (xop)) | ((rc)&1))
28
#define OPL_MASK OPLC(0x3f, 0x3ff, 1)
29
#define OPL_MASK_DOT OPLC(0x3f, 0x3ff, 1)
30
31
typedef
enum
{
32
NO_OPERAND
,
33
OP_FA
,
34
OP_FB
,
35
OP_FC
,
36
OP_FD
,
37
OP_FS
=
OP_FD
,
38
OP_crfD
,
39
OP_WB
,
40
OP_IB
,
41
OP_WC
,
42
OP_IC
,
43
OP_RA
,
44
OP_RB
,
45
OP_DRA
,
46
OP_DRB
,
47
}
ps_operand_id_t
;
48
49
typedef
enum
{
50
psq_lx
,
51
psq_stx
,
52
psq_lux
,
53
psq_stux
,
54
psq_l
,
55
psq_lu
,
56
psq_st
,
57
psq_stu
,
58
59
ps_div
,
60
ps_div_dot
,
61
ps_sub
,
62
ps_sub_dot
,
63
ps_add
,
64
ps_add_dot
,
65
ps_sel
,
66
ps_sel_dot
,
67
ps_res
,
68
ps_res_dot
,
69
ps_mul
,
70
ps_mul_dot
,
71
ps_rsqrte
,
72
ps_rsqrte_dot
,
73
ps_msub
,
74
ps_msub_dot
,
75
ps_madd
,
76
ps_madd_dot
,
77
ps_nmsub
,
78
ps_nmsub_dot
,
79
ps_nmadd
,
80
ps_nmadd_dot
,
81
ps_neg
,
82
ps_neg_dot
,
83
ps_mr
,
84
ps_mr_dot
,
85
ps_nabs
,
86
ps_nabs_dot
,
87
ps_abs
,
88
ps_abs_dot
,
89
90
ps_sum0
,
91
ps_sum0_dot
,
92
ps_sum1
,
93
ps_sum1_dot
,
94
ps_muls0
,
95
ps_muls0_dot
,
96
ps_muls1
,
97
ps_muls1_dot
,
98
ps_madds0
,
99
ps_madds0_dot
,
100
ps_madds1
,
101
ps_madds1_dot
,
102
ps_cmpu0
,
103
ps_cmpo0
,
104
ps_cmpu1
,
105
ps_cmpo1
,
106
ps_merge00
,
107
ps_merge00_dot
,
108
ps_merge01
,
109
ps_merge01_dot
,
110
ps_merge10
,
111
ps_merge10_dot
,
112
ps_merge11
,
113
ps_merge11_dot
,
114
ps_dcbz_l
,
115
}
ps_insn_type_t
;
116
117
typedef
struct
{
118
ps_insn_type_t
insn
;
119
const
char
*
name
;
120
unsigned
int
opcode
;
121
unsigned
int
mask
;
122
unsigned
char
operands
[6];
123
const
char
*
description
;
124
}
ps_opcode_t
;
125
126
typedef
struct
{
127
int
bits
;
128
int
shift
;
129
}
ps_operand_t
;
130
131
#endif
/* LIBPS_INTERNAL_H */
ps_insn_type_t
ps_insn_type_t
Definition:
libps_internal.h:49
ps_nmsub
@ ps_nmsub
Definition:
libps_internal.h:77
ps_nmadd_dot
@ ps_nmadd_dot
Definition:
libps_internal.h:80
ps_sum1_dot
@ ps_sum1_dot
Definition:
libps_internal.h:93
ps_rsqrte
@ ps_rsqrte
Definition:
libps_internal.h:71
ps_madds1
@ ps_madds1
Definition:
libps_internal.h:100
ps_sum1
@ ps_sum1
Definition:
libps_internal.h:92
ps_nmsub_dot
@ ps_nmsub_dot
Definition:
libps_internal.h:78
ps_madd
@ ps_madd
Definition:
libps_internal.h:75
ps_rsqrte_dot
@ ps_rsqrte_dot
Definition:
libps_internal.h:72
ps_res_dot
@ ps_res_dot
Definition:
libps_internal.h:68
ps_mul
@ ps_mul
Definition:
libps_internal.h:69
ps_div
@ ps_div
Definition:
libps_internal.h:59
ps_madds1_dot
@ ps_madds1_dot
Definition:
libps_internal.h:101
ps_merge10_dot
@ ps_merge10_dot
Definition:
libps_internal.h:111
ps_merge11
@ ps_merge11
Definition:
libps_internal.h:112
psq_st
@ psq_st
Definition:
libps_internal.h:56
psq_stx
@ psq_stx
Definition:
libps_internal.h:51
ps_nabs_dot
@ ps_nabs_dot
Definition:
libps_internal.h:86
ps_neg_dot
@ ps_neg_dot
Definition:
libps_internal.h:82
ps_mr
@ ps_mr
Definition:
libps_internal.h:83
psq_lu
@ psq_lu
Definition:
libps_internal.h:55
ps_madds0_dot
@ ps_madds0_dot
Definition:
libps_internal.h:99
ps_abs
@ ps_abs
Definition:
libps_internal.h:87
ps_merge01_dot
@ ps_merge01_dot
Definition:
libps_internal.h:109
ps_add
@ ps_add
Definition:
libps_internal.h:63
ps_cmpo0
@ ps_cmpo0
Definition:
libps_internal.h:103
ps_neg
@ ps_neg
Definition:
libps_internal.h:81
ps_muls0
@ ps_muls0
Definition:
libps_internal.h:94
ps_div_dot
@ ps_div_dot
Definition:
libps_internal.h:60
ps_sub
@ ps_sub
Definition:
libps_internal.h:61
ps_dcbz_l
@ ps_dcbz_l
Definition:
libps_internal.h:114
psq_stux
@ psq_stux
Definition:
libps_internal.h:53
ps_res
@ ps_res
Definition:
libps_internal.h:67
ps_cmpu1
@ ps_cmpu1
Definition:
libps_internal.h:104
ps_merge00
@ ps_merge00
Definition:
libps_internal.h:106
ps_sum0_dot
@ ps_sum0_dot
Definition:
libps_internal.h:91
ps_muls1_dot
@ ps_muls1_dot
Definition:
libps_internal.h:97
ps_nmadd
@ ps_nmadd
Definition:
libps_internal.h:79
ps_sel_dot
@ ps_sel_dot
Definition:
libps_internal.h:66
ps_merge10
@ ps_merge10
Definition:
libps_internal.h:110
ps_merge11_dot
@ ps_merge11_dot
Definition:
libps_internal.h:113
ps_madd_dot
@ ps_madd_dot
Definition:
libps_internal.h:76
ps_add_dot
@ ps_add_dot
Definition:
libps_internal.h:64
ps_abs_dot
@ ps_abs_dot
Definition:
libps_internal.h:88
ps_sel
@ ps_sel
Definition:
libps_internal.h:65
ps_muls0_dot
@ ps_muls0_dot
Definition:
libps_internal.h:95
psq_lx
@ psq_lx
Definition:
libps_internal.h:50
psq_lux
@ psq_lux
Definition:
libps_internal.h:52
ps_madds0
@ ps_madds0
Definition:
libps_internal.h:98
psq_stu
@ psq_stu
Definition:
libps_internal.h:57
ps_msub
@ ps_msub
Definition:
libps_internal.h:73
ps_merge00_dot
@ ps_merge00_dot
Definition:
libps_internal.h:107
ps_sum0
@ ps_sum0
Definition:
libps_internal.h:90
ps_msub_dot
@ ps_msub_dot
Definition:
libps_internal.h:74
ps_sub_dot
@ ps_sub_dot
Definition:
libps_internal.h:62
ps_muls1
@ ps_muls1
Definition:
libps_internal.h:96
ps_cmpo1
@ ps_cmpo1
Definition:
libps_internal.h:105
ps_mul_dot
@ ps_mul_dot
Definition:
libps_internal.h:70
ps_cmpu0
@ ps_cmpu0
Definition:
libps_internal.h:102
ps_mr_dot
@ ps_mr_dot
Definition:
libps_internal.h:84
ps_merge01
@ ps_merge01
Definition:
libps_internal.h:108
psq_l
@ psq_l
Definition:
libps_internal.h:54
ps_nabs
@ ps_nabs
Definition:
libps_internal.h:85
ps_operand_id_t
ps_operand_id_t
Definition:
libps_internal.h:31
OP_DRB
@ OP_DRB
Definition:
libps_internal.h:46
OP_FC
@ OP_FC
Definition:
libps_internal.h:35
NO_OPERAND
@ NO_OPERAND
Definition:
libps_internal.h:32
OP_RB
@ OP_RB
Definition:
libps_internal.h:44
OP_WB
@ OP_WB
Definition:
libps_internal.h:39
OP_RA
@ OP_RA
Definition:
libps_internal.h:43
OP_IB
@ OP_IB
Definition:
libps_internal.h:40
OP_FD
@ OP_FD
Definition:
libps_internal.h:36
OP_FB
@ OP_FB
Definition:
libps_internal.h:34
OP_FA
@ OP_FA
Definition:
libps_internal.h:33
OP_DRA
@ OP_DRA
Definition:
libps_internal.h:45
OP_WC
@ OP_WC
Definition:
libps_internal.h:41
OP_IC
@ OP_IC
Definition:
libps_internal.h:42
OP_crfD
@ OP_crfD
Definition:
libps_internal.h:38
OP_FS
@ OP_FS
Definition:
libps_internal.h:37
rz_types.h
operands
Definition:
analysis_or1k.c:9
ps_opcode_t
Definition:
libps_internal.h:117
ps_opcode_t::mask
unsigned int mask
Definition:
libps_internal.h:121
ps_opcode_t::name
const char * name
Definition:
libps_internal.h:119
ps_opcode_t::description
const char * description
Definition:
libps_internal.h:123
ps_opcode_t::opcode
unsigned int opcode
Definition:
libps_internal.h:120
ps_opcode_t::insn
ps_insn_type_t insn
Definition:
libps_internal.h:118
ps_operand_t
Definition:
libps_internal.h:126
ps_operand_t::bits
int bits
Definition:
libps_internal.h:127
ps_operand_t::shift
int shift
Definition:
libps_internal.h:128
librz
asm
arch
ppc
libps
libps_internal.h
Generated by
1.9.1