[PATCH] D25011: [x86][inline-asm] Introducing (AVX512) k0-k7 registers for inline-asm usage
Matan via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 28 02:49:14 PDT 2016
mharoush created this revision.
mharoush added reviewers: delena, myatsina, rnk, echristo.
mharoush added a subscriber: cfe-commits.
mharoush set the repository for this revision to rL LLVM.
Herald added a subscriber: mehdi_amini.
This patch enables usage of k registers in inline assembly syntax.
Repository:
rL LLVM
https://reviews.llvm.org/D25011
Files:
lib/Basic/Targets.cpp
test/CodeGen/avx512-inline-asm-kregisters-basics.c
Index: lib/Basic/Targets.cpp
===================================================================
--- lib/Basic/Targets.cpp
+++ lib/Basic/Targets.cpp
@@ -2346,6 +2346,7 @@
"zmm8", "zmm9", "zmm10", "zmm11", "zmm12", "zmm13", "zmm14", "zmm15",
"zmm16", "zmm17", "zmm18", "zmm19", "zmm20", "zmm21", "zmm22", "zmm23",
"zmm24", "zmm25", "zmm26", "zmm27", "zmm28", "zmm29", "zmm30", "zmm31",
+ "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7",
};
const TargetInfo::AddlRegName AddlRegNames[] = {
Index: test/CodeGen/avx512-inline-asm-kregisters-basics.c
===================================================================
--- test/CodeGen/avx512-inline-asm-kregisters-basics.c
+++ test/CodeGen/avx512-inline-asm-kregisters-basics.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 %s -target-cpu skylake-avx512 -O0 -S -o - -Wall -Werror | FileCheck %s
+// This test checks basic inline assembly recognition of k0-k7 registers for avx512.
+
+void test_basic_inline_asm_with_k_regs() {
+ //CHECK: #APP
+ //CHECK: kandw %k1, %k2, %k3
+ //CHECK: #NO_APP
+ asm("kandw %k1, %k2, %k3\t");
+ //CHECK: #APP
+ //CHECK: kandw %k4, %k5, %k6
+ //CHECK: #NO_APP
+ asm("kandw %k4, %k5, %k6\t");
+ //CHECK: #APP
+ //CHECK: kandw %k7, %k0, %k1
+ //CHECK: #NO_APP
+ asm("kandw %k7, %k0, %k1\t");
+}
\ No newline at end of file
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25011.72787.patch
Type: text/x-patch
Size: 1364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160928/9fe05f92/attachment-0001.bin>
More information about the cfe-commits
mailing list