]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
x86: improve matching diagnostics when "accumulator" registers are involved
authorJan Beulich <jbeulich@suse.com>
Fri, 16 May 2025 08:27:55 +0000 (10:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 16 May 2025 08:27:55 +0000 (10:27 +0200)
commit29ea35a1140f10f20995fc63c1b98ce9181e18ec
tree6b74668fa793559096596cd709217a269efc44fa
parent8b2de983da29506d882f41ee7b1ce4e2dce22eef
x86: improve matching diagnostics when "accumulator" registers are involved

In templates, the expectation of an "accumulator" register to be used is
expressed solely by operand size; there's no "class" specifier there.
Hence operand_size_match() is too eager in invoking
match_{operand,simd}_size(), resulting in "operand size mismatch" errors
when it's the type (of register), not the size that's wrong.
Interestingly adjustments there alone lead to no error at all then: To
"compensate", operand_type_match() needs to disambiguate register types
when register instances are specified in the template (matching the
actual operand), by checking a match (overlap) in operand sizes.
gas/config/tc-i386.c
gas/testsuite/gas/i386/inval-type.l
gas/testsuite/gas/i386/inval-type.s