x86_64-asm: =m operand fixes
commit4a3741bf02eb51c377312bdabc979e5ccbf5bf89
authorgrischka <grischka>
Sun, 20 Nov 2016 13:50:56 +0000 (20 14:50 +0100)
committergrischka <grischka>
Sun, 20 Nov 2016 13:50:56 +0000 (20 14:50 +0100)
tree11b4469c57da947e9aa7ab60c8063e85b21fc2ab
parent47fd807f9b62945600cb15409c46cc70d3b1fa97
x86_64-asm: =m operand fixes

The problem was with tcctest.c:

    unsigned set;
    __asm__("btsl %1,%0" : "=m"(set) : "Ir"(20) : "cc");

when with tcc compiled with the HAVE_SELINUX option, run with
tcc -run, it would use large addresses far beyond the 32bits
range when tcc did not use the pc-relative mode for accessing
'set' in global data memory.  In fact the assembler did not
know about %rip at all.

Changes:
- memory operands use (%rax) not (%eax)
- conversion from VT_LLOCAL: use type VT_PTR
- support 'k' modifier
- support %rip register
- support X(%rip) pc-relative addresses

The test in tcctest.c is from Michael Matz.
Makefile
i386-asm.c
i386-tok.h
tccasm.c
tccrun.c
tests/tcctest.c