Skip to main content
Engineering LibreTexts

18.7: Floating-Point Calling Conventions

  • Page ID
    58428
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    The standard calling conventions detailed in Chapter 12, Functions still fully apply. This section addresses the usage of the floating-point registers when calling floating- point functions.

    When using floating-point registers, none of the registers are preserved across a floating-point function call.

    The first eight (8) floating-point arguments are passed in floating-point registers xmm0 xmm7. Any additional arguments are placed on the stack in backwards order in the manner described in Chapter 12, Functions. A value returning floating-point function will return the result in xmm0.

    Since none of the floating-point registers are preserved, the code must be written carefully.


    18.7: Floating-Point Calling Conventions is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?