s390_ldr (code, ins->dreg, ins->sreg1); \
}
-#define MONO_EMIT_NEW_MOVE2(cfg,dest,offset,src,imm,size) do { \
+#define MONO_EMIT_NEW_MOVE(cfg,dest,offset,src,imm,size) do { \
MonoInst *inst; \
int tmpr = 0; \
int sReg, dReg; \
MONO_ADD_INS (cfg->cbb, inst); \
} while (0)
-#define MONO_OUTPUT_VTR2(cfg, size, dr, sr, so) do { \
+#define MONO_OUTPUT_VTR(cfg, size, dr, sr, so) do { \
int reg = mono_alloc_preg (cfg); \
switch (size) { \
case 0: \
mono_call_inst_add_outarg_reg(cfg, call, reg, dr, FALSE); \
} while (0)
-#define MONO_OUTPUT_VTS2(cfg, size, dr, dx, sr, so) do { \
+#define MONO_OUTPUT_VTS(cfg, size, dr, dx, sr, so) do { \
int tmpr; \
switch (size) { \
case 0: \
dr, dx, tmpr); \
break; \
case 8: \
- MONO_EMIT_NEW_MOVE2 (cfg, dr, dx, sr, so, size); \
+ MONO_EMIT_NEW_MOVE (cfg, dr, dx, sr, so, size); \
break; \
} \
} while (0)
#include "mini-s390x.h"
#include "cpu-s390x.h"
#include "jit-icalls.h"
+#include "ir-emit.h"
/*========================= End of Includes ========================*/
gpointer mono_arch_get_lmf_addr (void);
static guint8 * emit_load_volatile_arguments (guint8 *, MonoCompile *);
static void catch_SIGILL(int, siginfo_t *, void *);
-static void emit_sig_cookie (MonoCompile *, MonoCallInst *, CallInfo *, int);
/*========================= End of Prototypes ======================*/
cinfo = get_call_info (cfg, cfg->mempool, sig, sig->pinvoke);
- if (cinfo->struct_ret) {
- if (!cfg->new_ir) {
- cfg->vret_addr->opcode = OP_REGVAR;
- cfg->vret_addr->inst_c0 = s390_r2;
- }
- } else {
+ if (!cinfo->struct_ret) {
switch (mono_type_get_underlying_type (sig->ret)->type) {
case MONO_TYPE_VOID:
break;
inst->opcode = OP_REGOFFSET;
inst->inst_basereg = frame_reg;
offset += sizeof(gpointer);
- if (!cfg->new_ir && (sig->call_convention == MONO_CALL_VARARG) &&
- (!retFitsInReg (cinfo->ret.size)))
- cfg->sig_cookie += cinfo->ret.size;
if (G_UNLIKELY (cfg->verbose_level > 1)) {
printf ("vret_addr =");
mono_print_ins (cfg->vret_addr);
inst = cfg->args [curinst];
if (inst->opcode != OP_REGVAR) {
switch (cinfo->args[iParm].regtype) {
- case RegTypeStructByAddr :
- if (cfg->new_ir) {
- MonoInst *indir;
+ case RegTypeStructByAddr : {
+ MonoInst *indir;
- size = sizeof (gpointer);
+ size = sizeof (gpointer);
- inst->opcode = OP_REGOFFSET;
- inst->inst_basereg = frame_reg;
- offset = S390_ALIGN (offset, sizeof (gpointer));
- inst->inst_offset = offset;
-
- /* Add a level of indirection */
- MONO_INST_NEW (cfg, indir, 0);
- *indir = *inst;
- inst->opcode = OP_VTARG_ADDR;
- inst->inst_left = indir;
- } else {
- if (cinfo->args[iParm].reg == STK_BASE) {
- inst->opcode = OP_S390_LOADARG;
- inst->inst_basereg = frame_reg;
- offset = S390_ALIGN(offset, sizeof(long));
- inst->inst_offset = offset;
- size = abs(cinfo->args[iParm].vtsize);
- inst->backend.arg_info = cinfo->args[iParm].offset;
- } else {
- inst->opcode = OP_S390_ARGREG;
- inst->inst_basereg = frame_reg;
- size = sizeof(gpointer);
- offset = S390_ALIGN(offset, size);
- inst->inst_offset = offset;
- inst->backend.arg_info = cinfo->args[iParm].offset;
- }
- }
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset = S390_ALIGN (offset, sizeof (gpointer));
+ inst->inst_offset = offset;
+
+ /* Add a level of indirection */
+ MONO_INST_NEW (cfg, indir, 0);
+ *indir = *inst;
+ inst->opcode = OP_VTARG_ADDR;
+ inst->inst_left = indir;
+ }
break;
case RegTypeStructByVal :
- if (cfg->new_ir) {
- size = cinfo->args[iParm].size;
- offset = S390_ALIGN(offset, size);
- inst->opcode = OP_REGOFFSET;
- inst->inst_basereg = frame_reg;
- inst->inst_offset = offset;
+ size = cinfo->args[iParm].size;
+ offset = S390_ALIGN(offset, size);
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ inst->inst_offset = offset;
+ break;
+ default :
+ if (cinfo->args [iParm].reg == STK_BASE) {
+ /*
+ * These arguments are in the previous frame, so we can't
+ * compute their offset from the current frame pointer right
+ * now, since cfg->stack_offset is not yet known, so dedicate a
+ * register holding the previous frame pointer.
+ */
+ cfg->arch.bkchain_reg = s390_r12;
+ cfg->used_int_regs |= 1 << cfg->arch.bkchain_reg;
+
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = cfg->arch.bkchain_reg;
+ size = (cinfo->args[iParm].size < 8
+ ? 8 - cinfo->args[iParm].size
+ : 0);
+ inst->inst_offset = cinfo->args [iParm].offset + size;
+ size = sizeof (long);
} else {
- inst->opcode = OP_S390_ARGPTR;
+ inst->opcode = OP_REGOFFSET;
inst->inst_basereg = frame_reg;
- size = cinfo->args[iParm].size;
+ size = (cinfo->args[iParm].size < 8
+ ? sizeof(int)
+ : sizeof(long));
offset = S390_ALIGN(offset, size);
inst->inst_offset = offset;
- inst->backend.arg_info = cinfo->args[iParm].offset;
- }
- break;
- default :
- if (cfg->new_ir) {
- if (cinfo->args [iParm].reg == STK_BASE) {
- /*
- * These arguments are in the previous frame, so we can't
- * compute their offset from the current frame pointer right
- * now, since cfg->stack_offset is not yet known, so dedicate a
- * register holding the previous frame pointer.
- */
- cfg->arch.bkchain_reg = s390_r12;
- cfg->used_int_regs |= 1 << cfg->arch.bkchain_reg;
-
- inst->opcode = OP_REGOFFSET;
- inst->inst_basereg = cfg->arch.bkchain_reg;
- size = (cinfo->args[iParm].size < 8
- ? 8 - cinfo->args[iParm].size
- : 0);
- inst->inst_offset = cinfo->args [iParm].offset + size;
- size = sizeof (long);
- } else {
- inst->opcode = OP_REGOFFSET;
- inst->inst_basereg = frame_reg;
- size = (cinfo->args[iParm].size < 8
- ? sizeof(int)
- : sizeof(long));
- offset = S390_ALIGN(offset, size);
- inst->inst_offset = offset;
- }
- } else {
- if (cinfo->args[iParm].reg != STK_BASE) {
- inst->opcode = OP_REGOFFSET;
- inst->inst_basereg = frame_reg;
- size = (cinfo->args[iParm].size < 8
- ? sizeof(int)
- : sizeof(long));
- offset = S390_ALIGN(offset, size);
- inst->inst_offset = offset;
- } else {
- inst->opcode = OP_S390_STKARG;
- inst->inst_basereg = frame_reg;
- size = ((cinfo->args[iParm].size < 8)
- ? 8 - cinfo->args[iParm].size
- : 0);
- inst->inst_offset = cinfo->args[iParm].offset +
- size;
- inst->backend.arg_info = 0;
- size = sizeof(long);
- }
}
break;
}
arg->offPrm = ainfo->offparm + cinfo->sz.offStruct;
*/
if (ainfo->reg != STK_BASE) {
- MONO_OUTPUT_VTR2 (cfg, size, ainfo->reg, src->dreg, 0);
+ MONO_OUTPUT_VTR (cfg, size, ainfo->reg, src->dreg, 0);
} else {
- MONO_OUTPUT_VTS2 (cfg, size, ainfo->reg, ainfo->offset,
+ MONO_OUTPUT_VTS (cfg, size, ainfo->reg, ainfo->offset,
src->dreg, 0);
}
} else if (ainfo->regtype == RegTypeStructByValInFP) {
mono_call_inst_add_outarg_reg (cfg, call, dreg, ainfo->reg, TRUE);
} else {
- MONO_EMIT_NEW_MOVE2 (cfg, STK_BASE, ainfo->offparm,
+ MONO_EMIT_NEW_MOVE (cfg, STK_BASE, ainfo->offparm,
src->dreg, 0, size);
}
}
{
MonoInst *ins, *next;
- if (bb->max_vreg > cfg->rs->next_vreg)
- cfg->rs->next_vreg = bb->max_vreg;
-
MONO_BB_FOR_EACH_INS_SAFE (bb, next, ins) {
switch (ins->opcode) {
case OP_DIV_IMM:
}
}
- bb->max_vreg = cfg->rs->next_vreg;
+ bb->max_vreg = cfg->next_vreg;
}
/*========================= End of Function ========================*/