VS starting from VS2017 uses _M_ARM64
, see below for more details.
Answers, in reverse order:
None of the currently released Visual Studio versions support ARMv8/AArch64, they only support ARMv7. Even though Windows 10 itself shows signs of arm64 support (there's some executables and libraries for arm64), none of the versions of the compiler that have been released so far actually include it, to my knowledge. (Visual Studio 2015 Community at least doesn't include it, and neither does the new Visual Studio "15" Preview 2 that was released a few days ago.) So clearly it exists internally, but it hasn't been made part of any public release yet.
As for what define to look for; this is currently unknown, since there's no public documentation for the arm64 target version of the compiler since it's not been released yet, and one can't test empirically either.
I don't see any clear statement from Microsoft in either of your links saying that it will be supported, but at least the Windows 10 SDK does show clear signs of it being worked on.
Edit:
Even though the compiler isn't available, the Windows 10 SDK (which itself contains libs for ARM64) headers and Visual C++ 2015 headers (which have no matching ARM64 libs) also contains references to this. Similarly to _M_ARM
, there's also _M_ARM64
. A snippet from vc/include/intrin.h
:
#if defined (_M_ARM)
#include <armintr.h>
#include <arm_neon.h>
#endif
#if defined (_M_ARM64)
#include <arm64intr.h>
#include <arm64_neon.h>
#endif
Edit2:
While no public version of the Visual C++ compiler targeting arm64 is available yet, clang is getting the first parts of support for Windows/arm64, and they also use _M_ARM64
:
https://github.com/llvm-project/clang/commit/5b7d7d2b2d0bd7054f51b9d108cdd5299a0ec33e#diff-ed544af3ae6807a8513b1cabb3233941R6576
Edit3:
With the latest update of Visual Studio 2017, version 15.4, the ARM64 compiler is released. In the installer, one can manually check the "Visual C++ compilers and libraries for ARM64" item (it isn't enabled by default).
After doing that, you can launch "Developer Command Prompt for VS 2017", and in that shell run "vsdevcmd -arch=arm64 -host_arch=amd64", then you've got the compiler in the path:
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.4.0
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
C:Program Files (x86)Microsoft Visual Studio2017Community>vsdevcmd -arch=arm64 -host_arch=amd64
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.4.0
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
C:Program Files (x86)Microsoft Visual Studio2017Community>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25547 for ARM64
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
C:Program Files (x86)Microsoft Visual Studio2017Community>
And this compiler predefines _M_ARM64
which allows you to identify it, thus answering this question.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…