This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Inline assembly, clobber registers, ask for help


Hello,

There is an inline assembly routine (x86, converted from Intel syntax),
which has to be highly optimized. 
The routine is using basicly all available
registers(eax,ebx,ecx,edx,esi,edi), and have problems if I enable
optimizations. (O0 -> Ok, O1..03->error, gcc3.2)

I see the following solution, and would be interested in your comments
on these:

1) Simple convert to GCC-syntax with using predefined registers (easy to
maintain). Add some extra code for saving/loading registers (make gcc
happy) as I was suggested... Accept worse performance caused by this
extra operation...

2) Modify the code (hard to maintain parallel with the other
Intel-syntax code) and let gcc select/optimize registers...  
   Will this optimization problem disappear?
   The routine is using MMX/SSE2 instructions as well... Can gcc could
optimize the MMX/XMM registers as well?
 
And a question:
Which registers can be marked as clobbered registers? I tried eax, ebx
with success, but e.g. ecx caused a compilation error (~Register can't
be found within GENERAL_REGS). Which registers belongs to GENERAL_REGS?

Many thanks for all the tips, suggestions, comments,
Tamas



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]