Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7492373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:25:33+00:00 2026-05-29T16:25:33+00:00

Since the ret instruction is an indirect call, does the ret instruction on x86

  • 0

Since the ret instruction is an indirect call, does the ret instruction on x86 stall the pipeline, or is it somehow optimized to behave like a more direct call?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:25:34+00:00Added an answer on May 29, 2026 at 4:25 pm

    From the Intel Optimization Reference Manual, the branch prediction unit contains a Return Stack Buffer precisely to predict ret instructions (section 2.2.2.1) more accurately. The instruction queueing and decode unit also tracks changes in the stack pointer to improve decoding bandwidth (section 2.2.2.5).

    In more detail, section 3.4.1.4 describes some “rules”, mostly directed to compiler writers, to benefit from inlining, calls & returns – the most relevant is probably that a near/far call must be paired with a near/far return, which means pushing the return address on the stack and jumping to the callee is not recommended. Also, the call depth is recommended to not exceed 16 nested calls (the size of the RSB).

    If those rules are followed, you can effectively treat them like indirect branches during branch selection (section 3.4.1.6), with everything that implies. You will most likely never encounter a stall on a ret, except on pathological cases or self-modifying code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

since memcpy should be highly optimized nowadays, does it still make sense to optimize
Since these IL codes what I see more, I like to learn how to
Since Intellij does not yet support the Play-Scala-Template-Engine I was thinking about using plain
I am currently playing around with x86 assembler since I wanted to refresh my
Since regular jQuery animations are not fluent on iOS ( .hide() , slideDown() ),
since today im facing a strange problem. When i start my app in my
Since I am developing an iOS >= 5.0 application, I am trying to change
Since REST is stateless, each request that comes in has no knowledge of the
Since now I have only used plugin for editing and the way I use
Since input and raw_input() stop the program from running anymore, I want to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.