Re: __builtin_constant_p and inline assembly constraints

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

 



 > 
 > But that __builtin_constant_p problem was because you put the call to
 > it in a function, not because of any other issues.  Why not put the
 > *whole lot* in a macro?  There's no need to break it into separate
 > functions.  Why was the function you had before not something like

Sorry, I meant in a single asm.  I just noticed this example has three asms.

 > 
 > #define puts(string)
 >  ({									\
 >   register unsigned long __v0 asm ("$2");				\
 >   __asm__ volatile (".set  push\n.set  noreorder\n");			\
 >   if (__builtin_constant_p (string))					\
 >     {									\
 >       __asm__ volatile (".long  0xfffd0000\n" ".long  %0\n"::"i,!r" (string)); \
 >     }									\
 >   else									\
 >     {									\
 >       __asm__ volatile (".short  0xfffe\n" ".short  %0\n"::"r" (string)); \
 >     };									\
 >   __asm__ volatile (".short 0xffff\t#" "puts" "\n\t"			\
 > 		    ".short %1\n":"=&r" (__v0):"i" (1));		\
 >   __asm__ volatile (".set\tpop\n");					\
 >   (int) __v0;								\
 >  })

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux