Skip to content

Commit f21a43b

Browse files
Merge branch 'release/20.x' into users/svgys/libc-invalid-namespace-token
2 parents 9d3cd96 + 71ee354 commit f21a43b

File tree

19 files changed

+188
-78
lines changed

19 files changed

+188
-78
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,10 @@ X86 Support
11651165
- Support ISA of ``MOVRS``.
11661166

11671167
- Supported ``-march/tune=diamondrapids``
1168+
- Disable ``-m[no-]avx10.1`` and switch ``-m[no-]avx10.2`` to alias of 512 bit
1169+
options.
1170+
- Change ``-mno-avx10.1-512`` to alias of ``-mno-avx10.1-256`` to disable both
1171+
256 and 512 bit instructions.
11681172

11691173
Arm and AArch64 Support
11701174
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6441,15 +6441,13 @@ def mno_avx : Flag<["-"], "mno-avx">, Group<m_x86_Features_Group>;
64416441
def mavx10_1_256 : Flag<["-"], "mavx10.1-256">, Group<m_x86_AVX10_Features_Group>;
64426442
def mno_avx10_1_256 : Flag<["-"], "mno-avx10.1-256">, Group<m_x86_AVX10_Features_Group>;
64436443
def mavx10_1_512 : Flag<["-"], "mavx10.1-512">, Group<m_x86_AVX10_Features_Group>;
6444-
def mno_avx10_1_512 : Flag<["-"], "mno-avx10.1-512">, Group<m_x86_AVX10_Features_Group>;
6445-
def mavx10_1 : Flag<["-"], "mavx10.1">, Alias<mavx10_1_256>;
6446-
def mno_avx10_1 : Flag<["-"], "mno-avx10.1">, Alias<mno_avx10_1_256>;
6444+
def mno_avx10_1_512 : Flag<["-"], "mno-avx10.1-512">, Alias<mno_avx10_1_256>;
6445+
def mavx10_1 : Flag<["-"], "mavx10.1">, Flags<[Unsupported]>;
6446+
def mno_avx10_1 : Flag<["-"], "mno-avx10.1">, Flags<[Unsupported]>;
64476447
def mavx10_2_256 : Flag<["-"], "mavx10.2-256">, Group<m_x86_AVX10_Features_Group>;
6448-
def mno_avx10_2_256 : Flag<["-"], "mno-avx10.2-256">, Group<m_x86_AVX10_Features_Group>;
64496448
def mavx10_2_512 : Flag<["-"], "mavx10.2-512">, Group<m_x86_AVX10_Features_Group>;
6450-
def mno_avx10_2_512 : Flag<["-"], "mno-avx10.2-512">, Group<m_x86_AVX10_Features_Group>;
6451-
def mavx10_2 : Flag<["-"], "mavx10.2">, Alias<mavx10_2_256>;
6452-
def mno_avx10_2 : Flag<["-"], "mno-avx10.2">, Alias<mno_avx10_2_256>;
6449+
def mavx10_2 : Flag<["-"], "mavx10.2">, Alias<mavx10_2_512>;
6450+
def mno_avx10_2 : Flag<["-"], "mno-avx10.2">, Group<m_x86_AVX10_Features_Group>;
64536451
def mavx2 : Flag<["-"], "mavx2">, Group<m_x86_Features_Group>;
64546452
def mno_avx2 : Flag<["-"], "mno-avx2">, Group<m_x86_Features_Group>;
64556453
def mavx512f : Flag<["-"], "mavx512f">, Group<m_x86_Features_Group>;

clang/lib/Driver/ToolChains/Arch/X86.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,18 @@ void x86::getX86TargetFeatures(const Driver &D, const llvm::Triple &Triple,
237237

238238
bool IsNegative = Name.consume_front("no-");
239239

240-
#ifndef NDEBUG
241-
assert(Name.starts_with("avx10.") && "Invalid AVX10 feature name.");
242240
StringRef Version, Width;
243241
std::tie(Version, Width) = Name.substr(6).split('-');
242+
assert(Name.starts_with("avx10.") && "Invalid AVX10 feature name.");
244243
assert((Version == "1" || Version == "2") && "Invalid AVX10 feature name.");
245-
assert((Width == "256" || Width == "512") && "Invalid AVX10 feature name.");
246-
#endif
247244

248-
Features.push_back(Args.MakeArgString((IsNegative ? "-" : "+") + Name));
245+
if (Width == "") {
246+
assert(IsNegative && "Only negative options can omit width.");
247+
Features.push_back(Args.MakeArgString("-" + Name + "-256"));
248+
} else {
249+
assert((Width == "256" || Width == "512") && "Invalid vector length.");
250+
Features.push_back(Args.MakeArgString((IsNegative ? "-" : "+") + Name));
251+
}
249252
}
250253

251254
// Now add any that the user explicitly requested on the command line,

clang/test/Driver/x86-target-features.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,23 +395,27 @@
395395
// EVEX512: "-target-feature" "+evex512"
396396
// NO-EVEX512: "-target-feature" "-evex512"
397397

398-
// RUN: %clang --target=i386 -mavx10.1 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_256 %s
398+
// RUN: not %clang --target=i386 -march=i386 -mavx10.1 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=UNSUPPORT-AVX10 %s
399+
// RUN: not %clang --target=i386 -march=i386 -mno-avx10.1 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=UNSUPPORT-AVX10 %s
399400
// RUN: %clang --target=i386 -mavx10.1-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_256 %s
400401
// RUN: %clang --target=i386 -mavx10.1-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_512 %s
401402
// RUN: %clang --target=i386 -mavx10.1-256 -mavx10.1-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_512 %s
402403
// RUN: %clang --target=i386 -mavx10.1-512 -mavx10.1-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_256 %s
403404
// RUN: not %clang --target=i386 -march=i386 -mavx10.1-128 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=BAD-AVX10 %s
404405
// RUN: not %clang --target=i386 -march=i386 -mavx10.a-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=BAD-AVX10 %s
405406
// RUN: not %clang --target=i386 -march=i386 -mavx10.1024-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=BAD-AVX10 %s
406-
// RUN: %clang --target=i386 -march=i386 -mavx10.1 -mavx512f %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-AVX512 %s
407-
// RUN: %clang --target=i386 -march=i386 -mavx10.1 -mno-avx512f %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-AVX512 %s
408-
// RUN: %clang --target=i386 -march=i386 -mavx10.1 -mevex512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-EVEX512 %s
409-
// RUN: %clang --target=i386 -march=i386 -mavx10.1 -mno-evex512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-EVEX512 %s
410-
// RUN: %clang --target=i386 -mavx10.2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_2_256 %s
407+
// RUN: %clang --target=i386 -march=i386 -mavx10.1-256 -mavx512f %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-AVX512 %s
408+
// RUN: %clang --target=i386 -march=i386 -mavx10.1-256 -mno-avx512f %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-AVX512 %s
409+
// RUN: %clang --target=i386 -march=i386 -mavx10.1-256 -mevex512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-EVEX512 %s
410+
// RUN: %clang --target=i386 -march=i386 -mavx10.1-256 -mno-evex512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-EVEX512 %s
411+
// RUN: %clang --target=i386 -mavx10.2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_2_512 %s
412+
// RUN: %clang --target=i386 -mno-avx10.2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-AVX10_2 %s
411413
// RUN: %clang --target=i386 -mavx10.2-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_2_256 %s
412414
// RUN: %clang --target=i386 -mavx10.2-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_2_512 %s
413415
// RUN: %clang --target=i386 -mavx10.2-256 -mavx10.1-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=AVX10_2_256,AVX10_1_512 %s
414416
// RUN: %clang --target=i386 -mavx10.2-512 -mavx10.1-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=AVX10_2_512,AVX10_1_256 %s
417+
// UNSUPPORT-AVX10: error: unsupported option '-m{{.*}}avx10.1' for target 'i386'
418+
// NO-AVX10_2: "-target-feature" "-avx10.2-256"
415419
// AVX10_2_256: "-target-feature" "+avx10.2-256"
416420
// AVX10_2_512: "-target-feature" "+avx10.2-512"
417421
// AVX10_1_256: "-target-feature" "+avx10.1-256"

clang/test/Preprocessor/x86_target_features.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,8 @@
742742
// AVXVNNIINT16NOAVX2-NOT: #define __AVX2__ 1
743743
// AVXVNNIINT16NOAVX2-NOT: #define __AVXVNNIINT16__ 1
744744

745-
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1 -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_256 %s
746745
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-256 -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_256 %s
747746
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-256 -mno-avx512f -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_256 %s
748-
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.2 -x c -E -dM -o - %s | FileCheck -check-prefixes=AVX10_1_256,AVX10_2_256 %s
749747
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.2-256 -x c -E -dM -o - %s | FileCheck -check-prefixes=AVX10_1_256,AVX10_2_256 %s
750748
// AVX10_1_256-NOT: __AVX10_1_512__
751749
// AVX10_1_256: #define __AVX10_1__ 1
@@ -758,6 +756,7 @@
758756
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-512 -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_512 %s
759757
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-512 -mno-avx512f -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_512 %s
760758
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-512 -mno-evex512 -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_512 %s
759+
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.2 -x c -E -dM -o - %s | FileCheck -check-prefixes=AVX10_1_512,AVX10_2_512 %s
761760
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.2-512 -x c -E -dM -o - %s | FileCheck -check-prefixes=AVX10_1_512,AVX10_2_512 %s
762761
// AVX10_1_512: #define __AVX10_1_512__ 1
763762
// AVX10_1_512: #define __AVX10_1__ 1

libcxx/src/experimental/time_zone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ __first_rule(seconds __stdoff, const vector<__tz::__rule>& __rules) {
668668
__continuation_end,
669669
__continuation.__stdoff + __save,
670670
chrono::duration_cast<minutes>(__save),
671-
__continuation.__format},
671+
chrono::__format(__continuation, __continuation.__format, __save)},
672672
true};
673673
}
674674

libcxx/test/libcxx/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.pass.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ static void test_abbrev(std::string_view input, std::string_view expected) {
157157
TEST_LIBCPP_REQUIRE(result == expected, TEST_WRITE_CONCATENATED("\nExpected ", expected, "\nActual ", result, '\n'));
158158
}
159159

160-
// This format is valid, however is not used in the tzdata.zi.
161160
static void percentage_z_format() {
162161
test_abbrev(
163162
R"(
@@ -188,6 +187,12 @@ Z Format 0:45 F %z)",
188187
R F 1999 max - Jan 5 0 -1 foo
189188
Z Format 0:45 F %z)",
190189
"-0015");
190+
191+
test_abbrev(
192+
R"(
193+
Z Format -1:2:20 - LMT 1912 Ja 1 1u
194+
-1 - %z)",
195+
"-01");
191196
}
192197

193198
int main(int, const char**) {

lldb/packages/Python/lldbsuite/test/gdbclientutils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ def respond(self, packet):
126126
if packet[0] == "m":
127127
addr, length = [int(x, 16) for x in packet[1:].split(",")]
128128
return self.readMemory(addr, length)
129+
if packet[0] == "x":
130+
addr, length = [int(x, 16) for x in packet[1:].split(",")]
131+
return self.x(addr, length)
129132
if packet[0] == "M":
130133
location, encoded_data = packet[1:].split(":")
131134
addr, length = [int(x, 16) for x in location.split(",")]
@@ -267,6 +270,9 @@ def writeRegister(self, register, value_hex):
267270
def readMemory(self, addr, length):
268271
return "00" * length
269272

273+
def x(self, addr, length):
274+
return ""
275+
270276
def writeMemory(self, addr, data_hex):
271277
return "OK"
272278

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ void GDBRemoteCommunicationClient::ResetDiscoverableSettings(bool did_exec) {
275275
m_supports_vCont_s = eLazyBoolCalculate;
276276
m_supports_vCont_S = eLazyBoolCalculate;
277277
m_supports_p = eLazyBoolCalculate;
278-
m_supports_x = eLazyBoolCalculate;
279278
m_supports_QSaveRegisterState = eLazyBoolCalculate;
280279
m_qHostInfo_is_valid = eLazyBoolCalculate;
281280
m_curr_pid_is_valid = eLazyBoolCalculate;
@@ -295,6 +294,7 @@ void GDBRemoteCommunicationClient::ResetDiscoverableSettings(bool did_exec) {
295294
m_supports_qXfer_siginfo_read = eLazyBoolCalculate;
296295
m_supports_augmented_libraries_svr4_read = eLazyBoolCalculate;
297296
m_uses_native_signals = eLazyBoolCalculate;
297+
m_x_packet_state.reset();
298298
m_supports_qProcessInfoPID = true;
299299
m_supports_qfProcessInfo = true;
300300
m_supports_qUserName = true;
@@ -348,6 +348,7 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
348348
m_supports_memory_tagging = eLazyBoolNo;
349349
m_supports_qSaveCore = eLazyBoolNo;
350350
m_uses_native_signals = eLazyBoolNo;
351+
m_x_packet_state.reset();
351352

352353
m_max_packet_size = UINT64_MAX; // It's supposed to always be there, but if
353354
// not, we assume no limit
@@ -401,6 +402,8 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
401402
m_supports_qSaveCore = eLazyBoolYes;
402403
else if (x == "native-signals+")
403404
m_uses_native_signals = eLazyBoolYes;
405+
else if (x == "binary-upload+")
406+
m_x_packet_state = xPacketState::Prefixed;
404407
// Look for a list of compressions in the features list e.g.
405408
// qXfer:features:read+;PacketSize=20000;qEcho+;SupportedCompressions=zlib-
406409
// deflate,lzma
@@ -715,19 +718,20 @@ Status GDBRemoteCommunicationClient::WriteMemoryTags(
715718
return status;
716719
}
717720

718-
bool GDBRemoteCommunicationClient::GetxPacketSupported() {
719-
if (m_supports_x == eLazyBoolCalculate) {
721+
GDBRemoteCommunicationClient::xPacketState
722+
GDBRemoteCommunicationClient::GetxPacketState() {
723+
if (!m_x_packet_state)
724+
GetRemoteQSupported();
725+
if (!m_x_packet_state) {
720726
StringExtractorGDBRemote response;
721-
m_supports_x = eLazyBoolNo;
722-
char packet[256];
723-
snprintf(packet, sizeof(packet), "x0,0");
724-
if (SendPacketAndWaitForResponse(packet, response) ==
727+
m_x_packet_state = xPacketState::Unimplemented;
728+
if (SendPacketAndWaitForResponse("x0,0", response) ==
725729
PacketResult::Success) {
726730
if (response.IsOKResponse())
727-
m_supports_x = eLazyBoolYes;
731+
m_x_packet_state = xPacketState::Bare;
728732
}
729733
}
730-
return m_supports_x;
734+
return *m_x_packet_state;
731735
}
732736

733737
lldb::pid_t GDBRemoteCommunicationClient::GetCurrentProcessID(bool allow_lazy) {

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,14 @@ class GDBRemoteCommunicationClient : public GDBRemoteClientBase {
218218

219219
bool GetpPacketSupported(lldb::tid_t tid);
220220

221-
bool GetxPacketSupported();
221+
enum class xPacketState {
222+
Unimplemented,
223+
Prefixed, // Successful responses start with a 'b' character. This is the
224+
// style used by GDB.
225+
Bare, // No prefix, packets starts with the memory being read. This is
226+
// LLDB's original style.
227+
};
228+
xPacketState GetxPacketState();
222229

223230
bool GetVAttachOrWaitSupported();
224231

@@ -541,7 +548,6 @@ class GDBRemoteCommunicationClient : public GDBRemoteClientBase {
541548
LazyBool m_attach_or_wait_reply = eLazyBoolCalculate;
542549
LazyBool m_prepare_for_reg_writing_reply = eLazyBoolCalculate;
543550
LazyBool m_supports_p = eLazyBoolCalculate;
544-
LazyBool m_supports_x = eLazyBoolCalculate;
545551
LazyBool m_avoid_g_packets = eLazyBoolCalculate;
546552
LazyBool m_supports_QSaveRegisterState = eLazyBoolCalculate;
547553
LazyBool m_supports_qXfer_auxv_read = eLazyBoolCalculate;
@@ -561,6 +567,7 @@ class GDBRemoteCommunicationClient : public GDBRemoteClientBase {
561567
LazyBool m_supports_memory_tagging = eLazyBoolCalculate;
562568
LazyBool m_supports_qSaveCore = eLazyBoolCalculate;
563569
LazyBool m_uses_native_signals = eLazyBoolCalculate;
570+
std::optional<xPacketState> m_x_packet_state;
564571

565572
bool m_supports_qProcessInfoPID : 1, m_supports_qfProcessInfo : 1,
566573
m_supports_qUserName : 1, m_supports_qGroupName : 1,

0 commit comments

Comments
 (0)