Skip to content

Commit cd6090f

Browse files
committed
review2
1 parent cc1141a commit cd6090f

File tree

7 files changed

+18
-17
lines changed

7 files changed

+18
-17
lines changed

clang/lib/Headers/amxmovrstransposeintrin.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/* ===--- amxmovrstransposeintrin.h - AMX_MOVRS_TRANSPOSE intrinsics -*- C++
2-
* -*---------===
1+
/* ===--- amxmovrstransposeintrin.h - AMX_MOVRS_TRANSPOSE intrinsics --------===
32
*
43
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
54
* See https://llvm.org/LICENSE.txt for license information.

clang/lib/Headers/immintrin.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,10 @@ _storebe_i64(void * __P, long long __D) {
658658

659659
#if !defined(__SCE__) || __has_feature(modules) || defined(__AMX_MOVRS__)
660660
#include <amxmovrsintrin.h>
661+
#endif
662+
663+
#if !defined(__SCE__) || __has_feature(modules) || \
664+
(defined(__AMX_MOVRS__) && defined(__AMX_TRANSPOSE__))
661665
#include <amxmovrstransposeintrin.h>
662666
#endif
663667

clang/test/CodeGen/X86/amx_movrs_errors.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4
22
// RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown \
3-
// RUN: -target-feature +amx-int8 -target-feature +amx-bf16 \
4-
// RUN: -target-feature +amx-element -verify
3+
// RUN: -target-feature +amx-movrs -verify
54

65
#include <immintrin.h>
76
#include <stddef.h>

llvm/lib/Target/X86/X86.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ def FeatureAMXFP8 : SubtargetFeature<"amx-fp8", "HasAMXFP8", "true",
274274
"Support AMX-FP8 instructions",
275275
[FeatureAMXTILE]>;
276276
def FeatureAMXMOVRS : SubtargetFeature<"amx-movrs", "HasAMXMOVRS", "true",
277-
"Support AMX-MOVRS instructions",
278-
[FeatureAMXTILE]>;
277+
"Support AMX-MOVRS instructions",
278+
[FeatureAMXTILE]>;
279279
def FeatureAMXTRANSPOSE : SubtargetFeature<"amx-transpose", "HasAMXTRANSPOSE", "true",
280280
"Support AMX amx-transpose instructions",
281281
[FeatureAMXTILE]>;

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5343,7 +5343,7 @@ void X86DAGToDAGISel::Select(SDNode *Node) {
53435343
case Intrinsic::x86_t2rpntlvwz0rst1:
53445344
case Intrinsic::x86_t2rpntlvwz1rs:
53455345
case Intrinsic::x86_t2rpntlvwz1rst1:
5346-
if (!Subtarget->hasAMXTRANSPOSE() || !Subtarget->hasAMXMOVRS())
5346+
if (!Subtarget->hasAMXMOVRS())
53475347
break;
53485348
[[fallthrough]];
53495349
case Intrinsic::x86_t2rpntlvwz0:

llvm/lib/Target/X86/X86InstrAMX.td

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -419,18 +419,17 @@ let Predicates = [HasAMXMOVRS, In64BitMode], SchedRW = [WriteSystem] in {
419419
"tileloaddrst1\t{$src1, $dst|$dst, $src1}",
420420
[]>, VEX, T8, PD;
421421

422-
let isPseudo = true, mayLoad = 1 in
423-
def PTILELOADDRSV : PseudoI<(outs TILE:$dst), (ins GR16:$src1,
424-
GR16:$src2,
425-
opaquemem:$src3), []>;
426-
let isPseudo = true, mayLoad = 1 in
427-
def PTILELOADDRST1V : PseudoI<(outs TILE:$dst), (ins GR16:$src1,
422+
let isPseudo = true, mayLoad = 1 in {
423+
def PTILELOADDRSV : PseudoI<(outs TILE:$dst), (ins GR16:$src1,
428424
GR16:$src2,
429425
opaquemem:$src3), []>;
430-
let usesCustomInserter = 1 in {
431-
let mayLoad = 1 in
426+
def PTILELOADDRST1V : PseudoI<(outs TILE:$dst), (ins GR16:$src1,
427+
GR16:$src2,
428+
opaquemem:$src3), []>;
429+
}
430+
431+
let usesCustomInserter = 1, mayLoad = 1 in {
432432
def PTILELOADDRS : PseudoI<(outs), (ins u8imm:$src1, sibmem:$src2), []>;
433-
let mayLoad = 1 in
434433
def PTILELOADDRST1 : PseudoI<(outs), (ins u8imm:$src1, sibmem:$src2), []>;
435434
}
436435
} // HasAMXMOVRS, In64BitMode

llvm/lib/TargetParser/Host.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,9 +1880,9 @@ const StringMap<bool> sys::getHostCPUFeatures() {
18801880
!getX86CpuIDAndInfoEx(0x1e, 0x1, &EAX, &EBX, &ECX, &EDX);
18811881
Features["amx-fp8"] = HasLeaf1E && ((EAX >> 4) & 1) && HasAMXSave;
18821882
Features["amx-transpose"] = HasLeaf1E && ((EAX >> 5) & 1) && HasAMXSave;
1883-
Features["amx-movrs"] = HasLeaf1E && ((EAX >> 8) & 1) && HasAMXSave;
18841883
Features["amx-tf32"] = HasLeaf1E && ((EAX >> 6) & 1) && HasAMXSave;
18851884
Features["amx-avx512"] = HasLeaf1E && ((EAX >> 7) & 1) && HasAMXSave;
1885+
Features["amx-movrs"] = HasLeaf1E && ((EAX >> 8) & 1) && HasAMXSave;
18861886

18871887
bool HasLeaf24 =
18881888
MaxLevel >= 0x24 && !getX86CpuIDAndInfo(0x24, &EAX, &EBX, &ECX, &EDX);

0 commit comments

Comments
 (0)