qemu-e2k/target/s390x
Bruno Haible fc6e0d0f2d target/s390x: Fix determination of overflow condition code after subtraction
Reported by Paul Eggert in
https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00050.html

This program currently prints different results when run with TCG instead
of running on real s390x hardware:

 #include <stdio.h>

 int overflow_32 (int x, int y)
 {
   int sum;
   return __builtin_sub_overflow (x, y, &sum);
 }

 int overflow_64 (long long x, long long y)
 {
   long sum;
   return __builtin_sub_overflow (x, y, &sum);
 }

 int a1 = 0;
 int b1 = -2147483648;
 long long a2 = 0L;
 long long b2 = -9223372036854775808L;

 int main ()
 {
   {
     int a = a1;
     int b = b1;
     printf ("a = 0x%x, b = 0x%x\n", a, b);
     printf ("no_overflow = %d\n", ! overflow_32 (a, b));
   }
   {
     long long a = a2;
     long long b = b2;
     printf ("a = 0x%llx, b = 0x%llx\n", a, b);
     printf ("no_overflow = %d\n", ! overflow_64 (a, b));
   }
 }

Signed-off-by: Bruno Haible <bruno@clisp.org>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/618
Message-Id: <20220323162621.139313-3-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-04-01 13:06:07 +02:00
..
kvm s390: kvm: adjust diag318 resets to retain data 2021-12-17 09:12:37 +01:00
tcg target/s390x: Fix determination of overflow condition code after subtraction 2022-04-01 13:06:07 +02:00
arch_dump.c target/s390x: rename internal.h to s390x-internal.h 2021-07-07 14:01:56 +02:00
cpu_features_def.h
cpu_features_def.h.inc s390x/cpumodel: add 3931 and 3932 2021-07-07 13:57:25 +02:00
cpu_features.c
cpu_features.h
cpu_models_sysemu.c target/s390x: split sysemu part of cpu models 2021-07-07 14:01:59 +02:00
cpu_models_user.c target/s390x: split sysemu part of cpu models 2021-07-07 14:01:59 +02:00
cpu_models.c s390x/cpumodel: Bump up QEMU model to a stripped-down IBM z15 GA1 2022-02-28 11:29:15 +01:00
cpu_models.h
cpu-dump.c target/s390x: Fix shifting 32-bit values for more than 31 bits 2022-01-17 08:36:33 +01:00
cpu-param.h
cpu-qom.h target: Introduce and use OBJECT_DECLARE_CPU_TYPE() macro 2022-03-06 22:23:09 +01:00
cpu-sysemu.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
cpu.c target/s390x: Implement s390x_cpu_record_sigbus 2021-11-02 07:00:52 -04:00
cpu.h target: Use ArchCPU as interface to target CPU 2022-03-06 22:23:09 +01:00
diag.c target/s390x: move kvm files into kvm/ 2021-07-07 14:01:59 +02:00
gdbstub.c target/s390x: rename internal.h to s390x-internal.h 2021-07-07 14:01:56 +02:00
gen-features.c s390x/cpumodel: Bump up QEMU model to a stripped-down IBM z15 GA1 2022-02-28 11:29:15 +01:00
helper.c target/s390x: make helper.c sysemu-only 2021-07-07 14:01:59 +02:00
helper.h s390x/tcg: Implement Miscellaneous-Instruction-Extensions Facility 3 for the s390x 2022-02-28 11:29:15 +01:00
interrupt.c target/s390x: move kvm files into kvm/ 2021-07-07 14:01:59 +02:00
ioinst.c s390x/ioinst: Fix wrong MSCH alignment check on little endian 2021-09-06 16:23:22 +02:00
Kconfig meson: Introduce target-specific Kconfig 2021-07-09 18:21:34 +02:00
machine.c target/s390x: move kvm files into kvm/ 2021-07-07 14:01:59 +02:00
meson.build target/s390x: split sysemu part of cpu models 2021-07-07 14:01:59 +02:00
mmu_helper.c hw/s390x/s390-skeys: lazy storage key enablement under TCG 2021-09-06 16:24:05 +02:00
s390x-internal.h target/s390x: Fix shifting 32-bit values for more than 31 bits 2022-01-17 08:36:33 +01:00
sigp.c s390x: sigp: Reorder the SIGP STOP code 2022-01-18 15:00:57 +01:00
trace-events target/s390x: move kvm files into kvm/ 2021-07-07 14:01:59 +02:00
trace.h