pea
developer
Hi all,
How does the GP32 handle bit-shifting, and how well does GCC do at optimising for them?
Shifts are supposed to be fast, right? But in some cases while benchmarking blitting routines, we came across instances where multiplication was faster.
Questions:
1) How expensive (CPU cycles) is a shift? (e.g. a>>1)
2) Is a large shift done in one step? (e.g. is a>>2 the same expense as a>>12)
3) If (2) is 'no', are certain shifts optimised? (e.g. is GP32 cpu optimised for >>8 or >>16 for example)
4) If (3) is 'yes' Does the compiler optimise long shifts? (e.g. a>>12 becomes a>>8 followed by a>>4)
Cheers!
How does the GP32 handle bit-shifting, and how well does GCC do at optimising for them?
Shifts are supposed to be fast, right? But in some cases while benchmarking blitting routines, we came across instances where multiplication was faster.
Questions:
1) How expensive (CPU cycles) is a shift? (e.g. a>>1)
2) Is a large shift done in one step? (e.g. is a>>2 the same expense as a>>12)
3) If (2) is 'no', are certain shifts optimised? (e.g. is GP32 cpu optimised for >>8 or >>16 for example)
4) If (3) is 'yes' Does the compiler optimise long shifts? (e.g. a>>12 becomes a>>8 followed by a>>4)
Cheers!