Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Shen, Siran
wacc
Commits
48c363e1
Commit
48c363e1
authored
Mar 17, 2021
by
Tom Zhao
Browse files
xz1919: resolved visitIdent size issue
parent
a934407e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/backend/intel/IntelInstructionGenerator.java
View file @
48c363e1
...
...
@@ -305,9 +305,10 @@ public class IntelInstructionGenerator extends InstructionGenerator<IntelInstruc
instructions
.
add
(
new
Lea
(
new
IntelAddress
(
rbp
,
-
offset
),
intelRegAllocator
.
allocate
()));
}
else
{
/* otherwise, put value in register */
// Map<Integer, IntelMovType> m = Map.of(8, IntelMovType.MOV, 4, IntelMovType.MOV, 1, IntelMovType.MOVZBQ);
// instructions.add(new Mov(new IntelAddress(rbp, -offset), intelRegAllocator.allocate().withSize(intToIntelSize.get(identTypeSize)), m.get(identTypeSize)));
instructions
.
add
(
new
Mov
(
new
IntelAddress
(
rbp
,
-
offset
),
intelRegAllocator
.
allocate
().
withSize
(
intToIntelSize
.
get
(
identTypeSize
)),
IntelMovType
.
MOV
));
Map
<
Integer
,
IntelMovType
>
m
=
Map
.
of
(
8
,
IntelMovType
.
MOV
,
4
,
IntelMovType
.
MOV
,
1
,
IntelMovType
.
MOVZBQ
);
IntelMovType
type
=
m
.
get
(
identTypeSize
);
IntelInstructionSize
size
=
type
.
equals
(
IntelMovType
.
MOV
)
?
intToIntelSize
.
get
(
identTypeSize
)
:
IntelInstructionSize
.
Q
;
instructions
.
add
(
new
Mov
(
new
IntelAddress
(
rbp
,
-
offset
),
intelRegAllocator
.
allocate
().
withSize
(
size
),
type
));
}
return
null
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment