<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Floating Point ABI in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Floating-Point-ABI/m-p/982621#M26431</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I noticed in the latest CilkPlus ABI specification (https://www.cilkplus.org/sites/default/files/open_specifications/CilkPlusABI_1.1.pdf), it says that the caller to the library must set the floating point flags (top of page 8). This is what the LLVM implementation of CilkPlus and its runtime do, but the current Intel version of the run-time has the code to save the floating point status registers that is in LLVM's code generator and not the runtime from the LLVM repository. Please could you tell me whether:&lt;BR /&gt;
	a) The floating point status flags should be set/saved by the caller&lt;BR /&gt;
	b) The floating point status flags should be set/saved by the callee&lt;BR /&gt;
	c) There's something I've overlooked&lt;/P&gt;

&lt;P&gt;The ABI says:&lt;BR /&gt;
	"/**&lt;/P&gt;

&lt;DIV data-angle="0" data-canvas-width="112.00000333786012" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 184.667px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;* Architecture&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="7.968000237464906" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 248.027px; top: 184.667px; transform: rotate(0deg) scale(0.996, 1); transform-origin: 0% 0% 0px;"&gt;-&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="456.00001358985907" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 256.027px; top: 184.667px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;specific floating point state. mxcsr and fpcsr should be&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="552.0000164508821" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 199.867px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;* set when CILK_SETJMP is called in client code. Note that the Win64&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="568.0000169277192" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 214.907px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;* jmpbuf for the Intel64 architecture already contains this information&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="168.0000050067902" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 230.107px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;* so there is no need&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="352.00001049041754" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 312.067px; top: 230.107px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;to use these fields on that OS/architecture.&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;*/"&lt;BR /&gt;
	&lt;BR /&gt;
	The Intel runtime has:&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;__asm__ ( "stmxcsr %0\n\t"&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; "fnstcw %1" : : "m" ((sf).mxcsr), "m" ((sf).fpcsr));");&lt;BR /&gt;
	The LLVM runtime does not have this, but the CilkPlus specific file in the LLVM code generator has equivalent code.&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;Thanks&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;Nick Tomlinson&lt;/DIV&gt;</description>
    <pubDate>Wed, 12 Feb 2014 12:30:49 GMT</pubDate>
    <dc:creator>Nick_T_</dc:creator>
    <dc:date>2014-02-12T12:30:49Z</dc:date>
    <item>
      <title>Floating Point ABI</title>
      <link>https://community.intel.com/t5/Software-Archive/Floating-Point-ABI/m-p/982621#M26431</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I noticed in the latest CilkPlus ABI specification (https://www.cilkplus.org/sites/default/files/open_specifications/CilkPlusABI_1.1.pdf), it says that the caller to the library must set the floating point flags (top of page 8). This is what the LLVM implementation of CilkPlus and its runtime do, but the current Intel version of the run-time has the code to save the floating point status registers that is in LLVM's code generator and not the runtime from the LLVM repository. Please could you tell me whether:&lt;BR /&gt;
	a) The floating point status flags should be set/saved by the caller&lt;BR /&gt;
	b) The floating point status flags should be set/saved by the callee&lt;BR /&gt;
	c) There's something I've overlooked&lt;/P&gt;

&lt;P&gt;The ABI says:&lt;BR /&gt;
	"/**&lt;/P&gt;

&lt;DIV data-angle="0" data-canvas-width="112.00000333786012" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 184.667px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;* Architecture&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="7.968000237464906" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 248.027px; top: 184.667px; transform: rotate(0deg) scale(0.996, 1); transform-origin: 0% 0% 0px;"&gt;-&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="456.00001358985907" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 256.027px; top: 184.667px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;specific floating point state. mxcsr and fpcsr should be&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="552.0000164508821" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 199.867px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;* set when CILK_SETJMP is called in client code. Note that the Win64&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="568.0000169277192" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 214.907px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;* jmpbuf for the Intel64 architecture already contains this information&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="168.0000050067902" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 230.107px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;* so there is no need&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="352.00001049041754" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 312.067px; top: 230.107px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;to use these fields on that OS/architecture.&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;*/"&lt;BR /&gt;
	&lt;BR /&gt;
	The Intel runtime has:&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;__asm__ ( "stmxcsr %0\n\t"&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; "fnstcw %1" : : "m" ((sf).mxcsr), "m" ((sf).fpcsr));");&lt;BR /&gt;
	The LLVM runtime does not have this, but the CilkPlus specific file in the LLVM code generator has equivalent code.&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;Thanks&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV data-angle="0" data-canvas-width="16.00000047683716" data-font-name="g_font_58_0" dir="ltr" style="font-size: 13.28px; font-family: monospace; left: 136.027px; top: 245.147px; transform: rotate(0deg) scale(1, 1); transform-origin: 0% 0% 0px;"&gt;Nick Tomlinson&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Feb 2014 12:30:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Floating-Point-ABI/m-p/982621#M26431</guid>
      <dc:creator>Nick_T_</dc:creator>
      <dc:date>2014-02-12T12:30:49Z</dc:date>
    </item>
    <item>
      <title>ABI V1 requires that the</title>
      <link>https://community.intel.com/t5/Software-Archive/Floating-Point-ABI/m-p/982622#M26432</link>
      <description>&lt;P&gt;ABI V1 requires that the floating point state&amp;nbsp;be preserved before the setjmp call. This allows us to restore it on a steal so that if some aspect of floating point handling has been changed we can handle it properly. Ideally the instructions to do this should be inlined by the compiler when it generates the setjmp call, as the Intel compiler does.&lt;/P&gt;

&lt;P&gt;We added a function to save the floating point state for those cases where it's difficult to add the instructions.&amp;nbsp;If that function is missing from the LLVM repository, we need to update that version. If you need a version immediately, you can use the latest version at &lt;A href="https://www.cilkplus.org/download#runtime-sources"&gt;https://www.cilkplus.org/download#runtime-sources&lt;/A&gt;&amp;nbsp;. While it doesn't have the gmake files, it should be compatible with the version bundled with the LLVM distribution.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; - Barry&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2014 16:23:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Floating-Point-ABI/m-p/982622#M26432</guid>
      <dc:creator>Barry_T_Intel</dc:creator>
      <dc:date>2014-02-12T16:23:22Z</dc:date>
    </item>
    <item>
      <title>One more point.  I'm not sure</title>
      <link>https://community.intel.com/t5/Software-Archive/Floating-Point-ABI/m-p/982623#M26433</link>
      <description>&lt;P&gt;One more point. &amp;nbsp;I'm not sure if LLVM/CLang is generating ABI 0 or ABI 1 frames. &amp;nbsp;If it's generating ABI 0 frames, then it isn't required to save the floating point state, and in fact, there's nowhere to save it to.&lt;/P&gt;

&lt;P&gt;On the other hand, if it is generating ABI 1 frames, and it's not saving the floating point state, the runtime will attempt to restore that state (which is random trash from the stack) and likely generate an error.&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;- Barry&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2014 16:44:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Floating-Point-ABI/m-p/982623#M26433</guid>
      <dc:creator>Barry_T_Intel</dc:creator>
      <dc:date>2014-02-12T16:44:00Z</dc:date>
    </item>
  </channel>
</rss>

