Building a Windows 8 app, developers can choose HTML/JavaScript, XAML/.Net (C#/VB), and XAML/C++. I want to write my app in XAML/C++.
Building applications in the first two choices almost guarantees that your application will execute on both Intel and ARM architectures.
But I have heard that if I do certain things in my C++ app, I can cause the application NOT to execute on the ARM architecture. But I don't know the details.
Does anyone know what C++ Windows 8 apps should avoid so that they can run on ARM okay? Are these architecture decision or just differences in technique?
PCs powered by Arm provide great application compatibility and allow you to run your existing unmodified x86 win32 applications. Arm apps run natively without any emulation, while x86 amnd x64 apps run under emulation on Arm devices.
The core Windows on Arm experience, such as the Start Menu and File Explorer, are all compiled for and run natively on Arm chips, ensuring maximum performance. That is to say, they run directly on the processor with no need for translation, emulation, or any other middle layer, just like they do on an x86 PC.
In order to run on each architecture you first need to compile for each architecture obviously. If you write standard C++ (and if you do not rely on undefined behaviour and/or platform specific behaviour) you are fine the things that usually cause troubles when porting between architectures is:
(this list is an example)
Usually you are safe if you refrain from crazy pointer arithmetic and casting.
I'm not aware of anything that will make your code simply not execute or compile under ARM (other than inlining assembly).
However, there are things you can do which will make ARM give the wrong answer.
ARM processors are "weakly-ordered" this recent article gives you the low down
http://preshing.com/20121019/this-is-why-they-call-it-a-weakly-ordered-cpu
But to sum up, ARM processors may reorder memory accesses, and if you aren't careful, this can give you different results between x86 and ARM architectures in multi-threaded applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With