<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - __attribute__((pcs("aapcs-vfp"))) is not consistent"
   href="https://bugs.llvm.org/show_bug.cgi?id=39982">39982</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__attribute__((pcs("aapcs-vfp"))) is not consistent
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: ARM
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>srhines@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>kristof.beyls@arm.com, llvm-bugs@lists.llvm.org, peter.smith@linaro.org, Ties.Stuij@arm.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is from an internal Google bug, but really has to do with ARM backend
handling of aapcs-vfp. From that bug:

float __attribute__((pcs("aapcs-vfp"))) baz(float x, float y) {
    return y;
}

struct S {
     float f;
     float d;
};

float __attribute__((pcs("aapcs-vfp"))) foo(S s) {
    return s.d;
}

float __attribute__((pcs("aapcs"))) bar(S s) {
    return s.d;
}


Compilation in hard-fp mode produces expected output (
<a href="https://godbolt.org/z/SdXIsN">https://godbolt.org/z/SdXIsN</a> ):

baz(float, float):
  vmov.f32 s0, s1
  bx lr
foo(S):
  vmov.f32 s0, s1
  bx lr
bar(S):
  mov r0, r1
  bx lr

Compilation in soft-fp mode produces very strange output (
<a href="https://godbolt.org/z/HVVDtj">https://godbolt.org/z/HVVDtj</a> ):

baz(float, float):
  vmov.f32 s0, s1
  bx lr
foo(S):
  vmov s0, r1
  bx lr
bar(S):
  mov r0, r1
  bx lr

It looks as if "foo" function uses hard-fp mode for result but soft-fp for
input.

Unfortunatelly vulkan uses pcs("aapcs-vfp") thus we couldn't just ignore that
issue (even if it looks as if currently vulkan does not suffer from that issue
- there very few functions with float arguments and they all are compiled
identically in hardfp and pcs("aapcs-vfp") modes).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>