V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
doraos
V2EX  ›  问与答

[汇编] rep ret 相对 nop ret 有什么优势么

  •  
  •   doraos · Mar 7, 2019 · 2681 views
    This topic created in 2610 days ago, the information mentioned may be changed or developed.

    看一本书(CSAPP)上面说 AMD 推荐使用 rep ret 来接条件跳转 ret,既然是 rep 用作空指令,为什么不用 nop ret. 使用 rep ret 相对 nop ret 有什么优势么

    1 replies    2019-03-07 02:33:28 +08:00
    lcdtyph
        1
    lcdtyph  
       Mar 7, 2019 via iPhone   ❤️ 1
    nop; ret 是两条指令,然而
    rep ret 是一条指令
    后者更高效一些
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5322 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 01:19 · PVG 09:19 · LAX 18:19 · JFK 21:19
    ♥ Do have faith in what you're doing.