ASM is going to die soon for me.
Most of the time, the same can be done with compiler intrinsics which are now pretty fine (sometimes the difference is less than 5%) and have a lot of potential on scheduling (compiler have an high-level view of the asm code so can reshuffle) and portability (compiler may decide to use xmm8-15 on x86-64 if you''re targeting it).
As an additional plus, looks like MSVC.net 2003 does not support ASM for 64-bit targets (the arguments being that thing said above).
This is to tell you that no one should really think about learning ASM.
Not to mention the fact GCC and MSVC have very different conventions for that... porting the code is a pain.
Sure there''s still need for asm. Most OS writers will need it forever. CPUID is a nice asm instruction, just as RDTSC is... I''ll check if MSCV.net 2003 supports intrinsics for that.
By the way, ASM is getting dropped even for GPUs as everyone knows.
Assembly : When is it worth your time?
i would bet that i if had Sim City 4 right now that i would be able to run it with max settings.
3.4 Ghz @ 800 FSB w/L3 Cache, 2GB DDR RAM
GPU: GeForceFX 5900 256 DDR RAM
3.4 Ghz @ 800 FSB w/L3 Cache, 2GB DDR RAM
GPU: GeForceFX 5900 256 DDR RAM
heh
I only use assembler when it''s needed.
You use assembler when building a compiler.
I never really managed to get my hand rolled SSE code to run much better than compiled code in C++, it is very tricky at best. I have to read the Intel manual sometime and find out if there is any useful info on it to help.
Peace
You use assembler when building a compiler.
I never really managed to get my hand rolled SSE code to run much better than compiled code in C++, it is very tricky at best. I have to read the Intel manual sometime and find out if there is any useful info on it to help.
Peace
quote: Original post by Raduprv
I would really disagree that a compiler can produce equal or better ASM code, compared to a good ASM programmer.
I wonder whether you can judge that. I doubt it.
_________karx11erxVisit my Descent site or see my case mod.
Of course I can. I made tests.
A well written ASM program can be even one order of magnitude faster than the equivalent C program. But usually ASM it''s ''only'' twice as fast. Of course, for an OpenGL program it won''t really matter, since most of the CPU time is spent waiting for the GPU, or waiting for the PCI/AGP bus.
But for a server the difference is clearly noticeable.
A well written ASM program can be even one order of magnitude faster than the equivalent C program. But usually ASM it''s ''only'' twice as fast. Of course, for an OpenGL program it won''t really matter, since most of the CPU time is spent waiting for the GPU, or waiting for the PCI/AGP bus.
But for a server the difference is clearly noticeable.
quote: Original post by Raduprv
Of course I can. I made tests.
A well written ASM program can be even one order of magnitude faster than the equivalent C program.
You want to say that a good asm programmer can get a code 10 times faster than a c compiler can produce? If that would be possible, everyone would go back to assembly!
Why assembly can be faster manually programmed is because of that the programmer knows the problem and can optimize for the problem. But if he would know c as good as he must know assembly to optimize (-> the "equivalent" c program), the difference would shrink.
And - of course: use a good compiler!
Greetings, Jake
x = rx ( 1 - x ) ; r > 3.5699
... and chaos may begin ...
x = rx ( 1 - x ) ; r > 3.5699... and chaos may begin ...
quote: Original post by Raduprv
Of course I can. I made tests.
A well written ASM program can be even one order of magnitude faster than the equivalent C program. But usually ASM it''s ''only'' twice as fast.
You do know that your compiler produces ASM better then most people who know asm, right? Please read karx11erx''s first post.
"Of course I can. I made tests." tests on what? sorry to tell you this, but asm is NOT uber fast compared to C/C++.
Use asm only when needed, otherwise USE YOUR COMPILER, thats what its there for!
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
I''d be curious to see your tests, any proof to show ? Not to say assembler cannot go faster than a compiler, for sure, but i would expect differences in the order of 10-25% max, not 100-1000%!
If you really got a 10x difference, it''s more likely that your two programs were functionnaly not equivalent.
Y.
If you really got a 10x difference, it''s more likely that your two programs were functionnaly not equivalent.
Y.
It''s being told, that computer will never be so good as human programmer. Means - the compiler can''t produce better code than good assembly programmer. However - I don''t think many noobs would like to learn assembly nowadays. And, also, the big game companies don''t want to spend their programmer''s time to write the code in assembly (programming in assembly is a lot slower - no doubt).
I think, it is good to know the assembly, because you learn how the computer really works - at least it is interesting. So - if you have the time - learn it. If you just want to write fast code - learn how to use the compiler switches =).
Oxyd
- Unreadable code is code written on a piece of paper, but not the one, in which the programmer is using a space in the place you don''t.
- Real programmers aren''t afraid of goto
I think, it is good to know the assembly, because you learn how the computer really works - at least it is interesting. So - if you have the time - learn it. If you just want to write fast code - learn how to use the compiler switches =).
Oxyd
- Unreadable code is code written on a piece of paper, but not the one, in which the programmer is using a space in the place you don''t.
- Real programmers aren''t afraid of goto
quote: Original post by Oxyd Means - the compiler can''t produce better code than good assembly programmer.
That may be true a few years ago, but with genetic compilers; i think that commment is going to be false very soon.
Learn C++. its hard, but it works.
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement