extended asm - memory constraint
Ian Lance Taylor
iant@google.com
Wed Jun 2 04:46:00 GMT 2010
mc2718 <mc2718@gmail.com> writes:
> By the way, can one pass (long long)-s but NOT through memory? (Ignore for
> the moment SSE completely.) For most 64-bit math, gcc keeps these in two
> 32-bit registers - I wonder whether I can get gcc to use those registers in
> some of my own assembly code without any excursions to memory and back.
Well, you can put a long long value in a register in an asm statement,
and it will wind up in two consecutive registers. Unfortunately,
there is no good way to refer to the registers in an asm statement.
You have to use a constraint like 'A', in which case you know the
value will be in %eax/%edx.
Ian
More information about the Gcc-help
mailing list