]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commit
pcem: avoid dynamic offsetof in Voodoo codegen
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Mon, 1 Jun 2026 21:15:51 +0000 (14:15 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Mon, 1 Jun 2026 21:15:51 +0000 (14:15 -0700)
commiteefaba8af9769a24ab212dc75c8bd09e8c8d0d48
treec0f0c94080b21c89cd237b5dc8728d1e48d15f92
parent9f7b58e656132645c038ae8e4efcb00db676f5d8
pcem: avoid dynamic offsetof in Voodoo codegen

The Voodoo x86 code generators compute offsets into array members
with offsetof(type, field[index]). Some compilers reject that
expression form.

Add helpers that derive the offset from field[0] plus an element
stride. That preserves the generated offsets without relying on a
runtime-indexed offsetof expression. This matches the same cleanup
merged upstream in 86Box.
pcem/vid_voodoo_codegen_x86-64.h
pcem/vid_voodoo_codegen_x86.h