/*
- * Copyright (C) 2012-2019 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2022 Free Software Foundation, Inc.
*
* This file is part of GNU lightning.
*
static void gtr(void); static void gti(void);
static void gtr_u(void); static void gti_u(void);
static void ner(void); static void nei(void);
+static void casr(void); static void casi(void);
static void movr(void); static void movi(void);
static void extr_c(void); static void extr_uc(void);
static void extr_s(void); static void extr_us(void);
entry(gtr), entry(gti),
entry(gtr_u), entry(gti_u),
entry(ner), entry(nei),
+ entry(casr), entry(casi),
entry(movr), entry(movi),
entry(extr_c), entry(extr_uc),
entry(extr_s), entry(extr_us),
jit_word_t im = get_imm(); \
jit_##name(r0, r1, r2, im); \
}
+#define entry_ir_im_ir_ir(name) \
+static void \
+name(void) \
+{ \
+ jit_gpr_t r0 = get_ireg(); \
+ jit_word_t im = get_imm(); \
+ jit_gpr_t r1 = get_ireg(), r2 = get_ireg(); \
+ jit_##name(r0, im, r1, r2); \
+}
+
#define entry_ir_ir(name) \
static void \
name(void) \
entry_ir_ir_ir(gtr) entry_ir_ir_im(gti)
entry_ir_ir_ir(gtr_u) entry_ir_ir_im(gti_u)
entry_ir_ir_ir(ner) entry_ir_ir_im(nei)
+entry_ir_ir_ir_ir(casr) entry_ir_im_ir_ir(casi)
entry_ir_ir(movr)
static void
movi(void)
jit_disassemble();
fprintf(stderr, " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n");
}
+ if (flag_verbose && argc) {
+ for (result = 0; result < argc; result++)
+ printf("argv[%d] = %s\n", result, argv[result]);
+ fprintf(stderr, " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n");
+ }
jit_clear_state();
if (flag_disasm)
{
#if HAVE_GETOPT_LONG_ONLY
fprintf(stderr, "\
-Usage: %s [jit assembler options] file [jit program options]\n\
+Usage: %s [jit assembler options] file [--] [jit program options]\n\
Jit assembler options:\n\
-help Display this information\n\
-v[0-3] Verbose output level\n\
- -d Do not use a data buffer\n\
- -D<macro>[=<val>] Preprocessor options\n"
+ -d Do not use a data buffer\n"
# if defined(__i386__) && __WORDSIZE == 32
" -mx87=1 Force using x87 when sse2 available\n"
# endif
, progname);
#else
fprintf(stderr, "\
-Usage: %s [jit assembler options] file [jit program options]\n\
+Usage: %s [jit assembler options] file [--] [jit program options]\n\
Jit assembler options:\n\
-h Display this information\n\
- -v Verbose output level\n\
- -D<macro>[=<val>] Preprocessor options\n", progname);
+ -v Verbose output level\n", progname);
#endif
finish_jit();
exit(1);
# define cc "gcc"
#endif
opt_short = snprintf(cmdline, sizeof(cmdline), cc " -E -x c %s", argv[opt_index]);
- for (++opt_index; opt_index < argc; opt_index++) {
- if (argv[opt_index][0] == '-')
- opt_short += snprintf(cmdline + opt_short,
- sizeof(cmdline) - opt_short,
- " %s", argv[opt_index]);
- else {
- --opt_index;
- break;
- }
- }
opt_short += snprintf(cmdline + opt_short,
sizeof(cmdline) - opt_short,
" -D__WORDSIZE=%d", __WORDSIZE);
opt_short += snprintf(cmdline + opt_short,
sizeof(cmdline) - opt_short,
" -D__alpha__=1");
+#endif
+#if defined(__loongarch__)
+ opt_short += snprintf(cmdline + opt_short,
+ sizeof(cmdline) - opt_short,
+ " -D__loongarch__=1");
#endif
if ((parser.fp = popen(cmdline, "r")) == NULL)
error("cannot execute %s", cmdline);