[llvm-bugs] [Bug 51128] New: clang-cl --target=arm64-pc-windows-msvc doesn't support __umulh needed by WinSDK 10.0.20348.0

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 17 21:36:53 PDT 2021


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

            Bug ID: 51128
           Summary: clang-cl --target=arm64-pc-windows-msvc doesn't
                    support __umulh needed by WinSDK 10.0.20348.0
           Product: new-bugs
           Version: 12.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: sfinae at hotmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Here's how I reproed this (there may be a simpler way). Install VS 2022 17.0
Preview 2. After choosing the "Desktop development with C++" workload,
customize it:

* Select the "C++ Clang tools for Windows" (containing Clang 12)
* Select the "MSVC v142 - VS 2019 C++ ARM64 build tools (Latest)" (slightly
misnamed; this is the VS 2022 compiler)
* Unselect the default WinSDK 10.0.19041.0
* Select the latest "Windows 10 SDK (10.0.20348.0)"

This setup (Clang 12 + latest WinSDK) works for x86, x64, and ARM (32-bit) in
the microsoft/STL test suite; however, we encountered an incompatibility on
ARM64 due to the new WinSDK attempting to use the __umulh intrinsic, which
works for MSVC but not Clang 12. Self-contained test case, starting from a
clean command prompt:

C:\Temp>"C:\Program Files\Microsoft Visual
Studio\2022\Preview\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.0.0-pre.2.0
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64_arm64'

C:\Temp>type meow.cpp
#include <Windows.h>

C:\Temp>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.30.30401 for ARM64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

C:\Temp>cl /EHsc /nologo /W4 /c meow.cpp
meow.cpp

C:\Temp>clang-cl --target=arm64-pc-windows-msvc --version
clang version 12.0.0
Target: arm64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\Microsoft Visual
Studio\2022\Preview\VC\Tools\Llvm\x64\bin

C:\Temp>clang-cl --target=arm64-pc-windows-msvc /EHsc /nologo /W4 /c meow.cpp
In file included from meow.cpp:1:
In file included from C:\Program Files (x86)\Windows
Kits\10\\include\10.0.20348.0\\um\Windows.h:171:
In file included from C:\Program Files (x86)\Windows
Kits\10\\include\10.0.20348.0\\shared\windef.h:24:
In file included from C:\Program Files (x86)\Windows
Kits\10\\include\10.0.20348.0\\shared\minwindef.h:182:
C:\Program Files (x86)\Windows
Kits\10\\include\10.0.20348.0\\um\winnt.h(6370,20): error: use of undeclared
identifier
      '__umulh'
    *HighProduct = UnsignedMultiplyHigh(Multiplier, Multiplicand);
                   ^
C:\Program Files (x86)\Windows
Kits\10\\include\10.0.20348.0\\um\winnt.h(6236,30): note: expanded from macro
      'UnsignedMultiplyHigh'
#define UnsignedMultiplyHigh __umulh
                             ^
1 error generated.

-- 
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/20210718/953f4d21/attachment.html>


More information about the llvm-bugs mailing list