Skip to content

Commit

Permalink
[arm] one more attempt to fix slotsize issue on llvmonly (mono#14444)
Browse files Browse the repository at this point in the history
* [arm] one more attempt to fix slotsize issue on llvmonly

Regression of mono#12992 & mono#14362

In the end, the actual fix boils down to:
```patch
--- a/mono/mini/mini-arm.c
+++ b/mono/mini/mini-arm.c
@@ -2374,7 +2374,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
                                lainfo->nslots = ALIGN_TO (ainfo->struct_size, 8) / 8;
                                lainfo->esize = 8;
                        } else {
-                               lainfo->nslots = ainfo->struct_size / sizeof (target_mgreg_t);
+                               lainfo->nslots = ALIGN_TO (ainfo->struct_size, sizeof (target_mgreg_t)) / sizeof (target_mgreg_t);
                                lainfo->esize = 4;
                        }
                        break;
```

Tested on `xamarin-macios/arm64_32-v3` branch:
* mscorlib
* mini
* dont link
* monotouch tests
* and a modified version of mono#8486 (comment) (added larger structs too)

with each device, Watch Series 3 (`armv7k`) and Watch Series 4 (`arm64_32`).

I hope that is the last iteration on this.

* remove arm64_32_abi
  • Loading branch information
lewurm committed May 20, 2019
1 parent 860a38a commit c139b55
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions mono/mini/mini-arm.c
Expand Up @@ -2369,14 +2369,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
break;
case RegTypeStructByVal: {
lainfo->storage = LLVMArgAsIArgs;
int slotsize;
#ifdef TARGET_WATCHOS
/* slotsize=4 works for armv7k, however arm64_32 allows passing
* structs with sizes up to 8 bytes in a single register. */
slotsize = arm64_32_abi ? 8 : 4;
#else
slotsize = eabi_supported && ainfo->align == 8 ? 8 : 4;
#endif
int slotsize = eabi_supported && ainfo->align == 8 ? 8 : 4;
lainfo->nslots = ALIGN_TO (ainfo->struct_size, slotsize) / slotsize;
lainfo->esize = slotsize;
break;
Expand Down

0 comments on commit c139b55

Please sign in to comment.