[cxx-abi-dev] patch to C++ ABI doc for decimal float classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cxx-abi-dev] patch to C++ ABI doc for decimal float classes



This patch to the C++ ABI document provides exceptions to the usual
function calling convention and mangling rules to treat the decimal
classes defined in TR 24733 the same as the corresponding native
scalar types.  Please consider it and, if it's acceptable, apply it.

Janis Johnson

--- abi.html.orig	2009-10-13 15:36:16.000000000 -0700
+++ abi.html	2009-10-13 15:46:08.000000000 -0700
@@ -2577,7 +2577,12 @@
 <p>
 In general, C++ value parameters are handled just like C parameters.
 This includes class type parameters passed wholly or partially in registers.
-However, in the special case where the parameter type has a non-trivial
+There are, however, some special cases.
+</p><ol type="1">
+<p>
+</p><li>
+<p>
+In the special case where the parameter type has a non-trivial
 copy constructor or destructor,
 the caller must allocate space for a temporary copy,
 and pass the resulting copy by reference (below).
@@ -2622,7 +2627,16 @@
 If necessary (e.g. if the parameter was allocated on the heap),
 the caller deallocates space after return and destruction.
 
+<p></p> </li></ul>
+<li>
+In the case where the parameter type is class
+<code>std::decimal::decimal32</code>, <code>std::decimal::decimal64</code>,
+or <code>std::decimal::decimal128</code> as defined in TR 24733, the
+parameter is passed the same as the corresponding native decimal
+floating-point scalar type.
+<p></p>
 </li></ul>
+</ol>
 
 
 <p>
@@ -2663,6 +2677,12 @@
 The callee constructs the return value into this temporary.
 
 </p><p>
+Another exception is that a return value type of class
+<code>std::decimal::decimal32</code>, <code>std::decimal::decimal64</code>,
+or <code>std::decimal::decimal128</code> as defined in TR 24733 is returned
+the same as the corresponding native decimal floating-point scalar type.
+
+</p><p>
 A result of an empty class type will be returned as though it were
 a struct containing a single char,
 i.e. <code>struct S { char c; };</code>.
@@ -4343,6 +4363,13 @@
   &lt;class-enum-type&gt; ::= &lt;name&gt;
 </font></code></pre>
 
+<p>
+An exception, however, is that class <code>std::decimal::decimal32</code>,
+<code>std::decimal::decimal64</code>, or <code>std::decimal::decimal128</code>
+as defined in TR 24733 uses the same encoding as the corresponding native
+decimal-floating point scalar type.
+
+</p><p>
 Unnamed class, union, and enum types that aren't closure types, that
 haven't acquired a "name for linkage purposes" (through a typedef), and
 that aren't anonymous union types, follow