Performances on Mac OS X
Quoted 3 lines · Laurent Amon
I was wondering whether the implementation of qemu is tied to gcc or if it might be interesting to try to compile using IBM's compiler, which is able to generate Altivec code...
I have tried compiling qemu with xlc and it chokes on the asm. I believe that it uses a different syntax than gcc for this. I don't know what its syntax is, but if anybody does it shouldn't be too hard to make a patch which lets it compile.
Using xlc does seem to give substantially better performance than gcc, and not just on floating point code.
Cheers,
Josh.
Signature · 3 lines
Joshua Root | "Dream up the kind of world you want to live
| in. Dream out loud at high volume. That's
[email protected] | what we do for a living." - BonoQuoted 4 lines · Joshua Root
I have tried compiling qemu with xlc and it chokes on the asm. I believe that it uses a different syntax than gcc for this. I don't know what its syntax is, but if anybody does it shouldn't be too hard to make a patch which lets it compile.
For what it's worth, I've heard that Intel's compiler supports GCC's assembler syntax.
Signature · 3 lines
I love deadlines. I love the whooshing noise they make as they go by. --Douglas Adams
Re: [Qemu-devel] Intel compiler (was Re: Performances on Mac OS X)
FWIW, I'm experimenting with compiling QEMU under Windows (because my Linux install became officially screwed... Stupid Debian.) and the Intel compiler (I'm a sucker for performance :D), and it chokes at some GNUisms like __asm__ and whatnot.
Quoted 10 lines · Ben Pfaff
Quoted 4 lines · Joshua Root
I have tried compiling qemu with xlc and it chokes on the asm. I believe that it uses a different syntax than gcc for this. I don't know what its syntax is, but if anybody does it shouldn't be too hard to make a patch which lets it compile.
For what it's worth, I've heard that Intel's compiler supports GCC's assembler syntax.
--
"I invented the term Object-Oriented, and I can tell you I did not have C++ in mind"
Alan Kay
Quoted 8 lines · Joshua Root [[email protected]] wrote:
Quoted 5 lines · Laurent Amon
I was wondering whether the implementation of qemu is tied to gcc or if it might
be interesting to try to compile using IBM's compiler, which is able to generate
Altivec code...
Quoted 8 lines
I have tried compiling qemu with xlc and it chokes on the asm. I believe that it uses a different syntax than gcc for this. I don't know what its syntax is, but if anybody does it shouldn't be too hard to make a patch which lets it compile.
Using xlc does seem to give substantially better performance than gcc, and not just on floating point code.
xlc is picky with the source and takes FOREVER to compile with -O6. However, xlc is object compatible with gcc, so usually you just use xlc on core stuff that needs the speed, and gcc for everything else.
Compile everything with gcc, rm the object files you want to remake with xlc (based on profiling), edit the makefiles to use xlc and make again.
/Roine
Don't spend your time in using another compiler than gcc : most of the time is spent in the generated code, and the quality of this code relies on very small functions which are too simple for being optimized better.
Fabrice.
Quoted 31 lines · Roine Gustafsson
Quoted 12 lines · Joshua Root [[email protected]] wrote:
Quoted 4 lines · Laurent Amon
I was wondering whether the implementation of qemu is tied to gcc or if it might
be interesting to try to compile using IBM's compiler, which is able to generate Altivec code...I have tried compiling qemu with xlc and it chokes on the asm. I believe that it uses a different syntax than gcc for this. I don't know what its syntax is, but if anybody does it shouldn't be too hard to make a patch which lets it compile.
Using xlc does seem to give substantially better performance than gcc, and not just on floating point code.
xlc is picky with the source and takes FOREVER to compile with -O6. However, xlc is object compatible with gcc, so usually you just use xlc on core stuff that needs the speed, and gcc for everything else.
Compile everything with gcc, rm the object files you want to remake with xlc (based on profiling), edit the makefiles to use xlc and make again./Roine
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Still, there are the graphic routines (which are *painfully slow* when it goes to VESA mode; console is rather zippy!) and I'm positive the compiler can optimize FP instructions with SSE or something and/or reorder/reschedule/etc the instructions in order to ameliorate cache hits and whatnot.
I still believe it's not a complete waste of time.
Quoted 6 lines · Fabrice Bellard
Don't spend your time in using another compiler than gcc : most of the time is spent in the generated code, and the quality of this code relies on very small functions which are too simple for being optimized better.
Fabrice.
Signature · 2 lines
"A year spent in artificial intelligence is enough to make one believe in God" Alan J. Perlis
Quoted 5 lines · André Braga
Still, there are the graphic routines (which are *painfully slow* when it goes to VESA mode; console is rather zippy!) and I'm positive the compiler can optimize FP instructions with SSE or something and/or reorder/reschedule/etc the instructions in order to ameliorate cache hits and whatnot.
FP is not used in QEMU except for the CPU emulation itself, so expect no gain. About VESA with the Cirrus VGA card, the code just needs to be optimized !
Fabrice.
What if QEMU uses smarter FP code (for a given architecture) when emulating the CPU itself? Like always using SSE2, since they have their own registers, instead of going to the stack of the 387 unit? Ain't that smarter?
About VESA: one can never have too many compiler optimizations :D Faster is always good in emulation, and if you can have gains by just switching compilers, why not use this?
I promise I'll look into the VESA code some time. I'm in love with QEMU, you know ;D
Quoted 6 lines · Fabrice Bellard
FP is not used in QEMU except for the CPU emulation itself, so expect no gain. About VESA with the Cirrus VGA card, the code just needs to be optimized !
Fabrice.
Signature · 2 lines
"Logic: merely enables one to be wrong with authority" Doctor Who
Quoted 3 lines · André Braga
About VESA: one can never have too many compiler optimizations :D
Bugs. Curly, erratic, hard to track down bugs. Enough said.
Signature · 1 line
When life hands you lemons, ask for a bottle of gin and tonic.
Quoted 3 lines · André Braga
I promise I'll look into the VESA code some time. I'm in love with QEMU, you know ;D
I haven't had a look at the graphic code, but I would say that the best optimization would be to write the emulation for a video card that has as much hardware acceleration as possible and write the code to map directly to corresponding hi-level routines in the host OS as possible. Major stuff, if you ask me.
Lga.
That surely is the best optimization. However, a less ambitious goal would be redoing the SDL backend because I'm positive it can be done better. Just look at how many games manage to eat gobs of CPU time (like an emulator does) and still have responsive graphics under SDL...
I might be talking off my butt here, but I believe there is a lot of room for improvement. I'm starting with the easy things (compiler optimizations) before I put my furry claws on it. :)
Quoted 6 lines · Laurent Amon
I haven't had a look at the graphic code, but I would say that the best optimization would be to write the emulation for a video card that has as much hardware acceleration as possible and write the code to map directly to corresponding hi-level routines in the host OS as possible. Major stuff, if you ask me.
--
"Wherever you go, There you are"
Buckaroo Banzai
Quoted 1 line · Fabrice Bellard
Don't spend your time in using another compiler than gcc : most of the time is spent in the generated code, and the quality of this code relies on very small functions which are too simple for being optimized better.
What if more than one instruction worth of C were chained together before being compiled? Would that make more optimisable code? Could this even be done at runtime? Translation time would be greatly increased of course, making caching even more important.
Is this technically feasible? Or would my time be better spent writing a hand optimised code translator? ;)
Cheers,
Josh
Quoted 10 lines · Joshua Root
Quoted 4 lines · Fabrice Bellard
Don't spend your time in using another compiler than gcc : most of the time is spent in the generated code, and the quality of this code relies on very small functions which are too simple for being optimized better.
What if more than one instruction worth of C were chained together before being compiled? Would that make more optimisable code? Could this even be done at runtime? Translation time would be greatly increased of course, making caching even more important.
This sounds like HotSpot for qemu. Within qemu, how much work would it take to retranslate after profiling execution, like HotSpot server does? I've looked a bit, but I get lost in all the macros. Where would someone start looking to understand the translation process?
Where would one look to start on SMP support both for the guest and the host?
Joe
Quoted 4 lines · Joe Batt
This sounds like HotSpot for qemu. Within qemu, how much work would it take to retranslate after profiling execution, like HotSpot server does? I've looked a bit, but I get lost in all the macros. Where would someone start looking to understand the translation process?
I think there is room for some interesting tricks here, and not just in runtime optimization.