diff options
author | Thomas Lively <tlively@google.com> | 2018-09-20 22:04:44 +0000 |
---|---|---|
committer | Thomas Lively <tlively@google.com> | 2018-09-20 22:04:44 +0000 |
commit | 6f21a136755e5bce0c58a8f0fab56612821390ba (patch) | |
tree | de10d36095130a539991be29371ede750981c958 /llvm/lib/Target/WebAssembly | |
parent | b320ca264216cb09d70927792f6f3d04bca7f58b (diff) | |
download | bcm5719-llvm-6f21a136755e5bce0c58a8f0fab56612821390ba.tar.gz bcm5719-llvm-6f21a136755e5bce0c58a8f0fab56612821390ba.zip |
[WebAssembly] Add V128 value type to binary format
Summary: Adds the necessary support to lib/ObjectYAML and fixes SIMD
calls to allow the tests to work. Also removes some dead code that
would otherwise have to have been updated.
Reviewers: aheejin, dschuff, sbc100
Subscribers: jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D52105
llvm-svn: 342689
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
5 files changed, 15 insertions, 23 deletions
diff --git a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp index ad0a0454c3f..045d4fb4fd6 100644 --- a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp +++ b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp @@ -258,19 +258,3 @@ const char *llvm::WebAssembly::TypeToString(MVT Ty) { llvm_unreachable("unsupported type"); } } - -const char *llvm::WebAssembly::TypeToString(wasm::ValType Type) { - switch (Type) { - case wasm::ValType::I32: - return "i32"; - case wasm::ValType::I64: - return "i64"; - case wasm::ValType::F32: - return "f32"; - case wasm::ValType::F64: - return "f64"; - case wasm::ValType::EXCEPT_REF: - return "except_ref"; - } - llvm_unreachable("unsupported type"); -} diff --git a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h index f5b890a7615..2bb6dcea9e0 100644 --- a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h +++ b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h @@ -51,7 +51,6 @@ public: namespace WebAssembly { const char *TypeToString(MVT Ty); -const char *TypeToString(wasm::ValType Type); } // end namespace WebAssembly diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp index 55478353ecc..24dd5238f71 100644 --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp @@ -133,6 +133,13 @@ wasm::ValType WebAssembly::toValType(const MVT &Ty) { return wasm::ValType::F32; case MVT::f64: return wasm::ValType::F64; + case MVT::v16i8: + case MVT::v8i16: + case MVT::v4i32: + case MVT::v2i64: + case MVT::v4f32: + case MVT::v2f64: + return wasm::ValType::V128; case MVT::ExceptRef: return wasm::ValType::EXCEPT_REF; default: diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td index 1de783ac701..3c9caa3f0de 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td @@ -89,12 +89,12 @@ let Uses = [SP32, SP64], isCall = 1 in { defm "" : CALL<F32, "f32.">; defm "" : CALL<F64, "f64.">; defm "" : CALL<EXCEPT_REF, "except_ref.">; - defm "" : SIMD_CALL<v16i8, "i8x16.">; - defm "" : SIMD_CALL<v8i16, "i16x8.">; - defm "" : SIMD_CALL<v4i32, "i32x4.">; - defm "" : SIMD_CALL<v2i64, "i64x2.">; - defm "" : SIMD_CALL<v4f32, "f32x4.">; - defm "" : SIMD_CALL<v2f64, "f64x2.">; + defm "" : SIMD_CALL<v16i8, "v128.">; + defm "" : SIMD_CALL<v8i16, "v128.">; + defm "" : SIMD_CALL<v4i32, "v128.">; + defm "" : SIMD_CALL<v2i64, "v128.">; + defm "" : SIMD_CALL<v4f32, "v128.">; + defm "" : SIMD_CALL<v2f64, "v128.">; defm CALL_VOID : I<(outs), (ins function32_op:$callee, variable_ops), (outs), (ins function32_op:$callee), diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp index db4fb5c75b5..c55308ba116 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp @@ -149,6 +149,8 @@ static wasm::ValType getType(const TargetRegisterClass *RC) { return wasm::ValType::F32; if (RC == &WebAssembly::F64RegClass) return wasm::ValType::F64; + if (RC == &WebAssembly::V128RegClass) + return wasm::ValType::V128; llvm_unreachable("Unexpected register class"); } |