summaryrefslogtreecommitdiff
path: root/libguile/jit.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-07-30 17:36:11 +0200
committerAndy Wingo <wingo@pobox.com>2020-07-30 17:36:11 +0200
commit172e5ccfc1e0a26880fd328ef72c7bbcb9c2fca1 (patch)
treea495dbbb5fdd3f58a9f3eef081a058daac91d14c /libguile/jit.c
parentf13b27a4cc6ea35e8595e7d926c5632eb797364a (diff)
downloadguile-172e5ccfc1e0a26880fd328ef72c7bbcb9c2fca1.tar.gz
Add sign-extending make-immediate instruction
* doc/ref/vm.texi (Instruction Set, Constant Instructions): Document new instruction. * libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): New first word kind with zi16 operand. * libguile/jit.c (compile_make_immediate, compile_make_immediate_slow): New compilers. (COMPILE_X8_S8_ZI16): New operand kind. * libguile/vm-engine.c (make-immediate): New instruction. * module/language/bytecode.scm: * module/system/vm/assembler.scm (encode-X8_S8_ZI16<-/shuffle): (signed-bits, load-constant): Support the new instruction kind. * module/system/vm/disassembler.scm (disassemblers) (sign-extended-immediate, code-annotation): Support for zi16 operands.
Diffstat (limited to 'libguile/jit.c')
-rw-r--r--libguile/jit.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libguile/jit.c b/libguile/jit.c
index 75dbe64fd..d221428fc 100644
--- a/libguile/jit.c
+++ b/libguile/jit.c
@@ -2817,6 +2817,17 @@ compile_call_u64_from_scm_slow (scm_jit_state *j, uint16_t dst, uint16_t a, uint
}
static void
+compile_make_immediate (scm_jit_state *j, uint8_t dst, SCM a)
+{
+ emit_movi (j, T0, SCM_UNPACK (a));
+ emit_sp_set_scm (j, dst, T0);
+}
+static void
+compile_make_immediate_slow (scm_jit_state *j, uint8_t dst, SCM a)
+{
+}
+
+static void
compile_make_short_immediate (scm_jit_state *j, uint8_t dst, SCM a)
{
emit_movi (j, T0, SCM_UNPACK (a));
@@ -5274,6 +5285,14 @@ compile_s64_to_f64_slow (scm_jit_state *j, uint16_t dst, uint16_t src)
comp (j, a, SCM_PACK (b)); \
}
+#define COMPILE_X8_S8_ZI16(j, comp) \
+ { \
+ uint8_t a; \
+ int16_t b; \
+ UNPACK_8_16 (j->ip[0], a, b); \
+ comp (j, a, SCM_PACK ((scm_t_signed_bits) b)); \
+ }
+
#define COMPILE_X32__C32(j, comp) \
{ \
comp (j, j->ip[1]); \