[amd64] Allow returning of structs in register pairs.
authorZoltan Varga <vargaz@gmail.com>
Sat, 17 Oct 2015 00:05:05 +0000 (20:05 -0400)
committerZoltan Varga <vargaz@gmail.com>
Sat, 17 Oct 2015 00:05:21 +0000 (20:05 -0400)
mono/mini/mini-amd64.c

index 540d7c4aad4818e878fbc72bf8d390300f6d60b7..2f98646ada5765597aba5c4e83ef8a220f98416d 100644 (file)
@@ -924,11 +924,8 @@ add_valuetype (MonoMethodSignature *sig, ArgInfo *ainfo, MonoType *type,
 
        klass = mono_class_from_mono_type (type);
        size = mini_type_stack_size_full (&klass->byval_arg, NULL, sig->pinvoke);
-       if (!sig->pinvoke && ((is_return && (size == 8)) || (!is_return && (size <= 16)))) {
-               /* We pass and return vtypes of size 8 in a register */
-       } else if (!sig->pinvoke || (size == 0) || (size > 16)) {
+       if (size > 16)
                pass_on_stack = TRUE;
-       }
 
        /* If this struct can't be split up naturally into 8-byte */
        /* chunks (registers), pass it on the stack.              */
@@ -988,11 +985,6 @@ add_valuetype (MonoMethodSignature *sig, ArgInfo *ainfo, MonoType *type,
                /* Always pass in 1 or 2 integer registers */
                args [0] = ARG_CLASS_INTEGER;
                args [1] = ARG_CLASS_INTEGER;
-               /* Only the simplest cases are supported */
-               if (is_return && nquads != 1) {
-                       args [0] = ARG_CLASS_MEMORY;
-                       args [1] = ARG_CLASS_MEMORY;
-               }
        } else {
                /*
                 * Implement the algorithm from section 3.2.3 of the X86_64 ABI.