Skip to content
Snippets Groups Projects
Commit 56fd0532 authored by Vasileios Karakasis's avatar Vasileios Karakasis Committed by Ben Cumming
Browse files

Fix consistency issue of the SIMD i/f of modcc (#278)

The `emit_gather()` function emitted the "wrong" instruction in terms of its
arguments but the instruction actually generated was correct, because
the `simd_printer` was passing the arguments to `emit_gather()` in a
different order, which was though the correct order for the finally emitted
instruction. Complicated? This commit cleans this up.
parent bf286e63
No related branches found
No related tags found
No related merge requests found
...@@ -121,7 +121,7 @@ struct simd_intrinsics<targetKind::avx512> { ...@@ -121,7 +121,7 @@ struct simd_intrinsics<targetKind::avx512> {
static void emit_gather(TextBuffer& tb, const A& addr, static void emit_gather(TextBuffer& tb, const A& addr,
const I& index, const S& scale) { const I& index, const S& scale) {
tb << "_mm512_i32gather_pd("; tb << "_mm512_i32gather_pd(";
emit_operands(tb, arg_emitter(addr), arg_emitter(index), emit_operands(tb, arg_emitter(index), arg_emitter(addr),
arg_emitter(scale)); arg_emitter(scale));
tb << ")"; tb << ")";
} }
......
...@@ -7,7 +7,7 @@ enum class targetKind { ...@@ -7,7 +7,7 @@ enum class targetKind {
cpu, cpu,
gpu, gpu,
// Vectorisation targets // Vectorisation targets
avx512, avx512
}; };
struct Options { struct Options {
......
...@@ -377,7 +377,7 @@ void SimdPrinter<Arch>::visit(IndexedVariable *e) { ...@@ -377,7 +377,7 @@ void SimdPrinter<Arch>::visit(IndexedVariable *e) {
value_name = emit_rawptr_name(e->index_name()); value_name = emit_rawptr_name(e->index_name());
} }
simd_backend::emit_gather(text_, vindex_name, value_name, "sizeof(value_type)"); simd_backend::emit_gather(text_, value_name, vindex_name, "sizeof(value_type)");
} }
template<targetKind Arch> template<targetKind Arch>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment