[M3commit] CVS Update: cm3
Jay Krell
jkrell at elego.de
Fri Feb 5 14:34:12 CET 2010
CVSROOT: /usr/cvs
Changes by: jkrell at birch. 10/02/05 14:34:12
Modified files:
cm3/m3-sys/m3back/src/: M3x86.m3
Log message:
bring in all the code for add/sub/mult/check_hi/div/mod/check_lo/etc.
the main known missing pieces at this point are:
- check the return value of check_hi/lo/eq/range/index,
generate call to reportfault
currently I'm just discarding the return values
- get the parameter orders all correct, I've been less than guessing
- see about eliminating some of the functions; e.g. add/sub/and/or/xor/compares
are the most inlinable, not much else is (mul/div/mod/shift/rotate/insert/extract)
- also give the constant folding a chance instead of just always calling;
that givces even mul/div/mod/shift/rotate/insert/extract a good chance,
and the front end does use e.g. extract for division by powers of two or such;
this really is easy, it amounts to just moving all this code "a few lines down",
like into stackx86.m3 after it checks for the constant/immediate cases
(note that most operations are binary, so there imm op imm, and non-imm op imm,
and some of them are commutive e.g. plus, mult and some are not e.g. divide and shift)
- implement compares (the "check" ones are here, the functions are in hand2.c,
but I forgot to handle the normal cases)
- see about loophole/val zero extending vs. sign extending (currently always
zero extends which I'm sure is wrong, unless the frontend deals with it)
- of course flipping the switch in Target.m3, which I've done
frequently; consider a command line option for this for now
- probably move hand2.c to hand.c so it is statically linked, which
also saves an instruction per call (and lets off of the compatibility
hook mostly, though the static linking was really put in due to the data,
so the other options are only statically link the data, none of the functions,
or, really, in fact, eliminate the data, it looks easily eliminatable)
- exit_proc looks a little suspicious/fragile; it needs to be certain
to get the high part in edx, the low part in eax, currently'
it doesn't appear so deterministic; that will be easy
- I can't get the C compiler to generate an unsigned multiply, so maybe
signed is all we need, not two functions
- consider a more portable rotate implementation, currently is Visual C++
specific; could use #ifdef, really, not difficult.. just shift
in direction and or..
- test insert/extract in particular; they are a bit gnarly
None of these are particularly difficult and many of them are not important,
but some are very important.
More information about the M3commit
mailing list