public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* invalid 'asm': invalid operand for code 'H'
@ 2018-07-08  5:03 Jeffrey Walton
  2018-07-09  9:46 ` Richard Earnshaw (lists)
  0 siblings, 1 reply; 7+ messages in thread
From: Jeffrey Walton @ 2018-07-08  5:03 UTC (permalink / raw)
  To: gcc-help

Hi Everyone,

I'm working from an ARM guide. The doc provides this code:

$ cat move.c
int main(int argc, char* argv[])
{
    int a;
    asm volatile("movw %0,%L1 \n"
                 "movt %0,%H1 \n"
                 : "=r"(a) : "i"(0x12345678));
    return a;
}

It results in:

$ gcc -march=armv7 move.c
move.c: In function ‘main’:
move.c:4:5: error: invalid 'asm': invalid operand for code 'H'
     asm volatile("movw %0,%L1 \n"
     ^

The guide says this about the modifiers:

L - The lowest-numbered register of a register pair, or the low 16
bits of an immediate constant.
H - The highest-numbered register of a register pair, or the high 16
bits of an immediate constant
....

Is this an ARM extension not present in GCC? Or am I doing something wrong?

Jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-07-09 12:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-08  5:03 invalid 'asm': invalid operand for code 'H' Jeffrey Walton
2018-07-09  9:46 ` Richard Earnshaw (lists)
2018-07-09  9:53   ` Richard Earnshaw (lists)
2018-07-09 11:53     ` Jeffrey Walton
2018-07-09 12:48       ` U.Mutlu
2018-07-09 12:53       ` Richard Earnshaw (lists)
2018-07-09 16:57       ` Richard Earnshaw (lists)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).