{word dword} 8 bytes?

Started by
11 comments, last by Clash Rocker 22 years, 10 months ago
Its the same way on the PS2, except its 128 bits aligned because it has a 128bit proccessor. However, there are a lot of instructions that are 64bit, so it is possible (and faster) to feed it two of the 64bit instructions at the same time if you micro code it correctly. It runs faster and is really neat.

Things will always be faster if you pass the proccessor what I wants most. Which is why most bools are ints, because it is a lot faster. You could write a class to use just 1 bit, but then I''d reccommend making it a whole int and just representing each bit as its own bool. Oh well I''m just rambling now. :p
Advertisement
So as a general tip, it''s good to tell the compiler to align for 32 bits? Or do you get errors with non- Intel cpu''s then?

I think Lamoth says something about this in Tricks of the Game Programming Gurus, but I''m not sure



Humanity''s first sin was faith; the first virtue was doubt
Humanity's first sin was faith; the first virtue was doubt
As a general tip, it''s good to let the compiler do what it thinks is best. Most compilers will align to "natural alignment" by default. This is whatever alignment is best for the particular structure.

Unless you have a specific reason to change it, just leave the default as-is. For the vast majority of people the only reason to change it is because you need to match the memory layout of some structure that you didn''t define.

-Mike
-Mike

This topic is closed to new replies.

Advertisement