Limit operand to a set of physical registers

Aperta
#107 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
compilers

Direzione di ricerca

Inizia esaminando le forme dei vincoli di Operand (reg_def, reg_use, reg_fixed_def e reg_fixed_use) e il modo in cui MachineEnv rappresenta i registri fisici. Confronta la limitazione dei registri byte a 32 bit di x86 descritta per setcc con le ISA attualmente supportate. Il lavoro è completato quando è possibile esprimere un insieme limitato di registri fisici e il relativo comportamento di allocazione è coperto dai test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

It seems like there are currently two options when expressing which registers an Operand can use:

  • use reg_def/reg_use/..., in this case the operand can be allocated to any physical register.
  • use reg_fixed_def/reg_fixed_use, in this case the operand can only be a single physical register.

This does not seem to cover the case where only of a limited set of physical registers can be used as an operand.

This is often the case on x86 (32-bit), where some of the general purpose registers don't expose their lower 8 bits as a pseudoregister. This means that setcc and other instructions dealing with a byte can only use the first 4 registers, not eg. esi.

My current workaround is to always use fixed operands for these instructions, but that is a bit too limiting. The other solution is to completely remove the additional registers from the MachineEnv, but that has even bigger drawbacks. Is there a better solution? It seems none of the ISAs supported by wasmtime have this issue, so I can't steal any ideas there.

Lingua principale
Rust
Stelle
266
Fork
54
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bytecodealliance/regalloc2

Tutte le issue di bytecodealliance/regalloc2

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.