Re: [x86 inline asm]: width of register arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Zdenek,

On Wed, Jul 03, 2019 at 09:32:12AM +0200, Zdenek Sojka wrote:
> "
> Things get even more interesting if you use multi-register modes, like
> DImode with -m32 on x86. On x86 that says "warning: unsupported size
> for integer register", but some other targets have to handle that.
> Writing correct asm in such cases of course means that you have to know 
> what the compiler does.
> "
> Like on arm and powerpc (32bit) targets, where there are the %L and/or %H 
> operand modifiers (correct?)

Yup.  PowerPC's %L (not just 32-bit btw) just means "register number plus
one", which you can write as just "%0+1" with many assemblers (but not
with all).  arm and aarch64 %H are very similar.

> (I can't find them documented anywhere atm)

Yeah, working on it.  Known issue.

> x86 (32bit) has a DImode constraint "A" for the edx:eax register pair... but
> it's not generic enough and out of scope for me, as I am using the x86_amd64
> target with at most DImode variables.

You can have TImode variables in 64-bit mode, using __int128 or similar.

Anyway...  You hardly ever should have issues with this in actual inline
asm.  You should avoid these problems, avoid these constructs completely,
there usually are better ways to do these things (using pure C, or maybe
using some compiler intrinsics / builtin functions, for example).


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux