Original Post
Hi, I seem to recall reading somewhere a way to perform the following with out branching...(Hopefully useful in tight loop) int val; int x; if (val) x = val; Thanks
while(some_condition){ if(some_condition_which_doesn't_change) do_something; else do_something_else;}if(some_condition_which_doesn't_change){ while(some_condition) do_something;}else{ while(some_condition) do_something_else;}Quote:
Original post by lokki
Hi,
I seem to recall reading somewhere a way to perform the following with out branching...(Hopefully useful in tight loop)
int val;
int x;
if (val) x = val;
Thanks
Quote:
Original post by Promit
Does Pentium Pro mean i586 with MMX?
Quote:
-march=cpu-type
Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mtune. Moreover, specifying -march=cpu-type implies -mtune=cpu-type.
-mtune=cpu-type
Tune to cpu-type everything applicable about the generated code, except for the ABI and the set of available instructions. The choices for cpu-type are:
- i386
Original Intel's i386 CPU.- i486
Intel's i486 CPU. (No scheduling is implemented for this chip.)- i586, pentium
Intel Pentium CPU with no MMX support.- pentium-mmx
Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.- i686, pentiumpro
Intel PentiumPro CPU.- pentium2
Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.- pentium3
Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set support.- pentium4
Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
Quote:
(Fruny)
If your compiler optimizes properly, it should issue a conditional move instruction instead of a branch, without you doing anything fancy in the source code.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more