From 4a3741bf02eb51c377312bdabc979e5ccbf5bf89 Mon Sep 17 00:00:00 2001 From: grischka Date: Sun, 20 Nov 2016 14:50:56 +0100 Subject: 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. --- i386-tok.h | 1 + 1 file changed, 1 insertion(+) (limited to 'i386-tok.h') diff --git a/i386-tok.h b/i386-tok.h index fde386f..17d17ce 100644 --- a/i386-tok.h +++ b/i386-tok.h @@ -35,6 +35,7 @@ DEF_ASM(rbp) DEF_ASM(rsi) DEF_ASM(rdi) + DEF_ASM(rip) #endif DEF_ASM(mm0) DEF_ASM(mm1) -- cgit v1.3.1