From a812d862929bb3b47329a88b97fd756a32cf971d Mon Sep 17 00:00:00 2001 From: Jason Lowe-Power Date: Tue, 18 Feb 2020 10:51:58 -0800 Subject: [PATCH] sim: Fix pseudo instruction parameter loading With the new ABI API the position argument of the pseudo inst ABI was not updated correctly. The position needs to be incremented (at least) once per argument. Note: `position++` must be outside of the function call because of a GCC complaint: build/X86/sim/pseudo_inst.hh:80:48: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'PseudoInstABI::Position {aka int}' return TheISA::getArgument(tc, position++, sizeof(uint64_t), false); Issue: https://gem5.atlassian.net/browse/GEM5-351 Change-Id: Idd890a587a565b8ad819f094147a02dc1519e997 Signed-off-by: Jason Lowe-Power Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25543 Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- src/sim/pseudo_inst.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sim/pseudo_inst.hh b/src/sim/pseudo_inst.hh index 44227aff1..e2d0c612b 100644 --- a/src/sim/pseudo_inst.hh +++ b/src/sim/pseudo_inst.hh @@ -77,7 +77,10 @@ struct Argument static uint64_t get(ThreadContext *tc, PseudoInstABI::Position &position) { - return TheISA::getArgument(tc, position, sizeof(uint64_t), false); + uint64_t result = TheISA::getArgument(tc, position, sizeof(uint64_t), + false); + position++; + return result; } }; -- 2.30.2