Targeting ARM architecture with .NET compiler

11,491

Solution 1

Use Mono's Ahead-of-Time (AOT) compilation. That's how they got UNITY scripting onto the iPhone which is an ARM platform. It will probably take some labour to get it up and running on Windows Mobile since, afaik, noone has done that particular platform port yet but the compiler etc should already be there.

You can see Miguel de Icaza's presentation of it at MS PDC here.

Solution 2

I don't believe specifying the platform target does optimise the generated IL for the given architecture. Instead, it says, "I only run on the specified architecture, because I contain P/Invoke calls specific to that architecture." At least, that's my understanding of it. It means that when running on an x64 machine, an executable can run under the 32 bit version of the CLR for compatibility.

How this fits in with the compact framework (which I assume is your actual platform?) I'm not sure.

Solution 3

x86 or x64 doesn't optimize the IL - that's the job of the JITter that runs on the deployed machine. x86 or x64 just marks a bitness flag.

Of course, in the desktop framework you can NGEN your MSIL to a particular CPU - but IIRC, the lack of a native image will just revert to JIT compilation. Besides that, though, I don't think NGEN is available for .NET CF anyway.

I'm not sure why you'd need to restrict to ARM processors, but a P/Invoke to GetSystemInfo will return a SYSTEM_INFO structure with the processor type in it. That could prevent your app continuing on !ARM, but not really from running.

Edit: Re-reading this question, I noticed that besides he C# and .NET tag, there's really no indication that you only want a managed solution. If you're willing to go unmanaged, you can obviously just compile down to ARM.

Solution 4

If you want to create ARM based application on Windows Mobile based devices install .NET Compact Framework. You’ll have a new “Smart device” project type in your VS for that.

I don’t know if there is JIT for any other ARM platform WM, there is also .NET Micro Framework but I can’t tell you anything about that, maybe this will solve your questions?

Share:
11,491
Ilya Volodin
Author by

Ilya Volodin

Updated on June 04, 2022

Comments

  • Ilya Volodin
    Ilya Volodin almost 2 years

    When you compile windows application in .NET you can set "Platform Target" to be x86 or x64. This would optimize your code to a specific architecture of the processor and allow to escape IL. Does anyone know if there's something that would allow to achieve the same result for Windows Mobile application? I'm only interested in running my application on ARM architecture.