Which is faster on most processors?
Posted: 01 Jun 2005, 18:49
I'm in the middle of ripping out all of the side to move dependent code in Monarch i.e. I'm writing a gen_moves() routine which combines gen_white_moves() and gen_black_moves().
As a result I have numerous code such as:
Where color is 1 for white and 0 for black. My question is - on most processors which is faster, (color << 5) or (color * 32). I doubt there is much in it and I'm not an assembler expert. Can anyone advise?
Thanks,
Steve
As a result I have numerous code such as:
- Code: Select all
board->ep_square = from_square - 16 + (color << 5)
Where color is 1 for white and 0 for black. My question is - on most processors which is faster, (color << 5) or (color * 32). I doubt there is much in it and I'm not an assembler expert. Can anyone advise?
Thanks,
Steve