help-gplusplus
[Top][All Lists]
Advanced

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

not a valid base/index expression error with asm.


From: Vlad
Subject: not a valid base/index expression error with asm.
Date: Tue, 7 Jul 2009 16:00:50 -0700 (PDT)
User-agent: G2/1.0

Trying to compile Drepper's brunch prediction macro on Red hat Linux
(Intel) on g++ 4.1.1 or  3.4.6
with both -m32 and -m64 (similar error).

Getting an error:
/tmp/cc9ehdUj.s: Assembler messages:
/tmp/cc9ehdUj.s:163: Error: `..predictcnt59(,%al,4)' is not a valid
base/index expression


asm (".section predict_data, \"aw\"; .previous\n"
".section predict_line, \"a\"; .previous\n"
".section predict_file, \"a\"; .previous");

# ifdef __x86_64__
# define debugpred__(e, E) \
({ long int _e = !!(e); \
asm volatile (".pushsection predict_data\n" \
"..predictcnt%=: .quad 0; .quad 0\n" \
".section predict_line; .quad %c1\n" \
".section predict_file; .quad %c2; .popsection\n" \
"addq $1,..predictcnt%=(,%0,8)" \
: : "r" (_e == E), "i" (__LINE__), "i" (__FILE__)); \
__builtin_expect (_e, E); \
})
# elif defined __i386__
# define debugpred__(e, E) \
({ long int _e = !!(e); \
asm volatile (".pushsection predict_data\n" \
"..predictcnt%=: .long 0; .long 0\n" \
".section predict_line; .long %c1\n" \
".section predict_file; .long %c2; .popsection\n" \
"incl ..predictcnt%=(,%0,4)" \
: : "r" (_e == E), "i" (__LINE__), "i" (__FILE__)); \
__builtin_expect (_e, E); \
})
# endif

# define unlikely(expr) debugpred__ ((expr), 0)
# define likely(expr) debugpred__ ((expr), 1)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]