On Wed, Mar 1, 2017 at 9:48 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Wed, Mar 01, 2017 at 09:34:53AM +0100, Uros Bizjak wrote: >> Some more thoughts on 64-bit reg on 32-bit targets warning. >> >> Actually, we never *print* register name for instruction that use "A" >> constraint, since %eax/%edx is always implicit The warning does not >> deal with constraints, so unless we want to output DImode register >> name, there is no warning. > > Ah, indeed, we don't have a modifier that would print the high register > of a register pair (i.e. essentially print REGNO (x) + 1 instead of REGNO > (x)), guess that might be useful not just for 64-bit GPR operands in 32-bit > code, but also 128-bit GPR operands in 64-bit code.
The issue here is that (modulo ax/dx with "A" constraint) we don't guarantee double-register sequence order, so any change in register allocation order would break any assumptions. For implicit ax/dx, user should explicitly use register name (e.g. DImode operand in "rdtscp; mov %0, mem" asm should be corrected to use %%eax instead of %0). And, yes - we should add similar warning for 128-bit GPRs. The only way to use register pair with width > machine_mode is with implicit operands or with explicit regnames. > While looking at ix86_print_operand, I've noticed duplication in the > comment: > w -- print the operand as if it's a "word" (HImode) even if it isn't. > s -- print a shift double count, followed by the assemblers argument > delimiter. > b -- print the QImode name of the register for the indicated operand. > %b0 would print %al if operands[0] is reg 0. > w -- likewise, print the HImode name of the register. > k -- likewise, print the SImode name of the register. > q -- likewise, print the DImode name of the register. > x -- likewise, print the V4SFmode name of the register. > t -- likewise, print the V8SFmode name of the register. > g -- likewise, print the V16SFmode name of the register. > > w is documented twice, guess the first line should be removed. Indeed. The first one should be removed. Uros.