Skip to content

Commit 2da7e8b

Browse files
authored
Merge branch 'main' into fix-no-external-type-id-cppm
2 parents 3315b28 + 1bc2cd9 commit 2da7e8b

File tree

24 files changed

+115
-48
lines changed

24 files changed

+115
-48
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,15 @@ NetBSD Support
690690
WebAssembly Support
691691
^^^^^^^^^^^^^^^^^^^
692692

693+
The default target CPU, "generic", now enables the `-mnontrapping-fptoint`
694+
and `-mbulk-memory` flags, which correspond to the [Bulk Memory Operations]
695+
and [Non-trapping float-to-int Conversions] language features, which are
696+
[widely implemented in engines].
697+
698+
[Bulk Memory Operations]: https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md
699+
[Non-trapping float-to-int Conversions]: https://github.com/WebAssembly/spec/blob/master/proposals/nontrapping-float-to-int-conversion/Overview.md
700+
[widely implemented in engines]: https://webassembly.org/features/
701+
693702
AVR Support
694703
^^^^^^^^^^^
695704

clang/lib/Basic/Targets/WebAssembly.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,20 @@ bool WebAssemblyTargetInfo::initFeatureMap(
154154
llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags, StringRef CPU,
155155
const std::vector<std::string> &FeaturesVec) const {
156156
auto addGenericFeatures = [&]() {
157+
Features["bulk-memory"] = true;
157158
Features["multivalue"] = true;
158159
Features["mutable-globals"] = true;
160+
Features["nontrapping-fptoint"] = true;
159161
Features["reference-types"] = true;
160162
Features["sign-ext"] = true;
161163
};
162164
auto addBleedingEdgeFeatures = [&]() {
163165
addGenericFeatures();
164166
Features["atomics"] = true;
165-
Features["bulk-memory"] = true;
166167
Features["exception-handling"] = true;
167168
Features["extended-const"] = true;
168169
Features["fp16"] = true;
169170
Features["multimemory"] = true;
170-
Features["nontrapping-fptoint"] = true;
171171
Features["tail-call"] = true;
172172
Features["wide-arithmetic"] = true;
173173
setSIMDLevel(Features, RelaxedSIMD, true);

clang/test/Preprocessor/wasm-target-features.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@
163163
// RUN: -target wasm64-unknown-unknown -mcpu=generic \
164164
// RUN: | FileCheck %s -check-prefix=GENERIC-INCLUDE
165165
//
166+
// GENERIC-INCLUDE-DAG: #define __wasm_bulk_memory__ 1{{$}}
166167
// GENERIC-INCLUDE-DAG: #define __wasm_multivalue__ 1{{$}}
167168
// GENERIC-INCLUDE-DAG: #define __wasm_mutable_globals__ 1{{$}}
169+
// GENERIC-INCLUDE-DAG: #define __wasm_nontrapping_fptoint__ 1{{$}}
168170
// GENERIC-INCLUDE-DAG: #define __wasm_reference_types__ 1{{$}}
169171
// GENERIC-INCLUDE-DAG: #define __wasm_sign_ext__ 1{{$}}
170172
//
@@ -176,12 +178,10 @@
176178
// RUN: | FileCheck %s -check-prefix=GENERIC
177179
//
178180
// GENERIC-NOT: #define __wasm_atomics__ 1{{$}}
179-
// GENERIC-NOT: #define __wasm_bulk_memory__ 1{{$}}
180181
// GENERIC-NOT: #define __wasm_exception_handling__ 1{{$}}
181182
// GENERIC-NOT: #define __wasm_extended_const__ 1{{$}}
182183
// GENERIC-NOT: #define __wasm__fp16__ 1{{$}}
183184
// GENERIC-NOT: #define __wasm_multimemory__ 1{{$}}
184-
// GENERIC-NOT: #define __wasm_nontrapping_fptoint__ 1{{$}}
185185
// GENERIC-NOT: #define __wasm_relaxed_simd__ 1{{$}}
186186
// GENERIC-NOT: #define __wasm_simd128__ 1{{$}}
187187
// GENERIC-NOT: #define __wasm_tail_call__ 1{{$}}

libcxx/include/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ set(files
497497
__locale_dir/locale_base_api/fuchsia.h
498498
__locale_dir/locale_base_api/ibm.h
499499
__locale_dir/locale_base_api/musl.h
500-
__locale_dir/locale_base_api/newlib.h
501500
__locale_dir/locale_base_api/openbsd.h
502501
__locale_dir/locale_base_api/win32.h
503502
__locale_dir/locale_guard.h

libcxx/include/__locale_dir/locale_base_api.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
# include <__locale_dir/locale_base_api/ibm.h>
1616
#elif defined(__ANDROID__)
1717
# include <__locale_dir/locale_base_api/android.h>
18-
#elif defined(__sun__)
19-
# include <__locale_dir/locale_base_api/solaris.h>
20-
#elif defined(_NEWLIB_VERSION)
21-
# include <__locale_dir/locale_base_api/newlib.h>
2218
#elif defined(__OpenBSD__)
2319
# include <__locale_dir/locale_base_api/openbsd.h>
2420
#elif defined(__Fuchsia__)

libcxx/include/__locale_dir/locale_base_api/newlib.h

Lines changed: 0 additions & 12 deletions
This file was deleted.

libcxx/include/module.modulemap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,6 @@ module std [system] {
14511451
textual header "__locale_dir/locale_base_api/fuchsia.h"
14521452
textual header "__locale_dir/locale_base_api/ibm.h"
14531453
textual header "__locale_dir/locale_base_api/musl.h"
1454-
textual header "__locale_dir/locale_base_api/newlib.h"
14551454
textual header "__locale_dir/locale_base_api/openbsd.h"
14561455
textual header "__locale_dir/locale_base_api/win32.h"
14571456
}

lld/test/wasm/custom-section-name.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -filetype=obj %s -o %t.o
1+
; RUN: llc -filetype=obj -mattr=-bulk-memory %s -o %t.o
22
; RUN: wasm-ld -no-gc-sections --no-entry -o %t.wasm %t.o
33
; RUN: obj2yaml %t.wasm | FileCheck %s --check-prefixes=CHECK,NO-BSS
44
; RUN: wasm-ld -no-gc-sections --no-entry --import-memory -o %t.bss.wasm %t.o

lld/test/wasm/data-segments.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc --mtriple=wasm32-unknown-unknown -filetype=obj %s -o %t.atomics.o -mattr=+atomics
1+
; RUN: llc --mtriple=wasm32-unknown-unknown -filetype=obj %s -o %t.atomics.o -mattr=+atomics,-bulk-memory
22
; RUN: llc --mtriple=wasm32-unknown-unknown -filetype=obj %s -o %t.bulk-mem.o -mattr=+bulk-memory
33
; RUN: llc --mtriple=wasm64-unknown-unknown -filetype=obj %s -o %t.bulk-mem64.o -mattr=+bulk-memory
44
; RUN: llc --mtriple=wasm32-unknown-unknown -filetype=obj %s -o %t.atomics.bulk-mem.o -mattr=+atomics,+bulk-memory
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20"
22
target triple = "wasm32-unknown-unknown"
33

4-
define void @memcpy() {
4+
define void @memcpy() #0 {
55
ret void
66
}
7+
8+
attributes #0 = { "target-features"="-bulk-memory" }

0 commit comments

Comments
 (0)