diff options
Diffstat (limited to 'src/c-writer.cc')
-rw-r--r-- | src/c-writer.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/c-writer.cc b/src/c-writer.cc index b9d8b99c..5be29c19 100644 --- a/src/c-writer.cc +++ b/src/c-writer.cc @@ -264,6 +264,7 @@ class CWriter { void Write(const UnaryExpr&); void Write(const TernaryExpr&); void Write(const SimdLaneOpExpr&); + void Write(const SimdShuffleOpExpr&); const WriteCOptions* options_ = nullptr; const Module* module_ = nullptr; @@ -1625,6 +1626,11 @@ void CWriter::Write(const ExprList& exprs) { break; } + case ExprType::SimdShuffleOp: { + Write(*cast<SimdShuffleOpExpr>(&expr)); + break; + } + case ExprType::Unreachable: Write("UNREACHABLE;", Newline()); return; @@ -2214,6 +2220,15 @@ void CWriter::Write(const SimdLaneOpExpr& expr) { PushType(result_type); } +void CWriter::Write(const SimdShuffleOpExpr& expr) { + Type result_type = expr.opcode.GetResultType(); + Write(StackVar(1, result_type), " = ", expr.opcode.GetName(), "(", StackVar(1), + " ", StackVar(0), ", lane Imm: $0x%08x %08x %08x %08x", expr.val.v[0], + expr.val.v[1], expr.val.v[2], expr.val.v[3], ")", Newline()); + DropTypes(2); + PushType(result_type); +} + void CWriter::WriteCHeader() { stream_ = h_stream_; std::string guard = GenerateHeaderGuard(); |