mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-19 19:20:23 +02:00
2013-02-04 Paulo Andrade <pcpa@gnu.org> * include/lightning.h, include/lightning/jit_private.h, lib/jit_arm-cpu.c, lib/jit_arm.c, lib/jit_mips-cpu.c, lib/jit_mips.c, lib/jit_ppc-cpu.c, lib/jit_ppc.c, lib/jit_x86-cpu.c, lib/jit_x86.c, lib/lightning.c: Implement the new qmul and qdiv instructions that return signed and unsigned lo/hi multiplication result and div/rem division result. These should be useful for jit translation of code that needs to know if a multiplication overflows (no branch opcode added) or if a division is exact (easy check if remainder is zero). * check/lightning.c, lib/jit_print.c, check/Makefile.am, check/all.tst: Update for the new qmul and qdiv instructions. * check/qalu.inc, check/qalu_div.ok, check/qalu_div.tst, check/qalu_mul.ok, check/qalu_mul.tst: New files implementing simple test cases for qmul and qdiv.
30 lines
1.2 KiB
Text
30 lines
1.2 KiB
Text
* Update documentation to match new implementation.
|
|
|
|
* Make an sparc port to not remove previous functionality.
|
|
|
|
* Add two new base instructions to help dynamically typed
|
|
languages, that use two result registers and two argument
|
|
registers, implementing multiplication and quotient+remainder
|
|
return from division. Alternatively, can add branch codes
|
|
for multiplication that overflows (and reverse for no
|
|
overflow) and division with zero remainder or non zero
|
|
remainder.
|
|
Suggested names for now are "qmul" and "qdiv", with "r"
|
|
and "i" variants, and possibly unsigned version. Branches
|
|
would use "bo" and "bx" prefix.
|
|
|
|
* Convert retr to an actual node, otherwise, code like:
|
|
movi %r0 1
|
|
divr %r1 %r2 %r3
|
|
retr %r0
|
|
will fail in x86 because, besides "divr" telling it clobbers
|
|
%rax (r0) it ends being ignored because retr is a noop there
|
|
(removed "mov %rax,%rax" expansion) and the code checking for
|
|
live registers ends up not knowing about %rax being live after
|
|
the "divr". This affects only x86.
|
|
|
|
* Validate that divrem in jit_x86-cpu.c is not modifying
|
|
the non result arguments. This is not verified by clobber.tst,
|
|
as it only checks registers not involved in the operation
|
|
(because it does not know about values being set as input
|
|
for the the operation).
|