Skip to content

[WebAssembly] Add extended-const to the "generic" CPU. #139640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/Basic/Targets/WebAssembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ bool WebAssemblyTargetInfo::initFeatureMap(
Features["bulk-memory"] = true;
Features["bulk-memory-opt"] = true;
Features["call-indirect-overlong"] = true;
Features["extended-const"] = true;
Features["multivalue"] = true;
Features["mutable-globals"] = true;
Features["nontrapping-fptoint"] = true;
Expand All @@ -189,7 +190,6 @@ bool WebAssemblyTargetInfo::initFeatureMap(
addGenericFeatures();
Features["atomics"] = true;
Features["exception-handling"] = true;
Features["extended-const"] = true;
Features["fp16"] = true;
Features["multimemory"] = true;
Features["tail-call"] = true;
Expand Down
12 changes: 6 additions & 6 deletions clang/test/Preprocessor/wasm-target-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
// EXCEPTION-HANDLING: #define __wasm_exception_handling__ 1{{$}}

// RUN: %clang -E -dM %s -o - 2>&1 \
// RUN: -target wasm32-unknown-unknown -mextended-const \
// RUN: | FileCheck %s -check-prefix=EXTENDED-CONST
// RUN: -target wasm32-unknown-unknown -mno-extended-const \
// RUN: | FileCheck %s -check-prefix=NO-EXTENDED-CONST
// RUN: %clang -E -dM %s -o - 2>&1 \
// RUN: -target wasm64-unknown-unknown -mextended-const \
// RUN: | FileCheck %s -check-prefix=EXTENDED-CONST
// RUN: -target wasm64-unknown-unknown -mno-extended-const \
// RUN: | FileCheck %s -check-prefix=NO-EXTENDED-CONST
//
// EXTENDED-CONST: #define __wasm_extended_const__ 1{{$}}
// NO-EXTENDED-CONST-NOT: #define __wasm_extended_const__ 1{{$}}

// RUN: %clang -E -dM %s -o - 2>&1 \
// RUN: -target wasm32-unknown-unknown -mfp16 \
Expand Down Expand Up @@ -164,6 +164,7 @@
// RUN: | FileCheck %s -check-prefix=GENERIC-INCLUDE
//
// GENERIC-INCLUDE-DAG: #define __wasm_bulk_memory__ 1{{$}}
// GENERIC-INCLUDE-DAG: #define __wasm_extended_const__ 1{{$}}
// GENERIC-INCLUDE-DAG: #define __wasm_multivalue__ 1{{$}}
// GENERIC-INCLUDE-DAG: #define __wasm_mutable_globals__ 1{{$}}
// GENERIC-INCLUDE-DAG: #define __wasm_nontrapping_fptoint__ 1{{$}}
Expand All @@ -179,7 +180,6 @@
//
// GENERIC-NOT: #define __wasm_atomics__ 1{{$}}
// GENERIC-NOT: #define __wasm_exception_handling__ 1{{$}}
// GENERIC-NOT: #define __wasm_extended_const__ 1{{$}}
// GENERIC-NOT: #define __wasm__fp16__ 1{{$}}
// GENERIC-NOT: #define __wasm_multimemory__ 1{{$}}
// GENERIC-NOT: #define __wasm_relaxed_simd__ 1{{$}}
Expand Down