[llvm-bugs] [Bug 32727] New: Inline assembly, sha256rnds2 and "error: invalid input constraint 'Yz' in asm"

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 20 15:06:52 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=32727

            Bug ID: 32727
           Summary: Inline assembly, sha256rnds2 and "error: invalid input
                    constraint 'Yz' in asm"
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: noloader at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

skylake $ cat test.cxx
#include <immintrin.h>
int main(int argc, char* argv[])
{
    __m128i a, b, c;
    asm ("sha256rnds2 %2, %1, %0" : "+x"(a) : "xm"(b), "Yz" (c));
}

skylake $ clang++ test.cxx -c
test.cxx:5:56: error: invalid input constraint 'Yz' in asm
    asm ("sha256rnds2 %2, %1, %0" : "+x"(a) : "xm"(b), "Yz" (c));
                                                       ^
1 error generated.

According to Intel, the operand labeled 'c' must be placed in %xmm0 [1].
According to GCC and manual page on machine constraints [2], the constraint is
"Yz". From [1]:

The third input to sha256rnds2 is the message dwords (Wn) added to the round
constants (Kn).  This W+K value must be in the architectural XMM0 register,
since the register is implicitly used by the instruction.

$ clang++ --version
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-unknown-linux-gnu

$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description:    Fedora release 25 (Twenty Five)

[1] https://software.intel.com/en-us/articles/intel-sha-extensions

[2] https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170420/1a843fac/attachment.html>


More information about the llvm-bugs mailing list