Question about YMM register availability in x86 CPUs

Guinevere Larsen via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Hello gdb list!

TL;DR: Is it reasonable to assume that all x86 CPUs that have AVX 
capabilities will have both XMM and YMM registers?

Some background, I'm trying to implement record full support for AVX and 
AVX2 instructions. As part of this effort, I have to decide when we 
should record the full YMM (or ZMM if available) and when we should 
record just XMM. This had me wondering if I can just decide to always 
record YMM registers, or if I need to query avx-capable targets about 
whether they have those registers.

At least at some points I am pretty sure I should record the biggest 
vector register available since, for example, vmovd/vmovq will overwrite 
all higher bits, so we'll lose information if we just use the provided 
register instead of recording the full size of register available.

Looking at gdb/amd64-tdep.c, it seems like ymm can be assumed, as on 
lines 3193-3197 we seem to set the number of available ymm registers 
just by looking for avx, and not checking for avx2 at all, but I wanted 
to see if anyone could say for certain, not just me extrapolating from 
code I don't really understand :)

-- 
Cheers,
Guinevere Larsen
She/Her/Hers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.