mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 17:20:29 +02:00
Add lsh, rsh instructions
* libguile/vm-engine.c (lsh, rsh, lsh/immediate, rsh/immediate): New instructions taking unboxed bit counts. * module/language/cps/compile-bytecode.scm (compile-function): * module/language/cps/effects-analysis.scm: * module/language/cps/specialize-numbers.scm (specialize-f64-unop): (specialize-u64-unop): Add ability to specialize add/immediate, etc, and add lsh/immediate as well. (specialize-u64-binop, specialize-u64-shift): Move rsh/lsh specialization to its own procedure, given that the bit count is already unboxed. (specialize-operations): Adapt to support more /immediate instructions. * module/language/cps/type-fold.scm (mul): Reify an lsh/immediate instead of an ash. * module/language/cps/types.scm (compute-ash-range): Add type inferrers for lsh, rsh, and their immediate variants. * module/system/vm/assembler.scm: Export emit-lsh and so on. * module/language/tree-il/compile-cps.scm (convert): Convert "ash" on immediates to rsh/immediate or lsh/immediate.
This commit is contained in:
parent
dea84a46b4
commit
17bd5a8938
8 changed files with 304 additions and 36 deletions
|
@ -192,6 +192,14 @@
|
|||
(emit-usub/immediate asm (from-sp dst) (from-sp (slot x)) y))
|
||||
(($ $primcall 'umul/immediate y (x))
|
||||
(emit-umul/immediate asm (from-sp dst) (from-sp (slot x)) y))
|
||||
(($ $primcall 'rsh (x y))
|
||||
(emit-rsh asm (from-sp dst) (from-sp (slot x)) (from-sp (slot y))))
|
||||
(($ $primcall 'lsh (x y))
|
||||
(emit-lsh asm (from-sp dst) (from-sp (slot x)) (from-sp (slot y))))
|
||||
(($ $primcall 'rsh/immediate y (x))
|
||||
(emit-rsh/immediate asm (from-sp dst) (from-sp (slot x)) y))
|
||||
(($ $primcall 'lsh/immediate y (x))
|
||||
(emit-lsh/immediate asm (from-sp dst) (from-sp (slot x)) y))
|
||||
(($ $primcall 'ursh/immediate y (x))
|
||||
(emit-ursh/immediate asm (from-sp dst) (from-sp (slot x)) y))
|
||||
(($ $primcall 'ulsh/immediate y (x))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue