qemu/target/s390x/tcg
Bruno Haible 5a2e67a691 target/s390x: Fix determination of overflow condition code after addition
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_add_overflow (x, y, &sum);
 }

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

 int a1 = -2147483648;
 int b1 = -2147483648;
 long long a2 = -9223372036854775808L;
 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/616
Message-Id: <20220323162621.139313-2-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 addition 2022-04-01 13:06:07 +02:00
crypto_helper.c
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
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
int_helper.c
mem_helper.c s390x/tcg: Implement Miscellaneous-Instruction-Extensions Facility 3 for the s390x 2022-02-28 11:29:15 +01:00
meson.build
misc_helper.c s390x/tcg: fix and optimize SPX (SET PREFIX) 2021-09-06 16:23:16 +02:00
s390-tod.h
tcg_s390x.h
translate_vx.c.inc exec/memop: Adding signedness to quad definitions 2022-01-08 15:46:10 +10:00
translate.c s390x/tcg: Fix BRCL with a large negative offset 2022-03-16 08:43:10 +01:00
vec_fpu_helper.c
vec_helper.c
vec_int_helper.c
vec_string_helper.c
vec.h