Re:Interviewing programmers: coding test example explained
by loup-vaillant on Thursday June 03, 2010 @05:04PM
(#1402546)
Gasp! I thought it would be easy to just transfer the compare flag to a general purpose register. I suppose x86 doesn't have such an instruction?
[ Parent
| on HN ]
Re:Interviewing programmers: coding test example explained
by Daniel_Newby on Thursday June 03, 2010 @06:00PM
(#1402752)
I lied! A quick test shows that GCC uses the x86 SETE instruction (set register on condition equal). Cool.
However, code like this:
if (x == 14) {
y = 10;
} else {
y = 20;
}
uses branches, although I think x86-64 has conditional load instructions.