Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
20b7938b
Commit
20b7938b
authored
7 years ago
by
an7s
Browse files
Options
Downloads
Patches
Plain Diff
Add Zmm to Capstone operand class
Former-commit-id: c306dd10714825c1a8a1c9d95f1756005f580dd4
parent
b6d210d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libIRDB/include/core/operand_cs.hpp
+1
-0
1 addition, 0 deletions
libIRDB/include/core/operand_cs.hpp
libIRDB/src/core/operand_cs.cpp
+18
-0
18 additions, 0 deletions
libIRDB/src/core/operand_cs.cpp
libIRDB/src/util/params.cpp
+1
-1
1 addition, 1 deletion
libIRDB/src/util/params.cpp
with
20 additions
and
1 deletion
libIRDB/include/core/operand_cs.hpp
+
1
−
0
View file @
20b7938b
...
...
@@ -26,6 +26,7 @@ class DecodedOperandCapstone_t
bool
isFpuRegister
()
const
;
bool
isSseRegister
()
const
;
bool
isAvxRegister
()
const
;
bool
isZmmRegister
()
const
;
bool
isSpecialRegister
()
const
;
bool
isSegmentRegister
()
const
;
uint32_t
getRegNumber
()
const
;
...
...
This diff is collapsed.
Click to expand it.
libIRDB/src/core/operand_cs.cpp
+
18
−
0
View file @
20b7938b
...
...
@@ -312,6 +312,22 @@ bool DecodedOperandCapstone_t::isAvxRegister() const
return
isRegister
()
&&
regs
.
find
(
op
.
reg
)
!=
end
(
regs
);
}
bool
DecodedOperandCapstone_t
::
isZmmRegister
()
const
{
const
auto
regs
=
set
<
x86_reg
>
({
X86_REG_ZMM0
,
X86_REG_ZMM1
,
X86_REG_ZMM2
,
X86_REG_ZMM3
,
X86_REG_ZMM4
,
X86_REG_ZMM5
,
X86_REG_ZMM6
,
X86_REG_ZMM7
,
X86_REG_ZMM8
,
X86_REG_ZMM9
,
X86_REG_ZMM10
,
X86_REG_ZMM11
,
X86_REG_ZMM12
,
X86_REG_ZMM13
,
X86_REG_ZMM14
,
X86_REG_ZMM15
,
X86_REG_ZMM16
,
X86_REG_ZMM17
,
X86_REG_ZMM18
,
X86_REG_ZMM19
,
X86_REG_ZMM20
,
X86_REG_ZMM21
,
X86_REG_ZMM22
,
X86_REG_ZMM23
,
X86_REG_ZMM24
,
X86_REG_ZMM25
,
X86_REG_ZMM26
,
X86_REG_ZMM27
,
X86_REG_ZMM28
,
X86_REG_ZMM29
,
X86_REG_ZMM30
,
X86_REG_ZMM31
,
});
const
auto
the_insn
=
static_cast
<
cs_insn
*>
(
my_insn
.
get
());
const
auto
&
op
=
(
the_insn
->
detail
->
x86
.
operands
[
op_num
]);
return
isRegister
()
&&
regs
.
find
(
op
.
reg
)
!=
end
(
regs
);
}
bool
DecodedOperandCapstone_t
::
isSpecialRegister
()
const
{
const
auto
regs
=
set
<
x86_reg
>
({
...
...
@@ -357,6 +373,8 @@ uint32_t DecodedOperandCapstone_t::getRegNumber() const
return
op
.
reg
-
X86_REG_XMM0
;
else
if
(
isAvxRegister
())
return
op
.
reg
-
X86_REG_YMM0
;
else
if
(
isZmmRegister
())
return
op
.
reg
-
X86_REG_ZMM0
;
else
if
(
isSegmentRegister
())
return
to_seg_reg_number
(
op
.
reg
);
else
...
...
This diff is collapsed.
Click to expand it.
libIRDB/src/util/params.cpp
+
1
−
1
View file @
20b7938b
...
...
@@ -44,7 +44,7 @@ bool libIRDB::IsParameterWrite(const FileIR_t *firp, Instruction_t* insn, string
{
// if it's a register
// if((d.Argument1.ArgType®ISTER_TYPE)==REGISTER_TYPE)
if
(
d
.
getOperand
(
0
).
isRegister
())
if
(
d
.
getOperand
(
0
).
is
GeneralPurpose
Register
())
{
// int regno=(d.Argument1.ArgType)&0xFFFF;
int
regno
=
d
.
getOperand
(
0
).
getRegNumber
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment