Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SMPStaticAnalyzer
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
SMPStaticAnalyzer
Compare revisions
9ae06334b00d435f1dbd46a55a877b9045cc15bd to ef3553a330dc0c98dd3aa8ddba7b2928686292a8
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
opensrc/SMPStaticAnalyzer
Select target project
No results found
ef3553a330dc0c98dd3aa8ddba7b2928686292a8
Select Git revision
Swap
Target
opensrc/SMPStaticAnalyzer
Select target project
opensrc/SMPStaticAnalyzer
1 result
9ae06334b00d435f1dbd46a55a877b9045cc15bd
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/interfaces/irdb/STARS_IRDB_Op.cpp
+45
-8
45 additions, 8 deletions
src/interfaces/irdb/STARS_IRDB_Op.cpp
with
45 additions
and
8 deletions
src/interfaces/irdb/STARS_IRDB_Op.cpp
View file @
ef3553a3
...
...
@@ -4,6 +4,7 @@
#include
"interfaces/SMPDBInterface.h"
#include
"interfaces/irdb/STARSProgram.h"
#include
"interfaces/irdb/STARSInstruction.h"
#include
"interfaces/abstract/STARSInterface.h"
#include
<libIRDB-core.hpp>
#include
<iostream>
...
...
@@ -99,8 +100,12 @@ STARS_IRDB_op_t::STARS_IRDB_op_t(const DecodedInstruction_t &d, int indx, const
{
const
auto
bea_regno
=
the_arg
.
getRegNumber
();
// log2int_or_err(the_arg.ArgType&0xFFFF);
byteWidth
=
8
;
OpType
=
op_MMXReg
;
assert
(
bea_regno
!=
(
decltype
(
bea_regno
))
-
1
);
#if 1 // Use specialized register types.
OpType
=
op_MMXReg
;
#else // Using op_Reg for all regs, distinguishing them by the regno only.
OpType
=
op_Reg
;
#endif
assert
(
bea_regno
!=
(
decltype
(
bea_regno
))
-
1
);
operand
.
reg
.
RegNum
=
(
STARS_RegNo
)(
STARS_x86_R_mm0
+
bea_regno
);
}
// case REGISTER_TYPE + FPU_REG :
...
...
@@ -108,8 +113,12 @@ STARS_IRDB_op_t::STARS_IRDB_op_t(const DecodedInstruction_t &d, int indx, const
{
const
auto
bea_regno
=
the_arg
.
getRegNumber
();
// log2int_or_err(the_arg.ArgType&0xFFFF);
byteWidth
=
8
;
OpType
=
op_MMXReg
;
assert
(
bea_regno
!=
(
decltype
(
bea_regno
))
-
1
);
#if 1 // Use specialized register types.
OpType
=
op_FPReg
;
#else // Using op_Reg for all regs, distinguishing them by the regno only.
OpType
=
op_Reg
;
#endif
assert
(
bea_regno
!=
(
decltype
(
bea_regno
))
-
1
);
operand
.
reg
.
RegNum
=
(
STARS_RegNo
)(
STARS_x86_R_st0
+
bea_regno
);
}
// case REGISTER_TYPE + SSE_REG :
...
...
@@ -121,7 +130,11 @@ STARS_IRDB_op_t::STARS_IRDB_op_t(const DecodedInstruction_t &d, int indx, const
if
(
the_arg
.
getString
()[
0
]
==
'x'
)
{
byteWidth
=
8
;
#if 1 // Use specialized register types.
OpType
=
op_XMMReg
;
#else // Using op_Reg for all regs, distinguishing them by the regno only.
OpType
=
op_Reg
;
#endif
assert
(
bea_regno
!=
(
decltype
(
bea_regno
))
-
1
);
if
(
16
>
bea_regno
)
operand
.
reg
.
RegNum
=
(
STARS_RegNo
)(
STARS_x86_R_xmm0
+
bea_regno
);
...
...
@@ -131,8 +144,12 @@ STARS_IRDB_op_t::STARS_IRDB_op_t(const DecodedInstruction_t &d, int indx, const
else
if
(
the_arg
.
getString
()[
0
]
==
'y'
)
{
byteWidth
=
16
;
OpType
=
op_YMMReg
;
assert
(
bea_regno
!=
(
decltype
(
bea_regno
))
-
1
);
#if 1 // Use specialized register types.
OpType
=
op_YMMReg
;
#else // Using op_Reg for all regs, distinguishing them by the regno only.
OpType
=
op_Reg
;
#endif
assert
(
bea_regno
!=
(
decltype
(
bea_regno
))
-
1
);
if
(
16
>
bea_regno
)
operand
.
reg
.
RegNum
=
(
STARS_RegNo
)(
STARS_x86_R_ymm0
+
bea_regno
);
else
...
...
@@ -275,6 +292,22 @@ no operands for eflags or mxcsr?
}
void
STARS_IRDB_op_t
::
Init
(
void
)
{
this
->
SegReg
=
STARS_x86_R_none
;
this
->
OpType
=
op_Void
;
// init the operand to 0, because the it should have no semantically valid meaning in any sense anyhow if OpType==Void.
memset
(
&
this
->
operand
,
0
,
sizeof
(
this
->
operand
));
this
->
visible
=
0
;
if
(
nullptr
!=
global_STARS_program
)
// global_STARS_program not available for early static initialization
this
->
byteWidth
=
global_STARS_program
->
GetSTARS_ISA_Bytewidth
();
else
this
->
byteWidth
=
8
;
}
bool
STARS_IRDB_op_t
::
operator
<
(
const
STARS_op_t
&
rOp_param
)
const
{
const
STARS_IRDB_op_t
*
p
=
dynamic_cast
<
const
STARS_IRDB_op_t
*>
(
&
rOp_param
);
...
...
@@ -420,8 +453,12 @@ void STARS_IRDB_op_t::Dump()
uint16_t
STARS_IRDB_op_t
::
GetByteWidth
(
void
)
const
{
if
(
OpType
==
op_Void
)
return
(
uint16_t
)
global_STARS_program
->
GetSTARS_ISA_Bytewidth
();
if
(
OpType
==
op_Void
)
{
if
(
nullptr
!=
global_STARS_program
)
// global_STARS_program not available for early static initialization
return
global_STARS_program
->
GetSTARS_ISA_Bytewidth
();
else
return
8
;
}
else
return
byteWidth
;
}
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next