#include <mono/utils/mono-proclib.h>
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-hwcap.h>
+#include <mono/utils/unlocked.h>
#include "mini-ppc.h"
#ifdef TARGET_POWERPC64
fr = PPC_FIRST_FPARG_REG;
gr = PPC_FIRST_ARG_REG;
- /* FIXME: handle returning a struct */
- if (MONO_TYPE_ISSTRUCT (sig->ret)) {
+ if (mini_type_is_vtype (sig->ret)) {
cinfo->vtype_retaddr = TRUE;
}
ppc_mtctr (code, ins->sreg1);
ppc_bcctr (code, PPC_BR_ALWAYS, 0);
break;
+ case OP_ICNEQ:
+ ppc_li (code, ins->dreg, 0);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_EQ, 2);
+ ppc_li (code, ins->dreg, 1);
+ break;
case OP_CEQ:
case OP_ICEQ:
CASE_PPC64 (OP_LCEQ)
ppc_bc (code, PPC_BR_TRUE, PPC_BR_LT, 2);
ppc_li (code, ins->dreg, 0);
break;
+ case OP_ICGE:
+ case OP_ICGE_UN:
+ ppc_li (code, ins->dreg, 1);
+ ppc_bc (code, PPC_BR_FALSE, PPC_BR_LT, 2);
+ ppc_li (code, ins->dreg, 0);
+ break;
case OP_CGT:
case OP_CGT_UN:
case OP_ICGT:
ppc_bc (code, PPC_BR_TRUE, PPC_BR_GT, 2);
ppc_li (code, ins->dreg, 0);
break;
+ case OP_ICLE:
+ case OP_ICLE_UN:
+ ppc_li (code, ins->dreg, 1);
+ ppc_bc (code, PPC_BR_FALSE, PPC_BR_GT, 2);
+ ppc_li (code, ins->dreg, 0);
+ break;
case OP_COND_EXC_EQ:
case OP_COND_EXC_NE_UN:
case OP_COND_EXC_LT:
ppc_fcmpu (code, 0, ins->sreg1, ins->sreg2);
break;
case OP_FCEQ:
+ case OP_FCNEQ:
ppc_fcmpo (code, 0, ins->sreg1, ins->sreg2);
- ppc_li (code, ins->dreg, 0);
- ppc_bc (code, PPC_BR_FALSE, PPC_BR_EQ, 2);
ppc_li (code, ins->dreg, 1);
+ ppc_bc (code, ins->opcode == OP_FCEQ ? PPC_BR_TRUE : PPC_BR_FALSE, PPC_BR_EQ, 2);
+ ppc_li (code, ins->dreg, 0);
break;
case OP_FCLT:
+ case OP_FCGE:
ppc_fcmpo (code, 0, ins->sreg1, ins->sreg2);
ppc_li (code, ins->dreg, 1);
- ppc_bc (code, PPC_BR_TRUE, PPC_BR_LT, 2);
+ ppc_bc (code, ins->opcode == OP_FCLT ? PPC_BR_TRUE : PPC_BR_FALSE, PPC_BR_LT, 2);
ppc_li (code, ins->dreg, 0);
break;
case OP_FCLT_UN:
ppc_li (code, ins->dreg, 0);
break;
case OP_FCGT:
+ case OP_FCLE:
ppc_fcmpo (code, 0, ins->sreg1, ins->sreg2);
ppc_li (code, ins->dreg, 1);
- ppc_bc (code, PPC_BR_TRUE, PPC_BR_GT, 2);
+ ppc_bc (code, ins->opcode == OP_FCGT ? PPC_BR_TRUE : PPC_BR_FALSE, PPC_BR_GT, 2);
ppc_li (code, ins->dreg, 0);
break;
case OP_FCGT_UN:
}
if (!fail_tramp)
- mono_stats.imt_trampolines_size += code - start;
+ UnlockedAdd (&mono_stats.imt_trampolines_size, code - start);
g_assert (code - start <= size);
mono_arch_flush_icache (start, size);
return NULL;
}
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
- return 0;
-}
-
mgreg_t
mono_arch_context_get_int_reg (MonoContext *ctx, int reg)
{
}
}
-
-#if 0
-// FIXME: To get the test case finally_block_ending_in_dead_bb to work properly we need to define the following
-// (in mini-ppc.h) and then implement the fuction mono_arch_create_handler_block_trampoline.
-// #define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
-
-gpointer
-mono_arch_create_handler_block_trampoline (void)
-{
- . . .
-}
-#endif