Commit a89344a0 authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Index: ChangeLog

from  Benoît Perrot  <benoit@lrde.epita.fr>
        * dev/inst-solver-gen.py,
        * dev/parse-asm-scan-gen.py,
        * src/inst/register.hh:
        Support generic register identifiers.
        * NEWS:
        Document it.
        * tests/lexical/unlimited-regs.s:
        Move to...
        * tests/solve/unlimited-regs.s:
        This file.
        * tests/lexical/Makefile.am,
        * tests/solve/Makefile.am:
        Update.
parent fd67a92e
2004-04-05 Benot Perrot <benoit@lrde.epita.fr>
* dev/inst-solver-gen.py,
* dev/parse-asm-scan-gen.py,
* src/inst/register.hh:
Support generic register identifiers.
* NEWS:
Document it.
* tests/lexical/unlimited-regs.s:
Move to...
* tests/solve/unlimited-regs.s:
This file.
* tests/lexical/Makefile.am,
* tests/solve/Makefile.am:
Update.
2004-04-05 Benot Perrot <benoit@lrde.epita.fr>
* dev/mipsy.py:
......
-*- text -*-
New in 0.6:
* The scanner now supports explicit and generic register identifiers.
The statement:
addi $t0, $t1, 2097
is equivalent to:
addi $8, $9, 2097
New in 0.5:
* Support delay slot.
* The virtual machine now supports delay slot.
The statement:
jal exit
addi $t0, $zero, 2097
is equivalent to:
addi $t0, $zero, 2097
jal exit
nop
Use --fill-delay-slots to do as if delay slots were not supported.
* Use a memory management unit.
New in 0.4, 2003-08-14:
* Look for $a0 as argument of exit syscall.
* Look for $a0 as argument of exit syscall. This enables users to test the
exit status of their programs.
* Distribute testsuite.
* --fill-delay-slot: fill delay slot of native branch instructions with NOP.
New in 0.3, 2003-07-29:
......
......@@ -83,6 +83,10 @@ namespace inst
virtual void visit(IntExp &i);
virtual void visit(LabelExp &l);
virtual void visit(OpExp &o);
protected:
void solve_cpu_register(Register &reg) const;
void solve_cop_register(Register &reg) const;
"""
print " protected:"
......@@ -162,6 +166,38 @@ namespace inst
break;
}
}
void
ProgramSolver::solve_cpu_register(Register &reg) const
{
switch (reg.get_kind())
{
case Register::generic:
reg.set_kind(Register::general);
break;
case Register::general:
break;
case Register::unlimited:
if (!parse::unlimited_regs_p)
{
std::cerr << \"Unlimited registers prohibited.\" << std::endl;
exit_set(exit_solve);
}
break;
};
}
void
ProgramSolver::solve_cop_register(Register &reg) const
{
if (reg.get_kind() != Register::generic)
{
std::cerr << \"Coprocessor registers must be generic.\" << std::endl;
exit_set(exit_solve);
}
}
"""
for inst in instructions:
......@@ -170,9 +206,12 @@ for inst in instructions:
content = ""
for attribute in inst.format.attributes:
if attribute.type in "Exp":
if attribute.type == "Exp":
content = content + " solve_exp(" + \
var_id + ".get_" + attribute.name + "());\n"
elif attribute.type == "Register":
content = content + " solve_cpu_register(" + \
var_id + ".get_" + attribute.name + "());"
print " void"
if content != "":
......
......@@ -105,6 +105,11 @@ for inst in instructions:
## Epilogue ----------------------------
print """
\"$\"([0-9]|[12][0-9]|3[01]) {
yylval->reg = new Register(Register::generic, atoi(yytext +1));
return REGISTER;
}
\"$zero\" {
yylval->reg = new Register(Register::general, Cpu::zero);
return REGISTER;
......@@ -131,12 +136,6 @@ print """
}
\"$x\"{dec_int} {
if (!parse::unlimited_regs_p)
{
std::cerr << *yylloc
<< \": unlimited registers prohibited\" << std::endl;
exit_set (exit_scan);
}
yylval->reg = new Register(Register::unlimited, atoi(yytext +2));
return REGISTER;
}
......
......@@ -2,27 +2,31 @@
(Created-By-Prcs-Version 1 3 2)
(Project-Description "")
(Project-Version mipsy 0 81)
(Parent-Version mipsy 0 80)
(Project-Version mipsy 0 82)
(Parent-Version mipsy 0 81)
(Version-Log
"Index: ChangeLog
from Benot Perrot <benoit@lrde.epita.fr>
* dev/mipsy.py:
Add a C++ variable identifier writer.
* dev/inst-solver-gen.py:
Generate program solver (interface and implementation).
* dev/inst-makefile-gen.py:
Use the generator.
* src/inst/program_solver.hh:
Remove now generated file.
* dev/inst-solver-gen.py,
* dev/parse-asm-scan-gen.py,
* src/inst/register.hh:
Support generic register identifiers.
* NEWS:
Document it.
* tests/lexical/unlimited-regs.s:
Move to...
* tests/solve/unlimited-regs.s:
This file.
* tests/lexical/Makefile.am,
* tests/solve/Makefile.am:
Update.
")
(New-Version-Log
"")
(Checkin-Time "Sun, 04 Apr 2004 16:26:16 +0200")
(Checkin-Time "Sun, 04 Apr 2004 17:11:04 +0200")
(Checkin-Login benoit)
(Files
......@@ -30,10 +34,10 @@ from Beno
;; ./
(AUTHORS (mipsy/0_AUTHORS 1.1 644))
(COPYING (mipsy/1_COPYING 1.1 644))
(ChangeLog (mipsy/2_ChangeLog 1.75 604))
(ChangeLog (mipsy/2_ChangeLog 1.76 604))
(INSTALL (mipsy/b/12_INSTALL 1.1 604))
(Makefile.am (mipsy/3_Makefile.a 1.8 604))
(NEWS (mipsy/b/25_NEWS 1.6 604))
(NEWS (mipsy/b/25_NEWS 1.7 604))
(README (mipsy/4_README 1.3 604))
(TODO (mipsy/5_TODO 1.3 604))
(bootstrap (mipsy/b/14_bootstrap 1.3 705))
......@@ -48,11 +52,11 @@ from Beno
(dev/inst-builder-gen.py (mipsy/15_mipsy-buil 1.12 705))
(dev/inst-makefile-gen.py (mipsy/b/15_mipsy-mk-i 1.9 705))
(dev/inst-nodes-gen.py (mipsy/12_mipsy-inst 1.10 705))
(dev/inst-solver-gen.py (mipsy/b/13_inst-solve 1.1 755))
(dev/inst-solver-gen.py (mipsy/b/13_inst-solve 1.2 755))
(dev/mipsy.py (mipsy/16_mipsy.py 1.9 705))
(dev/mipsy.xml (mipsy/17_mipsy.xml 1.16 604))
(dev/parse-asm-parse-gen.py (mipsy/13_mipsy-pars 1.10 705))
(dev/parse-asm-scan-gen.py (mipsy/14_mipsy-scan 1.11 705))
(dev/parse-asm-scan-gen.py (mipsy/14_mipsy-scan 1.12 705))
;; ./doc/
(doc/Makefile.am (mipsy/b/9_Makefile.a 1.3 604))
......@@ -81,7 +85,7 @@ from Beno
(src/inst/label.hh (mipsy/b/20_label.hh 1.4 604))
(src/inst/program.hh (mipsy/28_program.hh 1.4 644))
(src/inst/program_builder.cc (mipsy/29_program_bu 1.14 604))
(src/inst/register.hh (mipsy/31_register.h 1.7 644))
(src/inst/register.hh (mipsy/31_register.h 1.8 644))
(src/inst/section.hh (mipsy/b/24_section.hh 1.8 604))
(src/inst/text_section.hh (mipsy/32_text_secti 1.8 604))
(src/inst/text_section.cc (mipsy/c/33_text_secti 1.2 644))
......@@ -148,11 +152,10 @@ from Beno
(tests/good/shift.s (mipsy/b/44_shift.s 1.2 644))
;; ./tests/lexical/
(tests/lexical/Makefile.am (mipsy/b/45_Makefile.a 1.1 644))
(tests/lexical/Makefile.am (mipsy/b/45_Makefile.a 1.2 644))
(tests/lexical/check-lexical (mipsy/c/10_check-lexi 1.1 745))
(tests/lexical/invalid-string-hexa.s (mipsy/b/46_invalid-st 1.1 644))
(tests/lexical/invalid-string-octal.s (mipsy/b/47_invalid-st 1.1 644))
(tests/lexical/unlimited-regs.s (mipsy/b/48_unlimited- 1.1 644))
(tests/lexical/unrecognized-escape.s (mipsy/b/49_unrecogniz 1.1 644))
(tests/lexical/unterminated-string.s (mipsy/b/50_unterminat 1.1 644))
......@@ -163,9 +166,10 @@ from Beno
(tests/runtime/no-main.s (mipsy/c/1_no-main.s 1.2 644))
;; ./tests/solve/
(tests/solve/Makefile.am (mipsy/c/2_Makefile.a 1.1 644))
(tests/solve/Makefile.am (mipsy/c/2_Makefile.a 1.2 644))
(tests/solve/check-solve (mipsy/c/12_check-solv 1.1 745))
(tests/solve/undefined-labels.s (mipsy/c/3_undefined- 1.2 644))
(tests/solve/unlimited-regs.s (mipsy/b/48_unlimited- 1.1 644))
;; ./tests/syntax/
(tests/syntax/Makefile.am (mipsy/c/4_Makefile.a 1.1 644))
......
......@@ -31,7 +31,11 @@ namespace inst
public:
enum kind_type
{
/// Generic (processor, coprocessor) kind ($0, $1, etc.)
generic,
/// General purpose (processor) register ($zero, $a0, etc.)
general,
/// Unlimited (processor) register ($x2097, etc.)
unlimited
};
......@@ -52,6 +56,11 @@ namespace inst
{
return kind_;
}
void set_kind(kind_type kind)
{
kind_ = kind;
}
int get_index () const
{
return index_;
......
......@@ -2,7 +2,6 @@
ASM_FILES = \
invalid-string-octal.s \
invalid-string-hexa.s \
unlimited-regs.s \
unrecognized-escape.s \
unterminated-string.s
......
### Sources
ASM_FILES = \
undefined-labels.s
undefined-labels.s \
unlimited-regs.s
dist_noinst_DATA = $(ASM_FILES)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment