One Code Base for Two Architectures: x86 & ARM Software Development with Qt

x86 to ARM

 

The practicalities of migrating from x86 to ARM and cross-platform software development based on the Qt framework is a trending topic for our clients – software publishers and ARM-based device manufacturers who want to follow the most efficient development practices and cover as many devices and platforms as possible with minimal effort. Let’s cover this topic by referring to our case studies. 

Pavel Moroshek

 

Pavel Moroshek,  

Head of Embedded Systems Unit at Promwad,

Qt expert 

Many battery-powered devices, especially AI-powered smartphones and notebooks by global vendors, are transitioning from the traditional x86 architecture to the more power-efficient ARM, which offers higher performance and extended unplugged runtime.  

The new ARM-based Copilot+ PCs announced by Windows this year are another change in the global market for personal gadgets. This trend requires adapting existing and new software for both architectures — x86 and ARM. 

Migrating software from x86 to ARM is a complex process that involves code adaptation, compatibility resolution, and performance optimisation. This differs from writing cross-platform software that can run on x86 and ARM from a single codebase. A solution that allows you to eliminate the need to create two separate codebases – the Qt framework for developing cross-platform applications.  

The software engineers at Promwad have accumulated extensive experience migrating software and creating Qt-based solutions to address our clients' popular architectures, operating systems and devices.  

Thanks to our official partnership with Qt Group, we use the Qt framework for GUI implementation and the whole app's business logic with non-GUI modules. Our toolkit includes libraries from Qt Framework (Boost and other libs, depending on a project domain) for implementing business logic, Figma and Qt Design Studio for UX/UI design, test automation libs and tools, including Squish, as well as Azure/AWS cloud infrastructure for automated pipelines. 

Qt has supported ARM as a target architecture for 10+ years, it enables us to write code once and deploy it across multiple architectures and platforms with minimal or even zero platform-specific code. For example, some of our recent projects involved migrating from x86 using C++/WinAPI, .NET, and Objective-C/Cocoa. We transitioned them to cross-platform and modern C++ with the Qt Framework. 

This article will explore the benefits of ARM for battery-powered devices, Qt for cross-platform development, and peculiarities of x86 to ARM conversion — an overview of the main points for software publishers and device manufacturers who want to reduce deadlines and budgets through cross-platform development.  

Contact us to cover all possible devices and platforms with embedded software on Qt!
ARM-based M3 processor designed by Apple

The ARM-based M3 processor designed by Apple Inc. powers the MacBook Air, MacBook Pro, Mac Mini, iMac, and iPad Pro. Source: apple.com  

 

1. Why ARM for battery-powered devices?

Apple, Samsung, Microsoft, Lenovo, Dell, HP and many other electronics manufacturers choose ARM for their smartphones, tablets and laptops because of three key advantages:  

  1. Efficiency. ARM processors deliver remarkable PPW. This efficiency allows devices to achieve high computational power while optimising energy consumption.
     
  2. Performance. The latest ARM processors, such as Apple's M3 and Qualcomm's Snapdragon, have shown that ARM can outperform x86 in various benchmarks. Applications compiled and optimised for ARM often run faster and more efficiently, showing the architecture's greater performance. 
     
  3. Battery life. One of the most significant advantages of ARM architecture processors is their ability to extend battery life and reduce heat generation, enabling the production of lighter and thinner gadgets.

  

2. Why did we choose Qt for cross-platform development?

Qt is a cross-platform development toolkit that supports Windows, macOS, Linux, Android, and iOS. It is especially relevant for transitioning from x86 to ARM because it enables developers to write code once and deploy it to different architectures and platforms with minimal or zero platform and architecture-specific code.  

The x86 to ARM porting process with Qt involves code auditing, requirements analysis, code adaptation and optimisation, creating or adapting a test suite, and handling deployment and maintenance. At Promwad, we successfully manage all these steps for our clients, thanks to our extensive experience with world-class tools and frameworks that enable us to perform design, development, and QA most efficiently. 

The Qt framework makes developing applications for many architectures and platforms easier, such as ARM on Windows, Mac, Linux, mobile, and embedded operating systems. Along with a diverse variety of libraries, it provides an extensive set of tools, such as an IDE (Qt Creator), an effective user interface designer (Qt Design Studio with Figma bridge), and an advanced testing tool (Squish). 

  

Software development toolset by Qt Group

The cross-platform software development toolset by Qt Group. Source: qt.com  

 

3. Step by step x86 to ARM porting

We have gained experience in migration from x86 architecture to ARM, which has led us to a transparent five-step process. This process supports applications written in any programming language. 

Here are the steps the software engineers at Promwad implement for our clients: 

 

Step 1. Initial assessment and planning   

Requirements analysis. The application's ARM version requirements, including performance goals and hardware considerations.     

Code audit. The codebase is reviewed to identify platform-specific dependencies and potential compatibility issues.  

 

Step 2. Code adaptation and optimisation

Refactoring. The code is adapted to isolate and abstract platform-specific and architecture-specific functionality using Qt's cross-platform APIs. It may require rewriting some parts of the code and redesigning the overall architecture to ensure seamless cross-platform compatibility.  

Optimisation for ARM. We implement ARM-specific optimisations for custom algorithms that depend on x86-specific instructions to leverage ARM's strengths. It includes using NEON SIMD instructions and fine-tuning multi-threading to enhance performance and efficiency on ARM-based systems. 

   

software development process with Qt

The Qt framework covers the whole software development process from design to testing. Source: qt.com  

 

Step 3. Building, testing, tuning

Cross-compilation of the application. We use platform- and architecture-specific toolchains to compile the application for the ARM architecture on each target platform. Leveraging a cross-platform build system like CMake can streamline this process and ensure consistent builds across various environments.

Testing on ARM hardware. The application is deployed to target ARM devices and thoroughly tested to ensure functionality and performance. This step may also involve using emulators.

Profiling and performance tuning. We implement performance profiling to pinpoint inefficiencies and bottlenecks. Our software engineers optimise the application’s code to fully leverage ARM’s architecture-specific features, ensuring enhanced performance and efficient execution on ARM devices.

 

Step 4. Quality assurance and deployment

Comprehensive testing. We implement a thorough testing suite, including unit and integration tests, to ensure the application meets quality standards. Manual testing is also conducted, as it often uncovers issues that automated tests can miss or be unable to cover. For Qt applications, the Squish testing tool is particularly valuable for testing across all target platforms, providing robust functional and UI testing support.

Deployment. Promwad ensures the correct application deployment across all intended ARM platforms, verifying that it integrates seamlessly with the existing build and release pipelines. We pay close attention to platform-specific requirements and configurations to ensure a smooth rollout and optimal performance.

 

brands using Qt

Major brands worldwide use Qt for their cross-platform software. Source: qt.com  

 

Step 5. Ongoing maintenance and support

Performance monitoring and updates implementation. If agreed with the client, we can take over this stage as well: monitor the performance of the ARM/x86 versions and implement updates for multiple platforms based on client needs, user feedback, and performance data. 

As a result, our clients get cross-platform solutions that run on all target architectures and devices. 

Porting applications from x86 architecture to ARM has been and continues to be rewarding for our team at Promwad. These projects have consistently expanded our technical expertise and showcased the reliability and versatility of Qt in cross-platform development, resulting in efficient applications that look modern and offer great usability, completed in a more than reasonable time. 

    

4. Complexities of x86 to ARM migration and how we solve them

Starting development on Qt with a single code base is the optimal solution to keep applications efficient and cost-effective.

If an application was initially developed separately for x86, porting it to another architecture, such as ARM, can be complicated by instruction set, middleware compatibility, and missing third-party libraries. These issues often make it easier to rewrite the original application in Qt, ensuring that the x86 and ARM platforms are supported from the start. 

A unified approach simplifies the development process by eliminating the need for separate code bases, making updates and implementation of new features easier. Using a single Qt code base ensures consistent application behaviour across platforms and reduces long-term maintenance costs, which results in a more efficient development lifecycle. 

Below, let's look at the architecture-dependent complexities that can arise during the х86 to ARM porting and how we address them for our clients: 

 

Architecture differences. x86 uses a CISC (Complex Instruction Set Computing) approach, allowing a wide range of instructions to execute complex tasks in a single step. ARM uses a RICS (Reduced Instruction Set Computing) approach, simplifying instructions and often requiring multiple steps to complete what x86 can do in one. 

Additionally, x86 processors typically have more sophisticated caching mechanisms and multi-threading capabilities, which affect how data is managed, and concurrent processes are handled. ARM processors generally have a simpler cache hierarchy and may handle multi-threading differently, impacting performance optimisation strategies. 

To address these differences between x86 and ARM, our team refactors and optimises code, uses cross-platform libraries and frameworks like Qt, adjusts build processes, and thoroughly tests and debugs the application to ensure seamless performance on ARM. We also leverage ARM-compatible libraries and extensive documentation. 

 

Endianness. ARM and x86 processors can use different data formats, known as endianness (big-endian vs. little-endian). If endianness hasn't been considered since the beginning, we refactor the code to fix that. Qt is also helpful here, letting abstract differences between the architectures. 

As a result, thanks to the reliance on the Qt-based development process, the x86 and ARM porting and parallel implementation of software for both architectures become transparent, predictable and efficient.

   

Development and deployment of Qt software

Development and deployment of cross-platform software on all target devices with a unified code base. Source: qt.com  

 

 * * *

Using the power of Qt has allowed our clients to simplify the transition process from x86 to ARM, optimise performance, and extend applications to new perfomant and energy-efficient platforms. This move prepares companies for current and future demands and enhances the user experience with more efficient and usable software solutions.

Contact us today to discuss the best strategy for developing cross-platform and cross-architecture solutions or for migrating from x86 to ARM – desktop, mobile, server and embedded applications! or migrating your solutions to x86 and ARM – both embedded software and custom applications!

Â