Stream: cranelift

Topic: Amode chaos


view this post on Zulip bjorn3 (Sep 23 2025 at 14:04):

In Cranelift internally there are a bunch of enums named amode. You have AMode, Amode, SyntheticAmode. Most backends just have a single AMode enum, but x86 has Amode and SyntheticAmode. Would it be possible to merge the x86 Amode and SyntheticAmode and name it consistently with AMode from other backends?

view this post on Zulip bjorn3 (Sep 23 2025 at 14:05):

Or alternatively to have the same SyntheticAmode split in other backends?

view this post on Zulip Chris Fallin (Sep 23 2025 at 16:56):

A cleanup here seems reasonable; IIRC aarch64 at least has AMode more or less equivalent to SyntheticAmode (has the artificial kinds) and mem_finalize maps down to the hardware-supported subdomain. Putting types on that to properly represent it seems good

view this post on Zulip Andrew Brown (Sep 23 2025 at 22:06):

@bjorn3, related to this, I tried to clean up the Reg, RegMem, RegMemImm type issues in https://github.com/bytecodealliance/wasmtime/pull/10775 but never got around to finishing that. Just a heads up...

While reflecting on why #10762 is hard, it seemed that the underlying problem to many ISLE matching issues is our inability to actually inspect the variants of the register specific versions of Reg...

Last updated: Dec 06 2025 at 07:03 UTC