Revert "PowerPC64 ELFv2 ABI: cases for in-register parameter passing, return values...
authorMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Thu, 20 Nov 2014 02:50:26 +0000 (21:50 -0500)
committerMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Thu, 20 Nov 2014 02:56:54 +0000 (21:56 -0500)
This reverts commit ba62bdf862560a85e2d637a0762d0e4fdd0db8b0.

Reverting as per discussion with Zoltan Varga (see PR 1409 [1]).
Some rework needed.

[1] https://github.com/mono/mono/pull/1409

Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
mono/mini/cpu-ppc64.md
mono/mini/decompose.c
mono/mini/ir-emit.h
mono/mini/method-to-ir.c
mono/mini/mini-ppc.c
mono/mini/mini-ppc.h
mono/mini/mini.h

index bd91b4b88de05ea61376dd7898a89e8f74f4c518..c47c6e25b7b969d0dea0b177efa20c711a780e8a 100644 (file)
@@ -45,7 +45,6 @@
 #
 # See the code in mini-x86.c for more details on how the specifiers are used.
 #
-tailcall: len:120 clob:c
 memory_barrier: len:4
 nop: len:4
 relaxed_nop: len:4
index 30679ad41fc10be0acf5daadb3af494b01a32111..f29e913acf91e5849479f9e12d74514ffa68c1df 100644 (file)
@@ -1225,13 +1225,6 @@ mono_decompose_vtype_opts (MonoCompile *cfg)
                        restart = FALSE;
 
                        for (ins = bb->code; ins; ins = ins->next) {
-
-#ifdef MONO_ARCH_HAVE_DECOMPOSE_VTYPE_OPTS
-                               // Try the architecture specific vtype decomposition first.  If that handles the
-                               // decomposition for this instruction, then nothing more needs to be done here.
-                               if (!mono_arch_decompose_vtype_opts (cfg, ins, bb))
-#endif
-
                                switch (ins->opcode) {
                                case OP_VMOVE: {
                                        src_var = get_vreg_to_inst (cfg, ins->sreg1);
index 8397f88aa544ad90f6c3e6de9fdbc4279cac9838..c208c2a4b1211f5cd77af89b691867639dbcdfc6 100644 (file)
@@ -112,7 +112,6 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type)
         (dest)->flags = 0; \
         (dest)->type = 0; \
         (dest)->dreg = -1;  \
-        (dest)->backend.additional_regs = 0;  \
        MONO_INST_NULLIFY_SREGS ((dest));                   \
         (dest)->cil_code = (cfg)->ip;  \
        } while (0)
index 47d4eac421b80abc09581ce83daec01653c234e6..7a8c4d3f9f88efd5c5a5d0920cbc9d0b0408f267 100755 (executable)
@@ -2554,10 +2554,6 @@ mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig,
                        //g_assert_not_reached ();
                }
        } else if (mini_type_is_vtype (cfg, sig_ret)) {
-               // If the value is being returned via registers we don't need to allocate a temporary variable for it.
-               // Note that this can have effects elsewhere (like with the unbox code) that expects there to be a
-               // variable.
-               if (function_return_value_requires_temporary(sig)) {
                MonoInst *temp = mono_compile_create_var (cfg, sig_ret, OP_LOCAL);
                MonoInst *loada;
 
@@ -2581,10 +2577,6 @@ mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig,
                call->inst.dreg = temp->dreg;
 
                call->vret_var = loada;
-               } else {
-                       // The value will be returned via register so just allocate a dreg for it (just like for simple return types)
-                       call->inst.dreg = alloc_dreg (cfg, call->inst.type);
-               }
        } else if (!MONO_TYPE_IS_VOID (sig_ret))
                call->inst.dreg = alloc_dreg (cfg, call->inst.type);
 
@@ -10136,24 +10128,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                MonoInst *val;
 
                                val = handle_unbox_nullable (cfg, *sp, klass, context_used);
-                               // If there's no instruction associated with the dreg the value is in a register (the else below)
-                               if (get_vreg_to_inst (cfg, val->dreg)) {
                                EMIT_NEW_VARLOADA (cfg, ins, get_vreg_to_inst (cfg, val->dreg), &val->klass->byval_arg);
-                                       *sp++= ins;
-                               } else {
-                                       // The value will be in a register and later code depends on it being stored so
-                                       // 1) allocate a temp
-                                       // 2) store the value (which will be in a register) to the temp
-                                       // 3) load the temp's address
-                                       MonoInst *store;
-                                       MonoInst *temp = mono_compile_create_var (cfg, &klass->byval_arg, OP_LOCAL);
-                                       temp->backend.is_pinvoke = sig->pinvoke;
 
-                                       EMIT_NEW_VARSTORE (cfg, store, temp, &klass->byval_arg, val);
-                                       EMIT_NEW_VARLOADA (cfg, ins, get_vreg_to_inst (cfg, temp->dreg), &klass->byval_arg);
                                *sp++= ins;
-                               }
-
                        } else {
                                ins = handle_unbox (cfg, klass, sp, context_used);
                                *sp++ = ins;
@@ -13471,9 +13448,6 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts)
 
                                if (var->opcode == OP_REGVAR) {
                                        ins->dreg = var->dreg;
-#ifdef MONO_ARCH_RETURN_CAN_USE_MULTIPLE_REGISTERS
-                                       mono_arch_handle_multiple_dregs(bb, cfg, ins, var);
-#endif
                                } else if ((ins->dreg == ins->sreg1) && (spec [MONO_INST_DEST] == 'i') && (spec [MONO_INST_SRC1] == 'i') && !vreg_to_lvreg [ins->dreg] && (op_to_op_dest_membase (store_opcode, ins->opcode) != -1)) {
                                        /* 
                                         * Instead of emitting a load+store, use a _membase opcode.
index 8e634fdf43c8714d20db77ca396cb34f8960520c..594a72e06b10430a1967798a5203bdecf951dbfe 100644 (file)
@@ -867,19 +867,18 @@ enum {
        RegTypeBase,
        RegTypeFP,
        RegTypeStructByVal,
-       RegTypeStructByAddr,
-       RegTypeFPStructByVal,  // For the v2 ABI, floats should be passed in FRs instead of GRs.  Only valid for ABI v2!
+       RegTypeStructByAddr
 };
 
 typedef struct {
        gint32  offset;
        guint32 vtsize; /* in param area */
        guint8  reg;
-       guint8  vtregs; /* number of registers used to pass a RegTypeStructByVal/RegTypeFPStructByVal */
+       guint8  vtregs; /* number of registers used to pass a RegTypeStructByVal */
        guint8  regtype : 4; /* 0 general, 1 basereg, 2 floating point register, see RegType* */
-       guint8  size    : 4; /* 1, 2, 4, 8, or regs used by RegTypeStructByVal/RegTypeFPStructByVal */
+       guint8  size    : 4; /* 1, 2, 4, 8, or regs used by RegTypeStructByVal */
        guint8  bytes   : 4; /* size in bytes - only valid for
-                               RegTypeStructByVal/RegTypeFPStructByVal if the struct fits
+                               RegTypeStructByVal if the struct fits
                                in one word, otherwise it's 0*/
 } ArgInfo;
 
@@ -896,179 +895,6 @@ typedef struct {
 
 #define DEBUG(a)
 
-
-//
-// Test if a structure completely composed of fields that are all floats XOR doubles and that there are fewer than
-// 8 () members.
-// Note: If this is true the structure can be returned directly via registers fr1 through fr8 instead of by a hidden parameter
-// pointing to where the return value should be stored.
-// This is as per the ELF ABI v2.
-//
-#if PPC_RETURN_SMALL_FLOAT_STRUCTS_IN_FR_REGS
-gboolean
-is_float_struct_returnable_via_regs  (MonoClass *klass)
-{
-       gboolean has_a_field = FALSE;
-       int member_cnt = 0;
-       if (klass) {
-               gpointer iter = NULL;
-               MonoClassField *f = 0;
-               MonoClassField *firstMember = &klass->fields [0];
-               if (!firstMember) {
-                       mono_class_setup_fields_locking (klass);
-                       firstMember = &klass->fields [0];
-                       if (!firstMember) {
-                               return FALSE;
-                       }
-               }
-               while ((f = mono_class_get_fields (klass, &iter)) && (member_cnt <= PPC_MOST_FLOAT_STRUCT_MEMBERS_TO_RETURN_VIA_REGISTERS)) {
-                       if (!(f->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                               if (!f->type->byref && mono_metadata_type_equal(firstMember->type, f->type) && (f->type->type == MONO_TYPE_R4 || f->type->type == MONO_TYPE_R8)) {
-                                       has_a_field = TRUE;
-                                       ++member_cnt;
-                               } else
-                                       return FALSE;
-                       }
-               }
-       }
-       return has_a_field && (member_cnt <= PPC_MOST_FLOAT_STRUCT_MEMBERS_TO_RETURN_VIA_REGISTERS);
-}
-#endif
-
-
-//
-// Test if a structure is smaller in size than 2 doublewords (PPC_LARGEST_STRUCT_SIZE_TO_RETURN_VIA_REGISTERS) and is
-// completely composed of fields all of basic types.
-// Note: If this is true the structure can be returned directly via registers r3/r4 instead of by a hidden parameter
-// pointing to where the return value should be stored.
-// This is as per the ELF ABI v2.
-//
-#if PPC_RETURN_SMALL_STRUCTS_IN_REGS
-gboolean
-is_struct_returnable_via_regs  (MonoClass *klass, gboolean is_pinvoke)
-{
-       gboolean has_a_field = FALSE;
-       int size = 0;
-       if (klass) {
-               gpointer iter = NULL;
-               MonoClassField *f;
-               MonoClassField *firstMember = &klass->fields [0];
-               if (!firstMember) {
-                       mono_class_setup_fields_locking (klass);
-                       firstMember = &klass->fields [0];
-                       if (!firstMember) {
-                               return FALSE;
-                       }
-               }
-               if (is_pinvoke)
-                       size = mono_type_native_stack_size (&klass->byval_arg, 0);
-               else
-                       size = mini_type_stack_size (NULL, &klass->byval_arg, 0);
-               if ((size == 0) || (size > PPC_LARGEST_STRUCT_SIZE_TO_RETURN_VIA_REGISTERS))
-                       return FALSE;
-               while ((f = mono_class_get_fields (klass, &iter))) {
-                       if (!(f->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                               // TBD: Is there a better way to check for the basic types?
-                               if (!f->type->byref && (f->type->type >= MONO_TYPE_BOOLEAN) && (f->type->type <= MONO_TYPE_R8)) {
-                                       has_a_field = TRUE;
-                               } else
-                                       return FALSE;
-                       }
-               }
-       }
-       return has_a_field;
-}
-#endif
-
-gint
-member_count  (MonoClass *klass)
-{
-       gint field_cnt = 0;
-       if (klass) {
-               gpointer iter = NULL;
-               MonoClassField *f;
-               while ((f = mono_class_get_fields (klass, &iter))) {
-                       if (!(f->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                               ++field_cnt;
-                       }
-               }
-       }
-       return field_cnt;
-}
-
-gint
-float_member_size  (MonoClass *klass)
-{
-       if (klass) {
-               MonoClassField *firstMember = &klass->fields [0];
-               g_assert (firstMember);
-               // The class is homogenous so the first member will be the same as all the members
-               if (firstMember->type->type == MONO_TYPE_R4)
-                       return 4;
-               else if (firstMember->type->type == MONO_TYPE_R8)
-                       return 8;
-               else
-                       // Floats should always be 4 or 8 bytes
-                       g_assert_not_reached ();
-       }
-
-       return 0;
-}
-
-
-#if PPC_RETURN_SMALL_STRUCTS_IN_REGS
-// If the value is being returned via registers we don't need to allocate a temporary variable for it.
-// Note that this can have effects elsewhere (like with the unbox code) that expects there to be a
-// variable.
-gboolean
-function_return_value_requires_temporary (MonoMethodSignature *sig) {
-       MonoType *sig_ret = mini_replace_type (sig->ret);
-       gboolean is_all_floats = is_float_struct_returnable_via_regs(mono_class_from_mono_type (sig_ret));
-       gboolean is_returnable_via_regs = is_struct_returnable_via_regs(mono_class_from_mono_type (sig_ret), sig->pinvoke);
-       DEBUG_ELFABIV2_printf("return_value_requires_temporary: sig_ret: FL? %d  non-FL? %d  ", (int)is_all_floats, (int)is_returnable_via_regs);    DEBUG_ELFABIV2_mono_print_klass(mono_class_from_mono_type (sig_ret));
-
-       return (!is_all_floats && !is_returnable_via_regs);
-}
-#endif
-
-
-#ifdef MONO_ARCH_RETURN_CAN_USE_MULTIPLE_REGISTERS
-void
-mono_arch_handle_multiple_dregs(MonoBasicBlock *bb, MonoCompile *cfg, MonoInst *ins, MonoInst *var) {
-       if (ins->opcode == OP_LOAD_MEMBASE &&
-                       var->backend.additional_regs) {
-               MonoInst *tmp = 0;
-               DEBUG_ELFABIV2_printf("mono_spill_global_vars Existing non-float load: "); DEBUG_ELFABIV2_mono_print_ins(ins);
-               DEBUG_ELFABIV2_printf("                               klass: "); DEBUG_ELFABIV2_mono_print_klass(var->klass);
-               MONO_INST_NEW (cfg, tmp, OP_LOAD_MEMBASE);
-               *tmp = *ins;
-               tmp->dreg += 1;
-               tmp->inst_offset += 8; // FIXME: use a proper constant here
-               mono_bblock_insert_after_ins (bb, ins, tmp);
-               DEBUG_ELFABIV2_printf("                             Adding new load: "); DEBUG_ELFABIV2_mono_print_ins(tmp);
-       } else if (((ins->opcode == OP_LOADR4_MEMBASE) || (ins->opcode == OP_LOADR8_MEMBASE)) &&
-                                       var->backend.additional_regs) {
-               // Return small (<= 8 member) structures entirely made up of either float or double members
-               // in FR registers.
-               MonoInst *tmp = 0;
-               int cnt = 0;
-               int mbr_cnt = member_count(var->klass);
-               int mbr_size = float_member_size(var->klass);
-               DEBUG_ELFABIV2_printf("mono_spill_global_vars Existing float/double load: "); DEBUG_ELFABIV2_mono_print_ins(ins);
-               DEBUG_ELFABIV2_printf("                               klass: "); DEBUG_ELFABIV2_mono_print_klass(var->klass);
-               for (cnt=0; cnt < mbr_cnt; ++cnt) {
-                       MONO_INST_NEW (cfg, tmp, OP_LOAD_MEMBASE);
-                       *tmp = *ins;
-                       tmp->dreg += 1;
-                       tmp->inst_offset += mbr_size;
-                       mono_bblock_insert_after_ins (bb, ins, tmp);
-                       DEBUG_ELFABIV2_printf("        Adding new load: "); DEBUG_ELFABIV2_mono_print_ins(tmp);
-               } // for
-       } // else if
-}
-#endif
-
-
 static void inline
 add_general (guint *gr, guint *stack_size, ArgInfo *ainfo, gboolean simple)
 {
@@ -1108,7 +934,7 @@ add_general (guint *gr, guint *stack_size, ArgInfo *ainfo, gboolean simple)
        (*gr) ++;
 }
 
-#if defined(__APPLE__) || (defined(__mono_ppc64__) && !PPC_PASS_SMALL_FLOAT_STRUCTS_IN_FR_REGS)
+#if defined(__APPLE__) || defined(__mono_ppc64__)
 static gboolean
 has_only_a_r48_field (MonoClass *klass)
 {
@@ -1139,25 +965,14 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
        guint32 stack_size = 0;
        CallInfo *cinfo = g_malloc0 (sizeof (CallInfo) + sizeof (ArgInfo) * n);
        gboolean is_pinvoke = sig->pinvoke;
-       gboolean is_struct = MONO_TYPE_ISSTRUCT (sig->ret);
-       MonoClass *klass = mono_class_from_mono_type (sig->ret);
-       gboolean is_all_floats = FALSE;
-       gboolean is_returnable_via_regs = FALSE;
 
        fr = PPC_FIRST_FPARG_REG;
        gr = PPC_FIRST_ARG_REG;
 
-       // Handle returning small structs via registers
-       // This is active for two cases:
-       //  1) All-float (or double) member structs with 8 or fewer members
-       //       2) Other structures smaller than 16 bytes
-       if (is_struct) {
-               is_all_floats = is_float_struct_returnable_via_regs(klass);
-               is_returnable_via_regs = is_struct_returnable_via_regs(klass, sig->pinvoke);
-               if (!is_all_floats && !is_returnable_via_regs) {
+       /* FIXME: handle returning a struct */
+       if (MONO_TYPE_ISSTRUCT (sig->ret)) {
                cinfo->vtype_retaddr = TRUE;
        }
-       }
 
        pstart = 0;
        n = 0;
@@ -1168,7 +983,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
         * are sometimes made using calli without sig->hasthis set, like in the delegate
         * invoke wrappers.
         */
-       if (is_struct && !is_pinvoke && (sig->hasthis || (sig->param_count > 0 && MONO_TYPE_IS_REFERENCE (mini_type_get_underlying_type (gsctx, sig->params [0]))))) {
+       if (cinfo->vtype_retaddr && !is_pinvoke && (sig->hasthis || (sig->param_count > 0 && MONO_TYPE_IS_REFERENCE (mini_type_get_underlying_type (gsctx, sig->params [0]))))) {
                if (sig->hasthis) {
                        add_general (&gr, &stack_size, cinfo->args + 0, TRUE);
                        n ++;
@@ -1177,13 +992,9 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
                        pstart = 1;
                        n ++;
                }
-               if (!is_all_floats && !is_returnable_via_regs) {
                add_general (&gr, &stack_size, &cinfo->ret, TRUE);
                cinfo->struct_ret = cinfo->ret.reg;
                cinfo->vret_arg_index = 1;
-       } else {
-                       cinfo->struct_ret = -1;  // Just a flag for later
-               }
        } else {
                /* this */
                if (sig->hasthis) {
@@ -1191,13 +1002,9 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
                        n ++;
                }
 
-               if (is_struct) {
-                       if (!is_all_floats && !is_returnable_via_regs) {
+               if (cinfo->vtype_retaddr) {
                        add_general (&gr, &stack_size, &cinfo->ret, TRUE);
                        cinfo->struct_ret = cinfo->ret.reg;
-                       } else {
-                               cinfo->struct_ret = -1;  // Just a flag for later
-                       }
                }
        }
 
@@ -1264,7 +1071,9 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
                case MONO_TYPE_VALUETYPE:
                case MONO_TYPE_TYPEDBYREF: {
                        gint size;
-                       MonoClass *klass = mono_class_from_mono_type (sig->params [i]);
+                       MonoClass *klass;
+
+                       klass = mono_class_from_mono_type (sig->params [i]);
                        if (simpletype->type == MONO_TYPE_TYPEDBYREF)
                                size = sizeof (MonoTypedRef);
                        else if (is_pinvoke)
@@ -1272,7 +1081,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
                        else
                            size = mono_class_value_size (klass, NULL);
 
-#if defined(__APPLE__) || (defined(__mono_ppc64__) && !PPC_PASS_SMALL_FLOAT_STRUCTS_IN_FR_REGS)
+#if defined(__APPLE__) || defined(__mono_ppc64__)
                        if ((size == 4 || size == 8) && has_only_a_r48_field (klass)) {
                                cinfo->args [n].size = size;
 
@@ -1302,42 +1111,9 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
                        {
                                int align_size = size;
                                int nregs = 0;
-                               int rest = 0;
-                               int n_in_regs = 0;
-                               int mbr_cnt = member_count (klass);
-                               gboolean is_all_floats = is_float_struct_returnable_via_regs(klass);
-
-                               if (!is_all_floats) {
-                                       rest = PPC_LAST_ARG_REG - gr + 1;
-                               } else {
-                                       rest = PPC_LAST_FPARG_REG - fr + 1;
-                               }
+                               int rest = PPC_LAST_ARG_REG - gr + 1;
+                               int n_in_regs;
 
-#if PPC_PASS_SMALL_FLOAT_STRUCTS_IN_FR_REGS
-                               // Pass small (<= 8 member) structures entirely made up of either float or double members
-                               // in FR registers.  There have to be at least mbr_cnt registers left.
-                               if (is_all_floats &&
-                                        (rest >= mbr_cnt) &&
-                                        (mbr_cnt <= 8)) {
-                                       int mbr_size = float_member_size(klass);
-                                       nregs = mbr_cnt; // size / memberSize;
-                                       n_in_regs = MIN (rest, nregs);
-                                       cinfo->args [n].regtype = RegTypeFPStructByVal;
-                                       cinfo->args [n].vtregs = n_in_regs;
-                                       cinfo->args [n].size = mbr_size;
-                                       cinfo->args [n].vtsize = nregs - n_in_regs;
-                                       cinfo->args [n].reg = fr;
-                                       fr += n_in_regs;
-                                       if (mbr_size == 4) {
-                                               // floats
-                                               FP_ALSO_IN_REG (gr += (n_in_regs+1)/2);
-                                       } else {
-                                               // doubles
-                                               FP_ALSO_IN_REG (gr += (n_in_regs));
-                                       }
-                               } else
-#endif
-                               {
                                align_size += (sizeof (gpointer) - 1);
                                align_size &= ~(sizeof (gpointer) - 1);
                                nregs = (align_size + sizeof (gpointer) -1 ) / sizeof (gpointer);
@@ -1354,8 +1130,6 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
                                cinfo->args [n].size = n_in_regs;
                                cinfo->args [n].vtsize = nregs - n_in_regs;
                                cinfo->args [n].reg = gr;
-                                       gr += n_in_regs;
-                               }
 
 #ifdef __mono_ppc64__
                                if (nregs == 1 && is_pinvoke)
@@ -1363,6 +1137,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
                                else
 #endif
                                        cinfo->args [n].bytes = 0;
+                               gr += n_in_regs;
                                cinfo->args [n].offset = PPC_STACK_PARAM_OFFSET + stack_size;
                                /*g_print ("offset for arg %d at %d\n", n, PPC_STACK_PARAM_OFFSET + stack_size);*/
                                stack_size += nregs * sizeof (gpointer);
@@ -1385,12 +1160,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
                        cinfo->args [n].size = 4;
 
                        /* It was 7, now it is 8 in LinuxPPC */
-                       if (fr <= PPC_LAST_FPARG_REG
-#if (_CALL_ELF == 2)
-                       // For non-native vararg calls the parms must go in storage
-                                && !(!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG))
-#endif
-                               ) {
+                       if (fr <= PPC_LAST_FPARG_REG) {
                                cinfo->args [n].regtype = RegTypeFP;
                                cinfo->args [n].reg = fr;
                                fr ++;
@@ -1407,12 +1177,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig)
                case MONO_TYPE_R8:
                        cinfo->args [n].size = 8;
                        /* It was 7, now it is 8 in LinuxPPC */
-                       if (fr <= PPC_LAST_FPARG_REG
-#if (_CALL_ELF == 2)
-                       // For non-native vararg calls the parms must go in storage
-                                && !(!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG))
-#endif
-                                ) {
+                       if (fr <= PPC_LAST_FPARG_REG) {
                                cinfo->args [n].regtype = RegTypeFP;
                                cinfo->args [n].reg = fr;
                                fr ++;
@@ -1580,34 +1345,8 @@ mono_arch_allocate_vars (MonoCompile *m)
        offset = 0;
        curinst = 0;
        if (MONO_TYPE_ISSTRUCT (sig->ret)) {
-               int size=0;
-               MonoClass *klass = mono_class_from_mono_type (sig->ret);
-               gboolean is_all_floats = is_float_struct_returnable_via_regs(klass);
-               gboolean is_returnable_via_regs = is_struct_returnable_via_regs(klass, sig->pinvoke);
-
-               m->ret->backend.additional_regs = 0;
                m->ret->opcode = OP_REGVAR;
-               if (!is_all_floats) {
                m->ret->inst_c0 = m->ret->dreg = ppc_r3;
-                       DEBUG_ELFABIV2_printf("Changed m->ret->dreg to ppc_r3: "); DEBUG_ELFABIV2_mono_print_ins(m->ret);
-                       if (is_returnable_via_regs) {
-                               if (sig->pinvoke)
-                                       size = mono_type_native_stack_size (sig->ret, 0);
-                               else
-                                       size = mini_type_stack_size (NULL, sig->ret, 0);
-                               if (size > 8) {  // FIXME: replace "8" with proper constant
-                                       m->ret->backend.additional_regs = 1;
-                                       DEBUG_ELFABIV2_printf(" and added ppc_r4 for non-floats (later): "); DEBUG_ELFABIV2_mono_print_ins(m->ret);
-                               }
-                       }
-               } else {  // is_all_floats
-                       int mbr_cnt = member_count(klass);
-                       m->ret->inst_c0 = m->ret->dreg = ppc_f1;
-                       DEBUG_ELFABIV2_printf("Changed m->ret->dreg to ppc_f1: "); DEBUG_ELFABIV2_mono_print_ins(m->ret);
-                       if (mbr_cnt > 1) {
-                               m->ret->backend.additional_regs = 1;
-                       }
-               }
        } else {
                /* FIXME: handle long values? */
                switch (mini_type_get_underlying_type (m->generic_sharing_context, sig->ret)->type) {
@@ -1659,13 +1398,6 @@ mono_arch_allocate_vars (MonoCompile *m)
 #endif
 
        if (MONO_TYPE_ISSTRUCT (sig->ret)) {
-               // The return value for a structure may either be returned via address or via registers depending on its size
-               MonoClass *klass = mono_class_from_mono_type (sig->ret);
-               gboolean is_all_floats = is_float_struct_returnable_via_regs(klass);
-               gboolean is_returnable_via_regs = is_struct_returnable_via_regs(klass, sig->pinvoke);
-
-               if (!is_all_floats && !is_returnable_via_regs) {
-                       // function value will be returned indirectly
                offset += sizeof(gpointer) - 1;
                offset &= ~(sizeof(gpointer) - 1);
 
@@ -1680,11 +1412,6 @@ mono_arch_allocate_vars (MonoCompile *m)
 
                offset += sizeof(gpointer);
        }
-               else {
-                       // function return value will be returned via registers
-                       // Anything to do here?
-               }
-       }
 
        offsets = mono_allocate_stack_slots (m, FALSE, &locals_stack_size, &locals_stack_align);
        if (locals_stack_align) {
@@ -1772,17 +1499,10 @@ mono_arch_create_vars (MonoCompile *cfg)
 {
        MonoMethodSignature *sig = mono_method_signature (cfg->method);
 
-       // The return value for a structure may either be returned via address or via registers depending on its size
        if (MONO_TYPE_ISSTRUCT (sig->ret)) {
-               MonoClass *klass = mono_class_from_mono_type (sig->ret);
-               gboolean is_all_floats = is_float_struct_returnable_via_regs(klass);
-               gboolean is_returnable_via_regs = is_struct_returnable_via_regs(klass, sig->pinvoke);
-
-               if (!is_all_floats && !is_returnable_via_regs) {
                cfg->vret_addr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_ARG);
        }
 }
-}
 
 /* Fixme: we need an alignment solution for enter_method and mono_arch_call_opcode,
  * currently alignment in mono_arch_call_opcode is computed without arch_get_argument_info 
@@ -1872,17 +1592,6 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
                        ins->inst_p1 = mono_mempool_alloc (cfg->mempool, sizeof (ArgInfo));
                        memcpy (ins->inst_p1, ainfo, sizeof (ArgInfo));
                        MONO_ADD_INS (cfg->cbb, ins);
-               } else if (ainfo->regtype == RegTypeFPStructByVal) {
-                       /* this is further handled in mono_arch_emit_outarg_vt () */
-                       MONO_INST_NEW (cfg, ins, OP_OUTARG_VT);
-                       ins->opcode = OP_OUTARG_VT;
-                       ins->sreg1 = in->dreg;
-                       ins->klass = in->klass;
-                       ins->inst_p0 = call;
-                       ins->inst_p1 = mono_mempool_alloc (cfg->mempool, sizeof (ArgInfo));
-                       memcpy (ins->inst_p1, ainfo, sizeof (ArgInfo));
-                       MONO_ADD_INS (cfg->cbb, ins);
-                       cfg->flags |= MONO_CFG_HAS_FPOUT;
                } else if (ainfo->regtype == RegTypeBase) {
                        if (!t->byref && ((t->type == MONO_TYPE_I8) || (t->type == MONO_TYPE_U8))) {
                                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI8_MEMBASE_REG, ppc_r1, ainfo->offset, in->dreg);
@@ -1933,14 +1642,6 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
                emit_sig_cookie (cfg, call, cinfo);
 
        if (cinfo->struct_ret) {
-               // Handle returning small structs via registers
-               // This is active for two cases:
-               //  1) All-float (or double) member structs with 8 or fewer members
-               //       2) Other non-float structures 16 bytes or smaller
-               gboolean is_all_floats = is_float_struct_returnable_via_regs(((MonoInst*)call)->klass);  // Also verifies <= 8 members
-               gboolean is_returnable_via_regs = is_struct_returnable_via_regs(((MonoInst*)call)->klass, sig->pinvoke);  // Also verifies <= 8 members
-
-               if (!is_all_floats && !is_returnable_via_regs) {
                MonoInst *vtarg;
 
                MONO_INST_NEW (cfg, vtarg, OP_MOVE);
@@ -1949,11 +1650,6 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
                MONO_ADD_INS (cfg->cbb, vtarg);
 
                mono_call_inst_add_outarg_reg (cfg, call, vtarg->dreg, cinfo->struct_ret, FALSE);
-               } else {
-                       // structure will be returned via registers
-                       DEBUG_ELFABIV2_printf("mono_arch_emit_call call->vret_in_reg = TRUE!  for "); DEBUG_ELFABIV2_mono_print_ins((MonoInst*)call);
-                       call->vret_in_reg = TRUE;
-               }
        }
 
        call->stack_usage = cinfo->stack_usage;
@@ -1999,36 +1695,20 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src)
                } else
 #endif
                        for (i = 0; i < ainfo->vtregs; ++i) {
+                               int antipadding = 0;
+                               if (ainfo->bytes) {
+                                       g_assert (i == 0);
+                                       antipadding = sizeof (gpointer) - ainfo->bytes;
+                               }
                                dreg = mono_alloc_ireg (cfg);
-                               if (ainfo->bytes && mono_class_native_size (ins->klass, NULL) == 1) {
-                                       MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU1_MEMBASE, dreg, src->dreg, soffset);
-                               } else if (ainfo->bytes && mono_class_native_size (ins->klass, NULL) == 2) {
-                                 MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU2_MEMBASE, dreg, src->dreg, soffset);
-                               } else if (ainfo->bytes && mono_class_native_size (ins->klass, NULL) == 4) { // FIXME -- Maybe <= 4?
-                                 MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU4_MEMBASE, dreg, src->dreg, soffset);
-                               } else {
                                MONO_EMIT_NEW_LOAD_MEMBASE (cfg, dreg, src->dreg, soffset);
-                               }
+                               if (antipadding)
+                                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SHR_UN_IMM, dreg, dreg, antipadding * 8);
                                mono_call_inst_add_outarg_reg (cfg, call, dreg, ainfo->reg + i, FALSE);
                                soffset += sizeof (gpointer);
                        }
                if (ovf_size != 0)
                        mini_emit_memcpy (cfg, ppc_r1, doffset + soffset, src->dreg, soffset, ovf_size * sizeof (gpointer), 0);
-       } else if (ainfo->regtype == RegTypeFPStructByVal) {
-               soffset = 0;
-               for (i = 0; i < ainfo->vtregs; ++i) {
-                       int tmpr = mono_alloc_freg (cfg);
-                       if (ainfo->size == 4)
-                               MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADR4_MEMBASE, tmpr, src->dreg, soffset);
-                       else // ==8
-                               MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADR8_MEMBASE, tmpr, src->dreg, soffset);
-                       dreg = mono_alloc_freg (cfg);
-                       MONO_EMIT_NEW_UNALU (cfg, OP_FMOVE, dreg, tmpr);
-                       mono_call_inst_add_outarg_reg (cfg, call, dreg, ainfo->reg+i, TRUE);
-                       soffset += ainfo->size;
-               }
-               if (ovf_size != 0)
-                       mini_emit_memcpy (cfg, ppc_r1, doffset + soffset, src->dreg, soffset, ovf_size * sizeof (gpointer), 0);
        } else if (ainfo->regtype == RegTypeFP) {
                int tmpr = mono_alloc_freg (cfg);
                if (ainfo->size == 4)
@@ -2199,7 +1879,6 @@ mono_arch_instrument_epilog_full (MonoCompile *cfg, void *func, void *p, gboolea
                if (enable_arguments) {
                        /* FIXME: get the actual address  */
                        ppc_mr (code, ppc_r4, ppc_r3);
-                       // FIXME: Support the new v2 ABI!
                }
                break;
        case SAVE_NONE:
@@ -2463,390 +2142,16 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb)
        bb->last_ins = last_ins;
 }
 
-
-#ifdef MONO_ARCH_HAVE_DECOMPOSE_VTYPE_OPTS
-gboolean
-mono_arch_decompose_vtype_opts (MonoCompile *cfg, MonoInst *ins, MonoBasicBlock *bb)
-{
-       MonoInst *dest_var=0, *src=0, *dest=0;
-       gboolean is_all_floats = FALSE;
-       gboolean is_returnable_via_regs = FALSE;
-       int mbr_size = 0;
-       int mbr_cnt = 0;
-       int return_value_size = 0;
-
-       switch (ins->opcode) {
-               case OP_VMOVE: {
-                       MonoInst *src_var=0;
-                       // For now this code only handles small structures returned from functions.  Everything else is handled by the "generic" code.
-                       MonoMethodSignature *sig = mono_method_signature (cfg->method);
-                       if (!MONO_TYPE_ISSTRUCT (sig->ret)) {
-                               return FALSE;
-                       }
-
-                       is_all_floats = is_float_struct_returnable_via_regs(ins->klass);
-                       is_returnable_via_regs = is_struct_returnable_via_regs(ins->klass, sig->pinvoke);
-
-                       if (!is_all_floats && !is_returnable_via_regs) {
-                               return FALSE;
-                       }
-
-                       DEBUG_ELFABIV2_printf("mono_arch_decompose_vtype_opts OP_VMOVE, ins->dreg: %d, ins->klass: ", (int)ins->dreg); DEBUG_ELFABIV2_mono_print_klass(ins->klass);
-
-                       src_var = get_vreg_to_inst (cfg, ins->sreg1);
-                       if (!src_var) {
-                               src_var = mono_compile_create_var_for_vreg (cfg, &ins->klass->byval_arg, OP_LOCAL, ins->dreg);
-                       }
-
-                       dest_var = get_vreg_to_inst (cfg, ins->dreg);
-                       if (!dest_var) {
-                               dest_var = mono_compile_create_var_for_vreg (cfg, &ins->klass->byval_arg, OP_LOCAL, ins->dreg);
-                       }
-                       DEBUG_ELFABIV2_printf("   src_var: "); DEBUG_ELFABIV2_mono_print_ins(src_var);
-                       DEBUG_ELFABIV2_printf("  dest_var: "); DEBUG_ELFABIV2_mono_print_ins(dest_var);
-                       DEBUG_ELFABIV2_printf("  cfg->ret: "); if (is_all_floats) DEBUG_ELFABIV2_printf("all_floats ");DEBUG_ELFABIV2_mono_print_ins(cfg->ret);
-                       DEBUG_ELFABIV2_printf("       ins: "); DEBUG_ELFABIV2_mono_print_ins(ins);
-                       if (!src_var || !dest_var || (dest_var != cfg->ret)) {
-                               return FALSE;
-                       }
-
-                       g_assert (ins->klass);
-                       DEBUG_ELFABIV2_printf("Converting OP_VMOVE for returning value via registers\n");
-
-                       // FIXME:
-                       if (src_var->backend.is_pinvoke)
-                               dest_var->backend.is_pinvoke = 1;
-
-                       // return of structure via registers
-                       g_assert(src_var->klass);
-                       if (is_all_floats) {
-                               // Pass small (<= 8 member) structures entirely made up of either float or double members
-                               // in FR registers.  There have to be at least 8 registers left.
-                               mbr_cnt = member_count(ins->klass);
-                               mbr_size = float_member_size(ins->klass);
-                               DEBUG_ELFABIV2_printf("is_float_struct_returnable_via_regs with length %d, %d members, member size %d\n", return_value_size, mbr_cnt, mbr_size);
-                               if (mbr_size == 4) {
-                                       EMIT_NEW_VARLOADA ((cfg), (src), src_var, src_var->inst_vtype);
-                                       MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADR4_MEMBASE, ins->dreg, src->dreg, 0);
-                               } else {
-                                       EMIT_NEW_VARLOADA ((cfg), (src), src_var, src_var->inst_vtype);
-                                       MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADR8_MEMBASE, ins->dreg, src->dreg, 0);
-                               } // else
-                       } else {
-                               // Not a homogenous float structure
-                               if (sig->pinvoke)
-                                       return_value_size = mono_type_native_stack_size (sig->ret, 0);
-                               else
-                                       return_value_size = mini_type_stack_size (NULL, sig->ret, 0);
-                               DEBUG_ELFABIV2_printf("is_struct_returnable_via_regs with length %d\n", return_value_size);
-                               g_assert(is_returnable_via_regs);
-                               EMIT_NEW_VARLOADA ((cfg), (src), src_var, src_var->inst_vtype);
-                               MONO_EMIT_NEW_LOAD_MEMBASE (cfg, ins->dreg, src->dreg, 0);
-                       } // else
-                       return TRUE;
-                       break;
-               } // case OP_VMOVE
-               case OP_VZERO: {
-                       int return_value_size = 0;
-
-                       // For now this code only handles small structures returned from functions.  Everything else is handled by the "generic" code.
-                       MonoMethodSignature *sig = mono_method_signature (cfg->method);
-                       if (!MONO_TYPE_ISSTRUCT (sig->ret)) {
-                               return FALSE;
-                       }
-                       if (sig->pinvoke)
-                               return_value_size = mono_type_native_stack_size (sig->ret, 0);
-                       else
-                               return_value_size = mini_type_stack_size (NULL, sig->ret, 0);
-                       is_all_floats = is_float_struct_returnable_via_regs(ins->klass);
-                       is_returnable_via_regs = is_struct_returnable_via_regs(ins->klass, sig->pinvoke);
-
-                       if (!is_all_floats && !is_returnable_via_regs) {
-                               return FALSE;
-                       }
-                       if (is_all_floats) {
-                               mbr_cnt = member_count(ins->klass);
-                               mbr_size = float_member_size(ins->klass);
-                       }
-                       DEBUG_ELFABIV2_printf("mono_arch_decompose_vtype_opts OP_VZERO\n");
-
-                       dest_var = get_vreg_to_inst (cfg, ins->dreg);
-                       if (!dest_var) {
-                               dest_var = mono_compile_create_var_for_vreg (cfg, &ins->klass->byval_arg, OP_LOCAL, ins->dreg);
-                               DEBUG_ELFABIV2_printf("TMP creating dest_var\n");
-                       }
-                       if (!dest_var || (dest_var != cfg->ret)) {
-                               return FALSE;
-                       }
-                       DEBUG_ELFABIV2_printf("OP_VZERO of return value!\n");
-                       DEBUG_ELFABIV2_printf("ins "); DEBUG_ELFABIV2_mono_print_ins(ins);
-                       DEBUG_ELFABIV2_printf("cfg->ret "); DEBUG_ELFABIV2_mono_print_ins(cfg->ret);
-                       DEBUG_ELFABIV2_printf("dest_var "); DEBUG_ELFABIV2_mono_print_ins(dest_var);
-                       // The destination will become a REGVAR
-                       if (SIZEOF_REGISTER == 8)
-                               MONO_EMIT_NEW_I8CONST (cfg, dest_var->dreg, 0);
-                       else
-                               MONO_EMIT_NEW_ICONST (cfg, dest_var->dreg, 0);
-                       if (return_value_size == 16) {
-                               // FIXME: Potential problem here?
-                               if (SIZEOF_REGISTER == 8)
-                                       MONO_EMIT_NEW_I8CONST (cfg, dest_var->dreg+1, 0);
-                               else
-                                       MONO_EMIT_NEW_ICONST (cfg, dest_var->dreg+1, 0);
-                       } // if
-
-                       if (cfg->compute_gc_maps) {
-                               MonoInst *tmp;
-
-                               /*
-                                * Tell the GC map code that the vtype is considered live after
-                                * the initialization.
-                                */
-                               MONO_INST_NEW (cfg, tmp, OP_GC_LIVENESS_DEF);
-                               tmp->inst_c1 = ins->dreg;
-                               MONO_ADD_INS (cfg->cbb, tmp);
-                       }
-                       return TRUE;
-                       break;
-               }
-               case OP_LOADV_MEMBASE: {
-                       int return_value_size = 0;
-                       MonoInst *temp;
-                       int dreg;
-
-                       // For now this code only handles small structures returned from functions.  Everything else is handled by the "generic" code.
-                       MonoMethodSignature *sig = mono_method_signature (cfg->method);
-                       if (!MONO_TYPE_ISSTRUCT (sig->ret)) {
-                               return FALSE;
-                       }
-
-                       dest_var = get_vreg_to_inst (cfg, ins->dreg);
-                       if (!dest_var) {
-                               dest_var = mono_compile_create_var_for_vreg (cfg, &ins->klass->byval_arg, OP_LOCAL, ins->dreg);
-                       }
-                       if (! dest_var || (dest_var != cfg->ret)) {
-                               return FALSE;
-                       }
-                       if (sig->pinvoke)
-                               return_value_size = mono_type_native_stack_size (sig->ret, 0);
-                       else
-                               return_value_size = mini_type_stack_size (NULL, sig->ret, 0);
-                       is_all_floats = is_float_struct_returnable_via_regs(ins->klass);
-                       is_returnable_via_regs = is_struct_returnable_via_regs(ins->klass, sig->pinvoke);
-
-                       if (!is_all_floats && !is_returnable_via_regs) {
-                               return FALSE;
-                       }
-                       DEBUG_ELFABIV2_printf("mono_arch_decompose_vtype_opts DS OP_LOADV_MEMBASE ins: "); DEBUG_ELFABIV2_mono_print_ins(ins);
-
-                       // Allocate a temp to hold the value we will be returning
-                       temp = mono_compile_create_var (cfg, &dest_var->klass->byval_arg, OP_LOCAL);
-                       dreg = alloc_preg (cfg);
-                       temp->backend.is_pinvoke = dest_var->backend.is_pinvoke;
-                       DEBUG_ELFABIV2_printf("    temp: "); DEBUG_ELFABIV2_mono_print_ins(temp);
-                       dest_var = get_vreg_to_inst (cfg, temp->dreg);
-                       if (!dest_var) {
-                               dest_var = mono_compile_create_var_for_vreg (cfg, &temp->klass->byval_arg, OP_LOCAL, temp->dreg);
-                       }
-
-                       // This is a very clumsy way of handling this.  See if this can be done in a better way.
-
-                       // Store the value being returned in the temp
-                       EMIT_NEW_BIALU_IMM (cfg, src, OP_ADD_IMM, dreg, ins->inst_basereg, ins->inst_offset);
-                       EMIT_NEW_VARLOADA (cfg, dest, dest_var, dest_var->inst_vtype);
-                       mini_emit_stobj (cfg, dest, src, dest_var->klass, dest_var->backend.is_pinvoke);
-
-                       if (is_all_floats) {
-                               mbr_cnt = member_count(ins->klass);
-                               mbr_size = float_member_size(ins->klass);
-                               if (mbr_size == 4) {
-                                       MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADR4_MEMBASE, ins->dreg, dest->dreg, 0);
-                               } else {
-                                       MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADR8_MEMBASE, ins->dreg, dest->dreg, 0);
-                               }
-                       } else {
-                               // Load the temp for the return via register(s)
-                               MONO_EMIT_NEW_LOAD_MEMBASE (cfg, ins->dreg, dest->dreg, 0);
-                       } // else
-                       return TRUE;
-                       break;
-               }
-               case OP_VCALL:
-               case OP_VCALL_REG:
-               case OP_VCALL_MEMBASE: {
-                       MonoCallInst *call = (MonoCallInst*)ins;
-                       MonoCallInst *call2 = 0;
-                       int return_value_size = 0;
-                       DEBUG_ELFABIV2_printf("mono_arch_decompose_vtype_opts OP_VCALL   vret_in_reg: %d, ins: ", call->vret_in_reg);   DEBUG_ELFABIV2_mono_print_ins(ins);
-                       DEBUG_ELFABIV2_printf("    ins->klass: "); DEBUG_ELFABIV2_mono_print_klass(ins->klass);
-
-                       if (!call->vret_in_reg) {
-                               DEBUG_ELFABIV2_printf("    !call->vret_in_reg\n");
-                               return FALSE;
-                       }
-
-                       /* Compute the vtype location */
-                       dest_var = get_vreg_to_inst (cfg, call->inst.dreg);
-                       if (!dest_var)
-                               dest_var = mono_compile_create_var_for_vreg (cfg, call->signature->ret, OP_LOCAL, call->inst.dreg);
-                       if (!dest_var || (!MONO_TYPE_ISSTRUCT(dest_var->inst_vtype))) {
-                               DEBUG_ELFABIV2_printf("    !dest_var || (!MONO_TYPE_ISSTRUCT(dest_var->inst_vtype))\n");
-                               return FALSE;
-                       }
-
-                       if (dest_var->backend.is_pinvoke)
-                               return_value_size = mono_class_native_size (mono_class_from_mono_type (dest_var->inst_vtype), NULL);
-                       else
-                               return_value_size = mono_type_size (dest_var->inst_vtype, NULL);
-                       is_all_floats = is_float_struct_returnable_via_regs(dest_var->klass);
-                       is_returnable_via_regs = is_struct_returnable_via_regs(dest_var->klass, dest_var->backend.is_pinvoke);
-
-                       if (!is_all_floats && !is_returnable_via_regs) {
-                               DEBUG_ELFABIV2_printf("    (!is_all_floats && !is_returnable_via_regs)\n");
-                               return FALSE;
-                       }
-
-                       DEBUG_ELFABIV2_printf("   dest_var: "); DEBUG_ELFABIV2_mono_print_ins(dest_var);
-                       /* Replace the vcall with an integer call */
-                       MONO_INST_NEW_CALL (cfg, call2, OP_NOP);
-                       memcpy (call2, call, sizeof (MonoCallInst));
-                       switch (ins->opcode) {
-                       case OP_VCALL:
-                               call2->inst.opcode = OP_CALL;
-                               break;
-                       case OP_VCALL_REG:
-                               call2->inst.opcode = OP_CALL_REG;
-                               break;
-                       case OP_VCALL_MEMBASE:
-                               call2->inst.opcode = OP_CALL_MEMBASE;
-                               break;
-                       }
-                       // Note:  mono_arch_allocate_vars in ppc-mini.c will set this to ppc_r3
-                       call2->inst.dreg = alloc_preg (cfg); //ppc_r3; //-1; //alloc_preg (cfg);
-                       MONO_ADD_INS (cfg->cbb, ((MonoInst*)call2));
-
-                       DEBUG_ELFABIV2_printf("   call: "); DEBUG_ELFABIV2_mono_print_ins((MonoInst*)call);
-                       DEBUG_ELFABIV2_printf("   call2: "); DEBUG_ELFABIV2_mono_print_ins((MonoInst*)call2);
-                       DEBUG_ELFABIV2_printf("   cfg->ret: "); DEBUG_ELFABIV2_mono_print_ins(cfg->ret);
-                       // If the dest_var of this call is the return var of this (the calling) function we do not need to store
-                       // the returned value because it will be returned via the same registers.
-                       if (dest_var == cfg->ret) {
-                               DEBUG_ELFABIV2_printf("returning function value directly (already in the right registers from call on return)\n");
-                       } else {
-                               if ((ins->next) && (ins->next->opcode == OP_DUMMY_USE)) {
-                                       // If a call is followed by a DUMMY_USE it can cause ppc_r3 to be erroneously reloaded with an earlier saved value.  Just remove the DUMMY_USE.
-                                       // TBD: A better solution would be to not insert the DUMMY_USE but that might not be possible.  The test case
-                                       // appdomain1 demonstrates this problem.
-                                       ins->next->opcode = OP_NOP;
-                               }
-                               EMIT_NEW_VARLOADA (cfg, dest, dest_var, dest_var->inst_vtype);
-
-                               g_assert(ins->klass);
-                               /* Save the result */
-                               if (is_all_floats) {
-                                       // Small structures entirely made up of either float or double members
-                                       // are returned in FR registers.
-                                       int mbr_size = float_member_size(ins->klass);
-                                       int mbr_cnt = member_count(ins->klass);
-                                       int cnt;
-                                       DEBUG_ELFABIV2_printf("storing function result, is_float_struct_returnable_via_regs(ins->klass) with length %d, %d members, member size %d\n", return_value_size, mbr_cnt, mbr_size);
-
-                                       for (cnt=0; cnt < mbr_cnt; ++cnt) {
-                                               if (mbr_size == 4) {
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER4_MEMBASE_REG, dest->dreg, cnt*mbr_size, ppc_f1+cnt);
-                                               } else {
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER8_MEMBASE_REG, dest->dreg, cnt*mbr_size, ppc_f1+cnt);
-                                               } // else
-                                       } // for
-                               } else {
-                                       MonoInst *dummy_use3=0;
-                                       //MonoInst *dummy_use4=0;
-                                       DEBUG_ELFABIV2_printf("storing function result, is_struct_returnable_via_regs(ins->klass) with length %d\n", return_value_size);
-                                       DEBUG_ELFABIV2_printf("           ins->next: ");   DEBUG_ELFABIV2_mono_print_ins(ins->next);
-                                       g_assert(is_returnable_via_regs);
-                                       // TBD: Improve the following code...
-                                       // Emit a store (or stores) of the values that are in ppc_r3/ppc_r4.  Also emit a DUMMY_USE to
-                                       // prevent the register spilling code from overwriting ppc_r3.
-                                       // TBD: See if this can happen for ppc_r4 as well.
-                                       switch (return_value_size) {
-                                               case 1:
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI1_MEMBASE_REG, dest->dreg, 0, call2->inst.dreg);
-                                                       EMIT_NEW_DUMMY_USE (cfg, dummy_use3, &call2->inst);
-                                                       break;
-                                               case 2:
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI2_MEMBASE_REG, dest->dreg, 0, call2->inst.dreg);
-                                                       EMIT_NEW_DUMMY_USE (cfg, dummy_use3, &call2->inst);
-                                                       break;
-                                               case 3:
-                                               case 4:
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI4_MEMBASE_REG, dest->dreg, 0, call2->inst.dreg);
-                                                       EMIT_NEW_DUMMY_USE (cfg, dummy_use3, &call2->inst);
-                                                       break;
-                                               case 5:
-                                               case 6:
-                                               case 7:
-                                               case 8:
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI8_MEMBASE_REG, dest->dreg, 0, call2->inst.dreg);
-                                                       EMIT_NEW_DUMMY_USE (cfg, dummy_use3, &call2->inst);
-                                                       break;
-                                               case 9: {
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI8_MEMBASE_REG, dest->dreg, 0, call2->inst.dreg);
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI1_MEMBASE_REG, dest->dreg, 8, ppc_r4);
-                                                       EMIT_NEW_DUMMY_USE (cfg, dummy_use3, &call2->inst);
-                                                       // What about ppc_r4?
-                                                       break;
-                                               }
-                                               case 10: {
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI8_MEMBASE_REG, dest->dreg, 0, call2->inst.dreg);
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI2_MEMBASE_REG, dest->dreg, 8, ppc_r4);
-                                                       EMIT_NEW_DUMMY_USE (cfg, dummy_use3, &call2->inst);
-                                                       // What about ppc_r4?
-                                                       break;
-                                               }
-                                               case 11:
-                                               case 12: {
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI8_MEMBASE_REG, dest->dreg, 0, call2->inst.dreg);
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI4_MEMBASE_REG, dest->dreg, 8, ppc_r4);
-                                                       EMIT_NEW_DUMMY_USE (cfg, dummy_use3, &call2->inst);
-                                                       // What about ppc_r4?
-                                                       break;
-                                               }
-                                               case 13:
-                                               case 14:
-                                               case 15:
-                                               case 16: {
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI8_MEMBASE_REG, dest->dreg, 0, call2->inst.dreg);
-                                                       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI8_MEMBASE_REG, dest->dreg, 8, ppc_r4);
-                                                       EMIT_NEW_DUMMY_USE (cfg, dummy_use3, &call2->inst);
-                                                       // What about ppc_r4?
-                                                       break;
-                                               }
-                                               default:
-                                                       DEBUG_ELFABIV2_printf("Bad size? %d\n", return_value_size);
-                                                       g_assert_not_reached ();
-                                                       break;
-                                       } // switch
-                               } // else
-                       } // if
-                       return TRUE;
-                       break;
-               } // CALL case
-               default:
-                       return FALSE;
-                       break;
-       } // switch ins->opcode
-       return TRUE;
-}
-#endif
-
-
 void
 mono_arch_decompose_opts (MonoCompile *cfg, MonoInst *ins)
 {
        switch (ins->opcode) {
        case OP_ICONV_TO_R_UN: {
-               // This value is OK as-is for both big and little endian because of how it is stored
+#if G_BYTE_ORDER == G_BIG_ENDIAN
                static const guint64 adjust_val = 0x4330000000000000ULL;
+#else
+               static const guint64 adjust_val = 0x0000000000003043ULL;
+#endif
                int msw_reg = mono_alloc_ireg (cfg);
                int adj_reg = mono_alloc_freg (cfg);
                int tmp_reg = mono_alloc_freg (cfg);
@@ -2857,14 +2162,8 @@ mono_arch_decompose_opts (MonoCompile *cfg, MonoInst *ins)
                        basereg = mono_alloc_ireg (cfg);
                        MONO_EMIT_NEW_BIALU_IMM (cfg, OP_IADD_IMM, basereg, cfg->frame_reg, offset);
                }
-#if G_BYTE_ORDER == G_BIG_ENDIAN
                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI4_MEMBASE_REG, basereg, offset, msw_reg);
                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI4_MEMBASE_REG, basereg, offset + 4, ins->sreg1);
-#else
-               // For little endian the words are reversed
-               MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI4_MEMBASE_REG, basereg, offset + 4, msw_reg);
-               MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI4_MEMBASE_REG, basereg, offset, ins->sreg1);
-#endif
                MONO_EMIT_NEW_LOAD_R8 (cfg, adj_reg, &adjust_val);
                MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADR8_MEMBASE, tmp_reg, basereg, offset);
                MONO_EMIT_NEW_BIALU (cfg, OP_FSUB, ins->dreg, tmp_reg, adj_reg);
@@ -2914,11 +2213,7 @@ mono_arch_decompose_opts (MonoCompile *cfg, MonoInst *ins)
                        MONO_EMIT_NEW_BIALU_IMM (cfg, OP_IADD_IMM, basereg, cfg->frame_reg, offset);
                }
                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER8_MEMBASE_REG, basereg, offset, ins->sreg1);
-#if G_BYTE_ORDER == G_BIG_ENDIAN
                MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, msw_reg, basereg, offset);
-#else
-               MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, msw_reg, basereg, offset+4);
-#endif
                MONO_EMIT_NEW_UNALU (cfg, OP_CHECK_FINITE, -1, msw_reg);
                MONO_EMIT_NEW_UNALU (cfg, OP_FMOVE, ins->dreg, ins->sreg1);
                ins->opcode = OP_NOP;
@@ -2940,11 +2235,8 @@ mono_arch_decompose_opts (MonoCompile *cfg, MonoInst *ins)
                else
                        MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SHR_IMM, ins->dreg, result_shifted_reg, 32);
                ins->opcode = OP_NOP;
-               break;
        }
 #endif
-       default:
-               break;
        }
 }
 
@@ -3928,7 +3220,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                        ppc_ldptr_indexed (code, ins->dreg, ins->inst_basereg, ppc_r0);
                                }
                        }
-                       g_assert(ins->dreg > 0);
                        break;
                case OP_LOADI4_MEMBASE:
 #ifdef __mono_ppc64__
@@ -4560,16 +3851,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        ppc_ldptr (code, ppc_r2, 8, ins->sreg1);
                        ppc_mtlr (code, ppc_r0);
 #else
-#if (_CALL_ELF == 2)
-                       if (ins->flags & MONO_INST_HAS_METHOD) {
-                         // Not a global entry point
-                       } else {
-                                // Need to set up r12 with function entry address for global entry point
-                                if (ppc_r12 != ins->sreg1) {
-                                        ppc_mr(code,ppc_r12,ins->sreg1);
-                                }
-                       }
-#endif
                        ppc_mtlr (code, ins->sreg1);
 #endif
                        ppc_blrl (code);
@@ -5513,13 +4794,6 @@ mono_arch_emit_prolog (MonoCompile *cfg)
        cinfo = get_call_info (cfg->generic_sharing_context, sig);
 
        if (MONO_TYPE_ISSTRUCT (sig->ret)) {
-               // The return value for a structure may either be returned via address or via registers depending on its size
-               MonoClass *klass = mono_class_from_mono_type (sig->ret);
-               gboolean is_all_floats = is_float_struct_returnable_via_regs(klass);
-               gboolean is_returnable_via_regs = is_struct_returnable_via_regs(klass, sig->pinvoke);
-
-               DEBUG_ELFABIV2_printf("mono_arch_emit_prolog for struct "); DEBUG_ELFABIV2_mono_print_klass(klass);
-               if (!is_all_floats && !is_returnable_via_regs) {
                ArgInfo *ainfo = &cinfo->ret;
 
                inst = cfg->vret_addr;
@@ -5531,12 +4805,6 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                        ppc_load (code, ppc_r12, inst->inst_offset);
                        ppc_stptr_indexed (code, ainfo->reg, ppc_r12, inst->inst_basereg);
                }
-
-               DEBUG_ELFABIV2_printf("mono_arch_emit_prolog  extra parm for return value\n");
-
-               } else {
-                       DEBUG_ELFABIV2_printf("mono_arch_emit_prolog  NO extra parm for return value\n");
-               }
        }
 
        tailcall_struct_index = 0;
@@ -5731,25 +4999,6 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                                        ppc_stfs (code, ainfo->reg, inst->inst_offset, inst->inst_basereg);
                                else
                                        g_assert_not_reached ();
-                        } else if (ainfo->regtype == RegTypeFPStructByVal) {
-                               int doffset = inst->inst_offset;
-                               int soffset = 0;
-                               int cur_reg;
-                               int size = 0;
-                               g_assert (ppc_is_imm16 (inst->inst_offset));
-                               g_assert (ppc_is_imm16 (inst->inst_offset + ainfo->vtregs * sizeof (gpointer)));
-                               /* FIXME: what if there is no class? */
-                               if (sig->pinvoke && mono_class_from_mono_type (inst->inst_vtype))
-                                       size = mono_class_native_size (mono_class_from_mono_type (inst->inst_vtype), NULL);
-                               for (cur_reg = 0; cur_reg < ainfo->vtregs; ++cur_reg) {
-                                       if (ainfo->size == 4) {
-                                               ppc_stfs (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
-                                       } else {
-                                               ppc_stfd (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
-                                       }
-                                       soffset += ainfo->size;
-                                       doffset += ainfo->size;
-                               }
                        } else if (ainfo->regtype == RegTypeStructByVal) {
                                int doffset = inst->inst_offset;
                                int soffset = 0;
@@ -5779,15 +5028,9 @@ mono_arch_emit_prolog (MonoCompile *cfg)
 #ifdef __mono_ppc64__
                                                if (ainfo->bytes) {
                                                        g_assert (cur_reg == 0);
-                                                       if (mono_class_native_size (inst->klass, NULL) == 1) {
-                                                         ppc_stb (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
-                                                       } else if (mono_class_native_size (inst->klass, NULL) == 2) {
-                                                               ppc_sth (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
-                                                       } else if (mono_class_native_size (inst->klass, NULL) == 4) {  // FIXME -- maybe <=4?
-                                                               ppc_stw (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
-                                                       } else {
-                                                               ppc_stptr (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);  // FIXME -- Better way?
-                                                       }
+                                                       ppc_sldi (code, ppc_r0, ainfo->reg,
+                                                                       (sizeof (gpointer) - ainfo->bytes) * 8);
+                                                       ppc_stptr (code, ppc_r0, doffset, inst->inst_basereg);
                                                } else
 #endif
                                                {
@@ -6745,20 +5988,6 @@ mono_arch_init_lmf_ext (MonoLMFExt *ext, gpointer prev_lmf)
        ext->lmf.ebp = (gssize)ext;
 }
 
-
-#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
-
-
 #endif
 
 gboolean
index e456456d585d940b486cbd994d91586f54bea698..7131aad0e14519330b8fae30cc48fa1b3455f279 100644 (file)
@@ -139,51 +139,21 @@ typedef struct MonoCompileArch {
 #define PPC_STACK_PARAM_OFFSET 24
 #define PPC_MINIMAL_STACK_SIZE 24
 #define PPC_MINIMAL_PARAM_AREA_SIZE 0
-#define PPC_LARGEST_STRUCT_SIZE_TO_RETURN_VIA_REGISTERS 0
-#define PPC_MOST_FLOAT_STRUCT_MEMBERS_TO_RETURN_VIA_REGISTERS 0
 #define PPC_FIRST_ARG_REG ppc_r3
 #define PPC_LAST_ARG_REG ppc_r10
 #define PPC_FIRST_FPARG_REG ppc_f1
 #define PPC_LAST_FPARG_REG ppc_f13
 #define PPC_PASS_STRUCTS_BY_VALUE 1
-#define PPC_PASS_SMALL_FLOAT_STRUCTS_IN_FR_REGS 0
-#define PPC_RETURN_SMALL_FLOAT_STRUCTS_IN_FR_REGS 0
-#define PPC_RETURN_SMALL_STRUCTS_IN_REGS 0
-#define MONO_ARCH_HAVE_DECOMPOSE_VTYPE_OPTS 0
-#define MONO_ARCH_RETURN_CAN_USE_MULTIPLE_REGISTERS 0
 #else
 /* Linux */
 #ifdef __mono_ppc64__
 #define PPC_RET_ADDR_OFFSET 16
- // PowerPC64 ELFv2 ABI
- #if (_CALL_ELF == 2)
-  #define PPC_STACK_PARAM_OFFSET 32
-  #define PPC_MINIMAL_STACK_SIZE 32
-  #define PPC_LARGEST_STRUCT_SIZE_TO_RETURN_VIA_REGISTERS 16
-  #define PPC_MOST_FLOAT_STRUCT_MEMBERS_TO_RETURN_VIA_REGISTERS 8
-  #define PPC_PASS_SMALL_FLOAT_STRUCTS_IN_FR_REGS 1
-  #define PPC_RETURN_SMALL_FLOAT_STRUCTS_IN_FR_REGS 1
-  #define PPC_RETURN_SMALL_STRUCTS_IN_REGS 1
-  #define MONO_ARCH_HAVE_DECOMPOSE_VTYPE_OPTS 1
-  #define MONO_ARCH_RETURN_CAN_USE_MULTIPLE_REGISTERS 1
-// FIXME: To get the test case  finally_block_ending_in_dead_bb  to work properly we need to define the following
-// and then implement the fuction mono_arch_create_handler_block_trampoline.
-//  #define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
-//  #define DEBUG_ELFABIV2
- #else
-  #define PPC_MINIMAL_STACK_SIZE 48
-  #define PPC_STACK_PARAM_OFFSET 48
-  #define PPC_LARGEST_STRUCT_SIZE_TO_RETURN_VIA_REGISTERS 0
-  #define PPC_MOST_FLOAT_STRUCT_MEMBERS_TO_RETURN_VIA_REGISTERS 0
-  #define PPC_PASS_SMALL_FLOAT_STRUCTS_IN_FR_REGS 0
-  #define PPC_RETURN_SMALL_FLOAT_STRUCTS_IN_FR_REGS 0
-  #define PPC_RETURN_SMALL_STRUCTS_IN_REGS 0
-  #define MONO_ARCH_HAVE_DECOMPOSE_VTYPE_OPTS 0
-  #define MONO_ARCH_RETURN_CAN_USE_MULTIPLE_REGISTERS 0
- #endif
+#define PPC_STACK_PARAM_OFFSET 48
+#define PPC_MINIMAL_STACK_SIZE 48
 #define PPC_MINIMAL_PARAM_AREA_SIZE 64
 #define PPC_LAST_FPARG_REG ppc_f13
 #define PPC_PASS_STRUCTS_BY_VALUE 1
+#define PPC_SMALL_RET_STRUCT_IN_REG 0
 #define PPC_THREAD_PTR_REG ppc_r13
 #else
 #define PPC_RET_ADDR_OFFSET 4
@@ -192,13 +162,7 @@ typedef struct MonoCompileArch {
 #define PPC_MINIMAL_PARAM_AREA_SIZE 0
 #define PPC_LAST_FPARG_REG ppc_f8
 #define PPC_PASS_STRUCTS_BY_VALUE 0
-#define PPC_LARGEST_STRUCT_SIZE_TO_RETURN_VIA_REGISTERS 0
-#define PPC_MOST_FLOAT_STRUCT_MEMBERS_TO_RETURN_VIA_REGISTERS 0
-#define PPC_PASS_SMALL_FLOAT_STRUCTS_IN_FR_REGS 0
-#define PPC_RETURN_SMALL_FLOAT_STRUCTS_IN_FR_REGS 0
-#define PPC_RETURN_SMALL_STRUCTS_IN_REGS 0
-#define MONO_ARCH_HAVE_DECOMPOSE_VTYPE_OPTS 0
-#define MONO_ARCH_RETURN_CAN_USE_MULTIPLE_REGISTERS 0
+#define PPC_SMALL_RET_STRUCT_IN_REG 1
 #define PPC_THREAD_PTR_REG ppc_r2
 #endif
 #define PPC_FIRST_ARG_REG ppc_r3
@@ -364,55 +328,4 @@ void mono_ppc_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint
 
 void mono_ppc_set_func_into_sigctx (void *sigctx, void *func) MONO_INTERNAL;
 
-// --
-#if PPC_RETURN_SMALL_FLOAT_STRUCTS_IN_FR_REGS
-gboolean is_float_struct_returnable_via_regs  (MonoClass *klass);
-#else
-#define is_float_struct_returnable_via_regs(a) (FALSE)
-#endif
-
-#if PPC_RETURN_SMALL_STRUCTS_IN_REGS
-gboolean is_struct_returnable_via_regs  (MonoClass *klass, gboolean is_pinvoke);
-#else
-#define is_struct_returnable_via_regs(a,b) (FALSE)
-#endif
-
-gint member_count  (MonoClass *klass);
-gint float_member_size  (MonoClass *klass);
-// --
-
-#if PPC_RETURN_SMALL_STRUCTS_IN_REGS
-// If the value is being returned via registers we don't need to allocate a temporary variable for it.
-gboolean function_return_value_requires_temporary (MonoMethodSignature *sig);
-#else
-#define function_return_value_requires_temporary(a) (TRUE)
-#endif
-
-// Debugging macros for ELF ABI v2
-#ifdef DEBUG_ELFABIV2
-
-#define DEBUG_ELFABIV2_printf(a, ...) \
-{if (getenv("DEBUG_ELFABIV2")) { printf(a, ##__VA_ARGS__); fflush(stdout); } }
-
-#define DEBUG_ELFABIV2_mono_print_ins(a) \
-{if (getenv("DEBUG_ELFABIV2")) { if (!a) {printf("null\n");} else {mono_print_ins(a);} fflush(stdout); } }
-
-extern char* mono_type_full_name (MonoType *type);
-
-#define DEBUG_ELFABIV2_mono_print_type(a) \
-{if (getenv("DEBUG_ELFABIV2")) { printf("%s, size: %d\n", mono_type_get_name(&a->klass->byval_arg), mini_type_stack_size (NULL, a, 0)); fflush(stdout); } }
-
-#define DEBUG_ELFABIV2_mono_print_klass(a) \
-{if (getenv("DEBUG_ELFABIV2")) { printf("%s\n", mono_type_get_name(&a->byval_arg)); fflush(stdout); } }
-
-#else
-
-#define DEBUG_ELFABIV2_printf(a, ...)
-#define DEBUG_ELFABIV2_mono_print_ins(a)
-#define DEBUG_ELFABIV2_mono_print_type(a)
-#define DEBUG_ELFABIV2_mono_print_klass(a)
-
-#endif
-
-
 #endif /* __MONO_MINI_PPC_H__ */
index 9934717c59039b97ae3c4da544bb7abae8428c98..e345cadc55bc984b594731b26cc8faef15ad2a45 100755 (executable)
@@ -807,7 +807,6 @@ struct MonoInst {
                guint16 source_opcode; /*OP_XCONV_R8_TO_I4 needs to know which op was used to do proper widening*/
                int pc_offset; /* OP_GC_LIVERANGE_START/END */
                int memory_barrier_kind; /* see mono-memory-model.h for valid values */
-               int additional_regs;    /* For ELF ABI v2 return struct via registers */
        } backend;
        
        MonoClass *klass;
@@ -2299,7 +2298,6 @@ void              mono_decompose_vtype_opts (MonoCompile *cfg) MONO_INTERNAL;
 void              mono_decompose_vtype_opts_llvm (MonoCompile *cfg) MONO_INTERNAL;
 void              mono_decompose_array_access_opts (MonoCompile *cfg) MONO_INTERNAL;
 void              mono_decompose_soft_float (MonoCompile *cfg) MONO_INTERNAL;
-gboolean          mono_arch_decompose_vtype_opts (MonoCompile *cfg, MonoInst *ins, MonoBasicBlock *bb) MONO_INTERNAL;
 void              mono_handle_global_vregs (MonoCompile *cfg) MONO_INTERNAL;
 void              mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) MONO_INTERNAL;
 void              mono_if_conversion (MonoCompile *cfg) MONO_INTERNAL;
@@ -2882,11 +2880,6 @@ gboolean MONO_SIG_HANDLER_SIGNATURE (mono_chain_signal) MONO_INTERNAL;
 #define MONO_IS_ILP32 1
 #else
 #define MONO_IS_ILP32 0
-
-#ifdef MONO_ARCH_RETURN_CAN_USE_MULTIPLE_REGISTERS
-void mono_arch_handle_multiple_dregs(MonoBasicBlock *, MonoCompile *, MonoInst *, MonoInst *);
-#endif
-
 #endif
 
 #endif /* __MONO_MINI_H__ */