Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Variants  





2 References  





3 External links  














FCMOV







Add links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


FCMOV is a floating point conditional move opcode of the Intel x86 architecture, first introduced in Pentium Pro processors. It copies the contents of one of the floating point stack register, depending on the contents of EFLAGS integer flag register, to the ST(0) (top of stack) register. There are 8 variants of the instruction selected by the condition codes that need be set for the instruction to perform the move.

Similar to the CMOV instruction, FCMOV allows some conditional operations to be performed without the usual branching overhead.[1] However, it has a higher latency than conditional branch instructions.[2] Therefore, it is most useful for simple yet unpredictable comparison or conditional operations, where it can provide substantial performance gains.

The instruction is usually used with the FCOMI instruction or the FCOM-FSTSW-SAHF idiom to set the relevant condition codes based on the result of a floating point comparison.

Variants[edit]

This table shows the variants of the FCMOV instructions.[1] The first operand is always the ST(0) register (equivalently, the top of the floating point stack). The Opcode column indicates a two-byte sequence where the second byte is a base value indicating the number of the floating point stack register to use for the second operand. Add the desired number to complete the corresponding opcode value.

Opcode Mnemonic Meaning Condition
DA C0+i FCMOVB Move if below Carry flag set
DA C8+i FCMOVE Move if equal Zero flag set
DA D0+i FCMOVBE Move if below or equal Carry flag or Zero flag set
DA D8+i FCMOVU Move if unordered Parity flag set
DB C0+i FCMOVNB Move if not below Carry flag cleared
DB C8+i FCMOVNE Move if not equal Zero flag cleared
DB D0+i FCMOVNBE Move if not below or equal Carry flag and Zero flag cleared
DB D8+i FCMOVNU Move if not unordered Parity flag cleared

References[edit]

  1. ^ a b Intel Architecture Software Developer Manual, Volume 2: Instruction Set Reference. Available for download at [1]
  • ^ Fog, A: Optimizing subroutines in assembly language. An optimization guide for x86 platforms. Available for download at [2]
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=FCMOV&oldid=1131546924"

    Category: 
    X86 instructions
     



    This page was last edited on 4 January 2023, at 17:01 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki