Sign in to follow this  
Chadivision

Compiling SSE assembler with VC++ 6.0

Recommended Posts

I just bought the book "3D Game Engine Programming". Apparently there were some problems with the code on the CD, so I followed the instructions at http://stefan.zfx.info/3dgep.html, but I'm still having some problems. Chapter 4 has some code written in SSE assembler and I couldn't get it to compile correctly. I am using VC++ 6.0 professional with Service pack 6 installed. My operating system is XP with service pack 2. As far as I know I should be able to compile the SSE code, but I'm still getting errors. Does anyone have any ideas. The sample code on the CD also includes the same math functions written in C++, so if I can't get the SSE to work I could use that, but it wouldn't be nearly as fast.

Share this post


Link to post
Share on other sites
Dont have the book... so I haven't seen the code....
If its using intrinisic functions, you might need to download the processor pack for VS 6 from MS. other than that, ASM code can be placed right in your code using __asm blocks. Its pretty straightfoward.

You were a little too vague in describing the problems you were having, so thats the best I can help :(

Share this post


Link to post
Share on other sites
you must have service pack 5. sp6 does not work with the processor pack (the processor pack adds the SSE stuff to VS6):

http://msdn.microsoft.com/vstudio/downloads/tools/ppack/default.aspx

Share this post


Link to post
Share on other sites
You need processor pack 5. Processor pack 5 requires service pack 5. If you've installed service pack 6 you're screwed. They haven't, and have no plans to, release a processor pack that's compatible with SP6.

Uninstall VC6, reinstall, install SP5, and PP5... or grab the VS.Net 2005 beta. It's free but expires in January. You could also try the command line only VC++.Net Pro compiler, which is also a free download.

Share this post


Link to post
Share on other sites
I'm sorry that I can't post the code. It's not my code. It's straight out of the book and the publisher would probably frown upon me posting it here.

Basically it checks the processor at runtime and loads different versions of the math functions from a dll, depending upon whether your processor supports SSE2, SSE, or MMX. I just checked Intel.com and apparently my processor does not support SSE, but it does support MMX. It won't be nearly as fast as SSE, but I should be able to get the MMX code working.

I just assumed that I wanted the latest service pack, but from what you're telling me I need to uninstall/reinstall, and then install service pack 5 and processor pack 5. It sounds like that should solve the problem, but for some reason I can't find processor pack 5 on microsoft.com. I searched the download sections for VC++ and Visual Studio with the keyword "processor" and I got zero matches. I tried "pp5" and I still got zero matches.

Does anyone have a link to processor pack 5? I downloaded service pack 5, but I want to make sure I have everything I need before I uninstall VC++.

Assuming I get the proper service pack and processor pack installed, am I correct in assuming that I should be able to compile SSE and SSE2 code? I realize that I won't be able to run it on my PC, but can I compile it on my PC and run it on a PC with a processor that supports SSE or SSE2?

I'm brand new to assembly language (other than very outdated 6502 assembly), so I appreciate you tolerating my ignorance on the subject.

Share this post


Link to post
Share on other sites
Never mind the link to the processor pack. I found it. I just remembered that there is this magical thing called "Google" that helps you find things on the net. I don't know why I didn't think to check there first. Maybe I need more sleep.

I think the processor pack should fix my problems (or at least the programming related ones).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this