diff options
author | Lev Rumyantsev <levarum@google.com> | 2024-05-04 22:49:47 -0700 |
---|---|---|
committer | Lev Rumyantsev <levarum@google.com> | 2024-05-07 23:28:36 -0700 |
commit | 0d048372c919d21b949347fc59f33b6145c832e4 (patch) | |
tree | 506b6ac71ef569b680cda0437217b3987a76b1ba | |
parent | 59addd2f7e65b35643dbe541cbd7a20d0b5e90df (diff) | |
download | binary_translation-0d048372c919d21b949347fc59f33b6145c832e4.tar.gz |
inline_asm_tests: swap arguments for reductions
This is needed for this test to pass after fixing the emulation in
r.android.com/3075392
Test: inline_asm_tests_riscv64
Bug: 301577077
Change-Id: Ic0a6b531c70ddb5d378bdb7333bde3811f98a9c4
-rw-r--r-- | tests/inline_asm_tests/main_riscv64.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/inline_asm_tests/main_riscv64.cc b/tests/inline_asm_tests/main_riscv64.cc index 694909a4..a7566f1d 100644 --- a/tests/inline_asm_tests/main_riscv64.cc +++ b/tests/inline_asm_tests/main_riscv64.cc @@ -154,7 +154,12 @@ void TestVectorReductionInstruction( memcpy(&result[index], &kUndisturbedResult, sizeof(result[index])); } - RunTwoVectorArgsOneRes(exec_insn, &kVectorCalculationsSource[0], &result[0], vtype, vlmax); + // Exectations for reductions are for swapped source arguments. + __v2du sources[16]{}; + memcpy(&sources[0], &kVectorCalculationsSource[8], sizeof(sources[0]) * 8); + memcpy(&sources[8], &kVectorCalculationsSource[0], sizeof(sources[0]) * 8); + + RunTwoVectorArgsOneRes(exec_insn, &sources[0], &result[0], vtype, vlmax); // Reduction instructions are unique in that they produce a scalar // output to a single vector register as opposed to a register group. |