Commit 36d2f81e by Kyrylo Tkachov Committed by Kyrylo Tkachov

[AArch64][testsuite] Adjust some arith+compare tests for potentially more aggressive if-conversion

	* gcc.target/aarch64/adds3.c: Adjust for more aggressive
	if-conversion..
	* gcc.target/aarch64/adds1.c: Likewise.
	* gcc.target/aarch64/ands_1.c: Likewise.
	* gcc.target/aarch64/bics_1.c: Likewise.
	* gcc.target/aarch64/subs1.c: Likewise.
	* gcc.target/aarch64/subs3.c: Likewise.

From-SVN: r225732
parent f1b9b669
2015-07-13 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/adds3.c: Adjust for more aggressive
if-conversion..
* gcc.target/aarch64/adds1.c: Likewise.
* gcc.target/aarch64/ands_1.c: Likewise.
* gcc.target/aarch64/bics_1.c: Likewise.
* gcc.target/aarch64/subs1.c: Likewise.
* gcc.target/aarch64/subs3.c: Likewise.
2015-07-13 Andre Vehreschild <vehre@gcc.gnu.org> 2015-07-13 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/64589 PR fortran/64589
......
...@@ -12,7 +12,7 @@ adds_si_test1 (int a, int b, int c) ...@@ -12,7 +12,7 @@ adds_si_test1 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -24,7 +24,7 @@ adds_si_test2 (int a, int b, int c) ...@@ -24,7 +24,7 @@ adds_si_test2 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -36,7 +36,7 @@ adds_si_test3 (int a, int b, int c) ...@@ -36,7 +36,7 @@ adds_si_test3 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
typedef long long s64; typedef long long s64;
...@@ -50,7 +50,7 @@ adds_di_test1 (s64 a, s64 b, s64 c) ...@@ -50,7 +50,7 @@ adds_di_test1 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
s64 s64
...@@ -62,7 +62,7 @@ adds_di_test2 (s64 a, s64 b, s64 c) ...@@ -62,7 +62,7 @@ adds_di_test2 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
s64 s64
...@@ -74,7 +74,7 @@ adds_di_test3 (s64 a, s64 b, s64 c) ...@@ -74,7 +74,7 @@ adds_di_test3 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int main () int main ()
...@@ -83,64 +83,64 @@ int main () ...@@ -83,64 +83,64 @@ int main ()
s64 y; s64 y;
x = adds_si_test1 (29, 4, 5); x = adds_si_test1 (29, 4, 5);
if (x != 42) if (x != (29 + 4))
abort (); abort ();
x = adds_si_test1 (5, 2, 20); x = adds_si_test1 (5, 2, -5);
if (x != 29) if (x != 7)
abort (); abort ();
x = adds_si_test2 (29, 4, 5); x = adds_si_test2 (29, 4, 5);
if (x != 293) if (x != (29 + 0xff))
abort (); abort ();
x = adds_si_test2 (1024, 2, 20); x = adds_si_test2 (-255, 2, 20);
if (x != 1301) if (x != -235)
abort (); abort ();
x = adds_si_test3 (35, 4, 5); x = adds_si_test3 (35, 4, 5);
if (x != 76) if (x != (35 + (4 << 3)))
abort (); abort ();
x = adds_si_test3 (5, 2, 20); x = adds_si_test3 (-(2 << 3), 2, 20);
if (x != 43) if (x != (20 - (2 << 3)))
abort (); abort ();
y = adds_di_test1 (0x130000029ll, y = adds_di_test1 (0x130000029ll,
0x320000004ll, 0x320000004ll,
0x505050505ll); 0x505050505ll);
if (y != 0xc75050536) if (y != (0x130000029ll + 0x320000004ll))
abort (); abort ();
y = adds_di_test1 (0x5000500050005ll, y = adds_di_test1 (0x5000500050005ll,
0x2111211121112ll, -0x5000500050005ll,
0x0000000002020ll); 0x0000000002020ll);
if (y != 0x9222922294249) if (y != (0x5000500050005ll + 0x0000000002020ll))
abort (); abort ();
y = adds_di_test2 (0x130000029ll, y = adds_di_test2 (0x130000029ll,
0x320000004ll, 0x320000004ll,
0x505050505ll); 0x505050505ll);
if (y != 0x955050631) if (y != (0x130000029ll + 0xff))
abort (); abort ();
y = adds_di_test2 (0x130002900ll, y = adds_di_test2 (-0xff,
0x320000004ll, 0x320000004ll,
0x505050505ll); 0x505050505ll);
if (y != 0x955052f08) if (y != (0x505050505ll - 0xff))
abort (); abort ();
y = adds_di_test3 (0x130000029ll, y = adds_di_test3 (0x130000029ll,
0x064000008ll, 0x064000008ll,
0x505050505ll); 0x505050505ll);
if (y != 0x9b9050576) if (y != (0x130000029ll + (0x064000008ll << 3)))
abort (); abort ();
y = adds_di_test3 (0x130002900ll, y = adds_di_test3 (0x130002900ll,
0x088000008ll, -(0x130002900ll >> 3),
0x505050505ll); 0x505050505ll);
if (y != 0xafd052e4d) if (y != (0x130002900ll + 0x505050505ll))
abort (); abort ();
return 0; return 0;
......
...@@ -12,7 +12,7 @@ adds_ext (s64 a, int b, int c) ...@@ -12,7 +12,7 @@ adds_ext (s64 a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -23,7 +23,7 @@ adds_shift_ext (s64 a, int b, int c) ...@@ -23,7 +23,7 @@ adds_shift_ext (s64 a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int main () int main ()
...@@ -32,27 +32,27 @@ int main () ...@@ -32,27 +32,27 @@ int main ()
s64 y; s64 y;
x = adds_ext (0x13000002ll, 41, 15); x = adds_ext (0x13000002ll, 41, 15);
if (x != 318767203) if (x != (int)(0x13000002ll + 41))
abort (); abort ();
x = adds_ext (0x50505050ll, 29, 4); x = adds_ext (0x50505050ll, -0x50505050ll, 4);
if (x != 1347440782) if (x != (int)(0x50505050ll + 4))
abort (); abort ();
x = adds_ext (0x12121212121ll, 2, 14); x = adds_ext (0x12121212121ll, 2, 14);
if (x != 555819315) if (x != (int)(0x12121212121ll + 2))
abort (); abort ();
x = adds_shift_ext (0x123456789ll, 4, 12); x = adds_shift_ext (0x123456789ll, 4, 12);
if (x != 591751097) if (x != (int)(0x123456789ll + (4 << 3)))
abort (); abort ();
x = adds_shift_ext (0x02020202ll, 9, 8); x = adds_shift_ext (-(0x02020202ll << 3), 0x02020202ll, 8);
if (x != 33686107) if (x != (int)(8 - (0x02020202ll << 3)))
abort (); abort ();
x = adds_shift_ext (0x987987987987ll, 23, 41); x = adds_shift_ext (0x987987987987ll, 23, 41);
if (x != -2020050305) if (x != (int)(0x987987987987ll + (23 << 3)))
abort (); abort ();
return 0; return 0;
......
...@@ -12,7 +12,7 @@ ands_si_test1 (int a, int b, int c) ...@@ -12,7 +12,7 @@ ands_si_test1 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -24,7 +24,7 @@ ands_si_test2 (int a, int b, int c) ...@@ -24,7 +24,7 @@ ands_si_test2 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -36,7 +36,7 @@ ands_si_test3 (int a, int b, int c) ...@@ -36,7 +36,7 @@ ands_si_test3 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
typedef long long s64; typedef long long s64;
...@@ -50,7 +50,7 @@ ands_di_test1 (s64 a, s64 b, s64 c) ...@@ -50,7 +50,7 @@ ands_di_test1 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
s64 s64
...@@ -62,7 +62,7 @@ ands_di_test2 (s64 a, s64 b, s64 c) ...@@ -62,7 +62,7 @@ ands_di_test2 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
s64 s64
...@@ -74,7 +74,7 @@ ands_di_test3 (s64 a, s64 b, s64 c) ...@@ -74,7 +74,7 @@ ands_di_test3 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -84,7 +84,7 @@ main () ...@@ -84,7 +84,7 @@ main ()
s64 y; s64 y;
x = ands_si_test1 (29, 4, 5); x = ands_si_test1 (29, 4, 5);
if (x != 13) if (x != (29 & 4))
abort (); abort ();
x = ands_si_test1 (5, 2, 20); x = ands_si_test1 (5, 2, 20);
...@@ -92,7 +92,7 @@ main () ...@@ -92,7 +92,7 @@ main ()
abort (); abort ();
x = ands_si_test2 (29, 4, 5); x = ands_si_test2 (29, 4, 5);
if (x != 38) if (x != (29 & 0xff))
abort (); abort ();
x = ands_si_test2 (1024, 2, 20); x = ands_si_test2 (1024, 2, 20);
...@@ -100,7 +100,7 @@ main () ...@@ -100,7 +100,7 @@ main ()
abort (); abort ();
x = ands_si_test3 (35, 4, 5); x = ands_si_test3 (35, 4, 5);
if (x != 41) if (x != (35 & (4 << 3)))
abort (); abort ();
x = ands_si_test3 (5, 2, 20); x = ands_si_test3 (5, 2, 20);
...@@ -111,7 +111,7 @@ main () ...@@ -111,7 +111,7 @@ main ()
0x320000004ll, 0x320000004ll,
0x505050505ll); 0x505050505ll);
if (y != ((0x130000029ll & 0x320000004ll) + 0x320000004ll + 0x505050505ll)) if (y != ((0x130000029ll & 0x320000004ll)))
abort (); abort ();
y = ands_di_test1 (0x5000500050005ll, y = ands_di_test1 (0x5000500050005ll,
...@@ -123,7 +123,7 @@ main () ...@@ -123,7 +123,7 @@ main ()
y = ands_di_test2 (0x130000029ll, y = ands_di_test2 (0x130000029ll,
0x320000004ll, 0x320000004ll,
0x505050505ll); 0x505050505ll);
if (y != ((0x130000029ll & 0xff) + 0x320000004ll + 0x505050505ll)) if (y != ((0x130000029ll & 0xff)))
abort (); abort ();
y = ands_di_test2 (0x130002900ll, y = ands_di_test2 (0x130002900ll,
...@@ -135,8 +135,7 @@ main () ...@@ -135,8 +135,7 @@ main ()
y = ands_di_test3 (0x130000029ll, y = ands_di_test3 (0x130000029ll,
0x064000008ll, 0x064000008ll,
0x505050505ll); 0x505050505ll);
if (y != ((0x130000029ll & (0x064000008ll << 3)) if (y != ((0x130000029ll & (0x064000008ll << 3))))
+ 0x064000008ll + 0x505050505ll))
abort (); abort ();
y = ands_di_test3 (0x130002900ll, y = ands_di_test3 (0x130002900ll,
......
...@@ -12,7 +12,7 @@ bics_si_test1 (int a, int b, int c) ...@@ -12,7 +12,7 @@ bics_si_test1 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -24,7 +24,7 @@ bics_si_test2 (int a, int b, int c) ...@@ -24,7 +24,7 @@ bics_si_test2 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
typedef long long s64; typedef long long s64;
...@@ -38,7 +38,7 @@ bics_di_test1 (s64 a, s64 b, s64 c) ...@@ -38,7 +38,7 @@ bics_di_test1 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
s64 s64
...@@ -50,7 +50,7 @@ bics_di_test2 (s64 a, s64 b, s64 c) ...@@ -50,7 +50,7 @@ bics_di_test2 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -60,7 +60,7 @@ main () ...@@ -60,7 +60,7 @@ main ()
s64 y; s64 y;
x = bics_si_test1 (29, ~4, 5); x = bics_si_test1 (29, ~4, 5);
if (x != ((29 & 4) + ~4 + 5)) if (x != (29 & 4))
abort (); abort ();
x = bics_si_test1 (5, ~2, 20); x = bics_si_test1 (5, ~2, 20);
...@@ -68,7 +68,7 @@ main () ...@@ -68,7 +68,7 @@ main ()
abort (); abort ();
x = bics_si_test2 (35, ~4, 5); x = bics_si_test2 (35, ~4, 5);
if (x != ((35 & ~(~4 << 3)) + ~4 + 5)) if (x != (35 & ~(~4 << 3)))
abort (); abort ();
x = bics_si_test2 (96, ~2, 20); x = bics_si_test2 (96, ~2, 20);
...@@ -79,7 +79,7 @@ main () ...@@ -79,7 +79,7 @@ main ()
~0x320000004ll, ~0x320000004ll,
0x505050505ll); 0x505050505ll);
if (y != ((0x130000029ll & 0x320000004ll) + ~0x320000004ll + 0x505050505ll)) if (y != (0x130000029ll & 0x320000004ll))
abort (); abort ();
y = bics_di_test1 (0x5000500050005ll, y = bics_di_test1 (0x5000500050005ll,
...@@ -91,8 +91,7 @@ main () ...@@ -91,8 +91,7 @@ main ()
y = bics_di_test2 (0x130000029ll, y = bics_di_test2 (0x130000029ll,
~0x064000008ll, ~0x064000008ll,
0x505050505ll); 0x505050505ll);
if (y != ((0x130000029ll & ~(~0x064000008ll << 3)) if (y != (0x130000029ll & ~(~0x064000008ll << 3)))
+ ~0x064000008ll + 0x505050505ll))
abort (); abort ();
y = bics_di_test2 (0x130002900ll, y = bics_di_test2 (0x130002900ll,
...@@ -103,4 +102,3 @@ main () ...@@ -103,4 +102,3 @@ main ()
return 0; return 0;
} }
...@@ -12,7 +12,7 @@ subs_si_test1 (int a, int b, int c) ...@@ -12,7 +12,7 @@ subs_si_test1 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -24,7 +24,7 @@ subs_si_test2 (int a, int b, int c) ...@@ -24,7 +24,7 @@ subs_si_test2 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -36,7 +36,7 @@ subs_si_test3 (int a, int b, int c) ...@@ -36,7 +36,7 @@ subs_si_test3 (int a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
typedef long long s64; typedef long long s64;
...@@ -50,7 +50,7 @@ subs_di_test1 (s64 a, s64 b, s64 c) ...@@ -50,7 +50,7 @@ subs_di_test1 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
s64 s64
...@@ -62,7 +62,7 @@ subs_di_test2 (s64 a, s64 b, s64 c) ...@@ -62,7 +62,7 @@ subs_di_test2 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
s64 s64
...@@ -74,7 +74,7 @@ subs_di_test3 (s64 a, s64 b, s64 c) ...@@ -74,7 +74,7 @@ subs_di_test3 (s64 a, s64 b, s64 c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int main () int main ()
...@@ -83,64 +83,64 @@ int main () ...@@ -83,64 +83,64 @@ int main ()
s64 y; s64 y;
x = subs_si_test1 (29, 4, 5); x = subs_si_test1 (29, 4, 5);
if (x != 33) if (x != 24)
abort (); abort ();
x = subs_si_test1 (5, 2, 20); x = subs_si_test1 (20, 2, 20);
if (x != 7) if (x != 40)
abort (); abort ();
x = subs_si_test2 (29, 4, 5); x = subs_si_test2 (0xff, 4, 5);
if (x != -217) if (x != (0xff + 5))
abort (); abort ();
x = subs_si_test2 (1024, 2, 20); x = subs_si_test2 (1024, 2, 20);
if (x != 791) if (x != (1024 - 0xff))
abort (); abort ();
x = subs_si_test3 (35, 4, 5); x = subs_si_test3 (35, 4, 5);
if (x != 12) if (x != 35 - (4 << 3))
abort (); abort ();
x = subs_si_test3 (5, 2, 20); x = subs_si_test3 (5 << 3, 5, 20);
if (x != 11) if (x != (20 + (5 << 3)))
abort (); abort ();
y = subs_di_test1 (0x130000029ll, y = subs_di_test1 (0x130000029ll,
0x320000004ll, 0x320000004ll,
0x505050505ll); 0x505050505ll);
if (y != 0x45000002d) if (y != (0x130000029ll - 0x505050505ll))
abort (); abort ();
y = subs_di_test1 (0x5000500050005ll, y = subs_di_test1 (0x5000500050005ll,
0x2111211121112ll, 0x2111211121112ll,
0x0000000002020ll); 0x5000500050005ll);
if (y != 0x7111711171117) if (y != (0x5000500050005ll + 0x5000500050005ll))
abort (); abort ();
y = subs_di_test2 (0x130000029ll, y = subs_di_test2 (0x130000029ll,
0x320000004ll, 0x320000004ll,
0x505050505ll); 0x505050505ll);
if (y != 0x955050433) if (y != (0x130000029ll - 0xff))
abort (); abort ();
y = subs_di_test2 (0x130002900ll, y = subs_di_test2 (0xff,
0x320000004ll, 0x320000004ll,
0x505050505ll); 0x505050505ll);
if (y != 0x955052d0a) if (y != (0xff + 0x505050505ll))
abort (); abort ();
y = subs_di_test3 (0x130000029ll, y = subs_di_test3 (0x130000029ll,
0x064000008ll, 0x064000008ll,
0x505050505ll); 0x505050505ll);
if (y != 0x3790504f6) if (y != (0x130000029ll - (0x064000008ll << 3)))
abort (); abort ();
y = subs_di_test3 (0x130002900ll, y = subs_di_test3 (0x130002900ll << 3,
0x088000008ll, 0x130002900ll,
0x505050505ll); 0x505050505ll);
if (y != 0x27d052dcd) if (y != (0x505050505ll + (0x130002900ll << 3)))
abort (); abort ();
return 0; return 0;
......
...@@ -12,7 +12,7 @@ subs_ext (s64 a, int b, int c) ...@@ -12,7 +12,7 @@ subs_ext (s64 a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int int
...@@ -23,7 +23,7 @@ subs_shift_ext (s64 a, int b, int c) ...@@ -23,7 +23,7 @@ subs_shift_ext (s64 a, int b, int c)
if (d == 0) if (d == 0)
return a + c; return a + c;
else else
return b + d + c; return d;
} }
int main () int main ()
...@@ -32,27 +32,27 @@ int main () ...@@ -32,27 +32,27 @@ int main ()
s64 y; s64 y;
x = subs_ext (0x13000002ll, 41, 15); x = subs_ext (0x13000002ll, 41, 15);
if (x != 318767121) if (x != (int)(0x13000002ll - 41))
abort (); abort ();
x = subs_ext (0x50505050ll, 29, 4); x = subs_ext (0x50505050ll, 0x50505050ll, 4);
if (x != 1347440724) if (x != (int)(0x50505050ll + 4))
abort (); abort ();
x = subs_ext (0x12121212121ll, 2, 14); x = subs_ext (0x12121212121ll, 2, 14);
if (x != 555819311) if (x != (int)(0x12121212121ll - 2))
abort (); abort ();
x = subs_shift_ext (0x123456789ll, 4, 12); x = subs_shift_ext (0x123456789ll, 4, 12);
if (x != 591751033) if (x != (int)(0x123456789ll - (4 << 3)))
abort (); abort ();
x = subs_shift_ext (0x02020202ll, 9, 8); x = subs_shift_ext (0x02020202ll << 3, 0x02020202ll, 8);
if (x != 33685963) if (x != (int)(8 + (0x02020202ll << 3)))
abort (); abort ();
x = subs_shift_ext (0x987987987987ll, 23, 41); x = subs_shift_ext (0x987987987987ll, 23, 41);
if (x != -2020050673) if (x != (int)(0x987987987987ll - (23 << 3)))
abort (); abort ();
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment