Bug 31582

Summary: iOS -O=float32 fails for some operations on ARM7
Product: iOS Reporter: Icer addis <iaddis>
Component: Mono runtime / AOT compilerAssignee: Rodrigo Kumpera <kumpera>
Status: RESOLVED FIXED    
Severity: normal CC: iaddis, jon.goldberger, kumpera, mono-bugs+monotouch, rolf
Priority: ---    
Version: XI 8.13 (C6 early alphas)   
Target Milestone: Untriaged   
Hardware: Macintosh   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Attached example project

Description Icer addis 2015-07-02 12:30:10 UTC
Created attachment 11823 [details]
Attached example project

Specifically the pseudo instruction: r4_conv_to_u8 when building for ARM7.

Here is example code:

       struct Vector2 {public float x,y;}
        static ulong Test_r4_conv_to_u8(Vector2 size)
        {
            return ((ulong)size.y)<<32 
                | (ulong)size.x<<16; 

        }

I think the conversion is the problem, not the struct value.

The opcode is missing from ARM7:
https://github.com/mono/mono/blob/master/mono/mini/cpu-arm.md#r4-opcodes

But it is present here for ARM64:
https://github.com/mono/mono/blob/0c604e7175d0248eb03fe0aa8d8b07d28362bbfc/mono/mini/cpu-arm64.md#r4-opcodes

And there is this case block which may be relevant:
https://github.com/mono/mono/blob/master/mono/mini/mini-arm.c#L5504

I suggest testing all instructions because there may be more lurking...
Comment 2 Rodrigo Kumpera 2015-07-03 13:31:48 UTC
I'm working on it.
Comment 3 Rodrigo Kumpera 2015-07-03 14:44:13 UTC
Fixed on mono master/5d93b2a292c7609596b9ec0492cd6f80658e3a8f.