qemu-e2k/target/s390x/tcg
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
..
cc_helper.c target/s390x: Fix determination of overflow condition code after subtraction 2022-04-01 13:06:07 +02:00
crypto_helper.c target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
excp_helper.c exec/exec-all: Move 'qemu/log.h' include in units requiring it 2022-02-21 10:18:06 +01:00
fpu_helper.c target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
insn-data.def s390x/tcg: Implement Miscellaneous-Instruction-Extensions Facility 3 for the s390x 2022-02-28 11:29:15 +01:00
insn-format.def target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
int_helper.c target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
mem_helper.c s390x/tcg: Implement Miscellaneous-Instruction-Extensions Facility 3 for the s390x 2022-02-28 11:29:15 +01:00
meson.build target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
misc_helper.c s390x/tcg: fix and optimize SPX (SET PREFIX) 2021-09-06 16:23:16 +02:00
s390-tod.h target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
tcg_s390x.h target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
translate.c s390x/tcg: Fix BRCL with a large negative offset 2022-03-16 08:43:10 +01:00
translate_vx.c.inc exec/memop: Adding signedness to quad definitions 2022-01-08 15:46:10 +10:00
vec.h target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
vec_fpu_helper.c target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
vec_helper.c target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
vec_int_helper.c target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
vec_string_helper.c target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00