Skip to content

Support AOT generation for ia32 implementation on 3.2.3 #54930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ganenkokb-yandex opened this issue Feb 15, 2024 · 1 comment
Closed

Support AOT generation for ia32 implementation on 3.2.3 #54930

ganenkokb-yandex opened this issue Feb 15, 2024 · 1 comment

Comments

@ganenkokb-yandex
Copy link

ganenkokb-yandex#1

Introduction

Here we introduce AOT generation support for ia32.
The lack of AOT support for ia32 is primarily due to the fact that the x64 approach with the allocation of 2 CODE_REG and PP_REG registers did not scale to the ia32 architecture due to the fact that there were so few free registers that the implementation of many instructions and stubs became impossible or time-consuming. A different approach and custom implementation for ia32 were required. In the dart-sdk project such work was stopped at some point due to the fact that ia32 was no longer supported at the OS developer level. Nevertheless, there was a request for ia32 support in the community and we decided to try to implement it.

What this prototype is about

For AOT on ia32 we use the following approach:

  • x64 AOT implementation of flowgraph compiler, instructions and stubs was used as is for ia32
  • assembler work with objects was moved to a pool of objects, as is done in all platforms that support AOT. We take the code completely from the x64 implementation also
  • implementations that are very different on ia32 and x64, such as write barrier, are also used with x64 implementations
  • transfer the operation of registers to memory for: CODE_RED, PP_REG, ABI enums registers, which began to be used in ia32 from the x64 implementation
  • turn off intrinsify, because the assembly code requires significant edits, which is not the purpose of this prototype.

Stability issues

To verify the correctness of the dart sdk, we used tests on the x64 and ia32 platforms.
To do this, we completely transferred the work of x64 to memory instead of registers, and thus we had the opportunity to run tests on x64 and compare them with tests on ia32. The corresponding changes in the x64 code and tests are presented in the prototype. The changes in the x64 functionality serve as a demonstration of the approach and are not a demonstration of the final code.

Summary

Introduced prototype was integrated with flutter engine build and provided AOT work on ia32, still having support of JIT.

@ganenkokb-yandex ganenkokb-yandex changed the title Support AOT generation for ia32 implementation Support AOT generation for ia32 implementation on 3.2.3 Feb 15, 2024
@mraleph
Copy link
Member

mraleph commented Feb 15, 2024

That's pretty massive undertaking! Kudos.

Unfortunately, at this point we are basically considering to completely delete X86 support from the VM so I would encourage you to not waste time on this - unless of course you just want to maintain your own fork of the Dart SDK and Flutter engine. Because we are on the path to deprecate and remove X86 it is highly unlikely that we will want to review and merge any significant changes to the IA32 backend.

@mraleph mraleph closed this as completed Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy