summaryrefslogtreecommitdiff
path: root/libguile/instructions.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/instructions.c')
-rw-r--r--libguile/instructions.c69
1 files changed, 39 insertions, 30 deletions
diff --git a/libguile/instructions.c b/libguile/instructions.c
index 29e60983b..ddd88b311 100644
--- a/libguile/instructions.c
+++ b/libguile/instructions.c
@@ -1,29 +1,35 @@
-/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 3 of
- * the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
+/* Copyright 2001,2009-2013,2017-2018
+ Free Software Foundation, Inc.
+
+ This file is part of Guile.
+
+ Guile is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Guile is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with Guile. If not, see
+ <https://www.gnu.org/licenses/>. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
-#include <string.h>
-
-#include "_scm.h"
+#include "extensions.h"
+#include "gsubr.h"
+#include "list.h"
+#include "numbers.h"
+#include "pairs.h"
+#include "symbols.h"
#include "threads.h"
+#include "version.h"
+
#include "instructions.h"
@@ -40,12 +46,14 @@ SCM_SYMBOL (sym_bang, "!");
M(X8_S8_I16) \
M(X8_S12_S12) \
M(X8_S12_C12) \
+ M(X8_S12_Z12) \
M(X8_C12_C12) \
M(X8_F12_F12) \
M(X8_S8_S8_S8) \
M(X8_S8_C8_S8) \
M(X8_S8_S8_C8) \
M(C8_C24) \
+ M(C8_S24) \
M(C32) /* Unsigned. */ \
M(I32) /* Immediate. */ \
M(A32) /* Immediate, high bits. */ \
@@ -65,7 +73,8 @@ SCM_SYMBOL (sym_bang, "!");
M(B1_X7_C24) \
M(B1_X7_S24) \
M(B1_X7_F24) \
- M(B1_X31)
+ M(B1_X31) \
+ M(C16_C16)
#define TYPE_WIDTH 6
@@ -95,7 +104,7 @@ static SCM word_type_symbols[] =
by Scheme to generate assemblers and disassemblers for the
instructions. */
-#define NOP SCM_T_UINT64_MAX
+#define NOP UINT64_MAX
#define OP1(type0) \
(OP (0, type0))
#define OP2(type0, type1) \
@@ -109,6 +118,12 @@ static SCM word_type_symbols[] =
#define OP_DST (1 << (TYPE_WIDTH * 5))
+#define DOP1(t0) (OP1(t0) | OP_DST)
+#define DOP2(t0, t1) (OP2(t0, t1) | OP_DST)
+#define DOP3(t0, t1, t2) (OP3(t0, t1, t2) | OP_DST)
+#define DOP4(t0, t1, t2, t3) (OP4(t0, t1, t2, t3) | OP_DST)
+#define DOP5(t0, t1, t2, t3, t4) (OP5(t0, t1, t2, t3, t4) | OP_DST)
+
#define WORD_TYPE_AND_FLAG(n, word) \
(((word) >> ((n) * TYPE_WIDTH)) & ((1 << TYPE_WIDTH) - 1))
#define WORD_TYPE(n, word) \
@@ -119,7 +134,7 @@ static SCM word_type_symbols[] =
/* Scheme interface */
static SCM
-parse_instruction (scm_t_uint8 opcode, const char *name, scm_t_uint64 meta)
+parse_instruction (uint8_t opcode, const char *name, uint64_t meta)
{
SCM tail = SCM_EOL;
int len;
@@ -193,12 +208,6 @@ scm_init_instructions (void)
#undef INIT
#ifndef SCM_MAGIC_SNARFER
-#include "libguile/instructions.x"
+#include "instructions.x"
#endif
}
-
-/*
- Local Variables:
- c-file-style: "gnu"
- End:
-*/