Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tiger
nolimips
Commits
9ad5c9c4
Commit
9ad5c9c4
authored
Jul 29, 2003
by
Benoit Perrot
Browse files
Fill delay slot of native branch instructions with NOP.
parent
8d90c6dc
Changes
7
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
9ad5c9c4
2003-07-29 Benot Perrot <benoit@lrde.epita.fr>
* dev/mipsy-builder-gen.py,
* src/parse/libparse.hh, src/parse/libparse.cc,
* src/parse/parse-tasks.hh, src/parse/parse-tasks.cc:
Fill delay slot of native branch instructions with NOP.
* NEWS: Update.
2003-07-29 Benot Perrot <benoit@lrde.epita.fr>
* configure.ac:
...
...
NEWS
View file @
9ad5c9c4
-*- text -*-
New in 0.3:
New in 0.4:
* --fill-delay-slot: fill delay slot of native branch instructions with NOP.
New in 0.3, 2003-07-29:
* Make option engine support incomplete options.
* --check-callee-save: check that callee save registers are preserved
across a call.
...
...
dev/mipsy-builder-gen.py
View file @
9ad5c9c4
...
...
@@ -36,22 +36,26 @@ print """#ifndef INST_PROGRAM_BUILDER_HH
# include
\"
inst/all.hh
\"
# include
\"
inst/program.hh
\"
# include
\"
vm/cpu.hh
\"
namespace inst
{
using namespace inst;
using vm::Cpu;
class ProgramBuilder
{
public:
ProgramBuilder():
_program(0)
ProgramBuilder(
bool fill_delay_slot_p = false
):
_program(0)
, fill_delay_slot_p(fill_delay_slot_p)
{
}
public:
void reset()
void reset(
bool fill_delay_slot_p = false
)
{
this->fill_delay_slot_p = fill_delay_slot_p;
_program = new Program();
}
...
...
@@ -117,6 +121,14 @@ for inst in instructions:
print
" {"
call
=
"* new "
+
class_id
(
inst
.
opcode
)
+
"("
+
call
+
")"
print
" _program->text_section().add_inst ("
+
call
+
");"
if
inst
.
kind
==
"branch"
:
print
" if (fill_delay_slot_p)"
print
" _program->text_section()."
print
" add_inst (* new Sll(* new Register(Register::general, "
+
\
"Cpu::zero), "
print
" * new Register(Register::general, "
+
\
"Cpu::zero), "
print
" * new IntExp(0)));"
print
" }"
else
:
# syntax.level == "complex"
...
...
@@ -132,6 +144,7 @@ for inst in instructions:
print
"""
protected:
Program* _program;
bool fill_delay_slot_p;
};
} // namespace inst
...
...
src/parse/libparse.cc
View file @
9ad5c9c4
...
...
@@ -32,13 +32,16 @@ namespace parse
// Authorize unlimited registers.
bool
unlimited_regs_p
=
false
;
// Fill delay slot of native branch instructions with NOP.
bool
fill_delay_slot_p
=
false
;
// Parse a MIPS asm file, return the corresponding abstract syntax.
::
inst
::
Program
*
parse
(
const
std
::
string
&
fname
)
{
yy
::
Parser
parser
=
yy
::
Parser
(
trace_parse_p
,
yy
::
Location
());
yy
::
program_builder
.
reset
();
yy
::
program_builder
.
reset
(
fill_delay_slot_p
);
scan_open
(
fname
);
parser
.
parse
();
...
...
src/parse/libparse.hh
View file @
9ad5c9c4
...
...
@@ -35,6 +35,8 @@ namespace parse
extern
bool
unlimited_regs_p
;
extern
bool
fill_delay_slot_p
;
}
// namespace parse
#endif // !PARSE_LIBPARSE_HH
src/parse/parse-tasks.cc
View file @
9ad5c9c4
...
...
@@ -48,11 +48,21 @@ namespace parse
trace_parse_p
=
true
;
}
void
fill_delay_slot
()
{
fill_delay_slot_p
=
true
;
}
inst
::
Program
*
program
=
0
;
void
parse
()
{
assertion
(
filename
!=
NULL
);
if
(
filename
==
NULL
)
{
std
::
cerr
<<
"You must specify an input file."
<<
std
::
endl
;
exit
(
exit_failure
);
}
program
=
::
parse
::
parse
(
filename
);
if
(
!
program
)
...
...
src/parse/parse-tasks.hh
View file @
9ad5c9c4
...
...
@@ -39,6 +39,9 @@ namespace parse
TASK_DECLARE
(
"trace-parse"
,
"Trace the parse"
,
trace_parse
,
""
);
TASK_DECLARE
(
"fill-delay-slot"
,
"Fill delay slot of native branch instructions with NOP"
,
fill_delay_slot
,
""
);
TASK_DECLARE
(
"parse"
,
"Parse a file"
,
parse
,
""
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment