]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390_amode_for_stack_pointer: Use it. master
authorFlorian Krohm <flo2030@eich-krohm.de>
Tue, 14 Jul 2026 20:35:12 +0000 (20:35 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Tue, 14 Jul 2026 20:35:12 +0000 (20:35 +0000)
The function was previously unused. Also fix the incorrect comment.

VEX/priv/host_s390_defs.c
VEX/priv/host_s390_isel.c

index 54a91a53c966cf28219fd55fd9758358b5d7b07d..b0888c12c91090510c21d069723bc72226d29658 100644 (file)
@@ -262,11 +262,9 @@ s390_amode_for_guest_state(Int offset)
 }
 
 
-/* Construct an AMODE for accessing stack pointer at OFFSET.
-   OFFSET can be at most 3 * sizeof(VexGuestS390XState) + LibVEX_N_SPILL_BYTES
-   which may be too large for a B12 addressing mode.
-   Use a B20 amode as a fallback which will be safe for any offset.
-*/
+/* Construct an AMODE for accessing the stack pointer at OFFSET.
+   Current offset values are small enough such that the following
+   implementation suffices. */
 s390_amode *
 s390_amode_for_stack_pointer(Int offset)
 {
@@ -276,7 +274,7 @@ s390_amode_for_stack_pointer(Int offset)
    if (fits_signed_20bit(offset))
       return s390_amode_b20(offset, s390_hreg_stack_pointer());
 
-   vpanic("invalid stack pointer offset");
+   vpanic("stack pointer offset out of range");
 }
 
 
index e990ec11b0e75ed95b47cea66c616d207c7ea79e..a6d8d50a4d11bbfa199bdac8a342487cf421096a 100644 (file)
@@ -5332,7 +5332,7 @@ no_memcpy_put:
                   doHelperCall. */
                vassert(rloc.pri == RLPri_V128SpRel);
                vassert(addToSp == sizeof(V128));
-               s390_amode* am  = s390_amode_b12(rloc.spOff, s390_hreg_stack_pointer());
+               s390_amode *am  = s390_amode_for_stack_pointer(rloc.spOff);
                addInstr(env, s390_insn_load(sizeof(V128), dst, am));
                add_to_SP(env, addToSp);
                break;