4

I remember having read about it somewhere… Could anyone shed some light on this?

Ryan Li
  • 9,020
  • 7
  • 33
  • 62

2 Answers2

4

According to Wiki, Pentium Pro. They are suprizingly old, and I wonder why do you still need a switch for GCC to use them.

ruslik
  • 14,714
  • 1
  • 39
  • 40
  • 1
    Thank you. Although Wikipedia is not Wiki. :-) – Ryan Li Dec 13 '10 at 14:07
  • I also read somewhere that `gcc` doesn't use cmov instructions by default, but my `gcc` does. – Ryan Li Dec 13 '10 at 14:13
  • 5
    Switch for GCC is needed because CMOV is quite limited in comparison to MOV. See what Linux kernel guys say: http://ondioline.org/mail/cmov-a-bad-idea-on-out-of-order-cpus – gertas Dec 13 '10 at 14:15
  • @gertas: yes you are right, I made a mistake. Sometimes I even need to add the optimization flag for it to use conditional moves. – Ryan Li Dec 13 '10 at 14:27
  • I don't know how bad `CMOV`s are but I see ICC emits conditional moves very often. One can check it on https://gcc.godbolt.org/ – phuclv Jun 30 '15 at 11:16
  • @gertas your link is dead. on mobile here, can't offer replacement. – z0rberg's May 27 '19 at 14:47
2

CMOV was introduced with Pentium Pro (commonly called i686)

gertas
  • 16,869
  • 1
  • 76
  • 58