aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/imm_choice_comparison.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/aarch64/imm_choice_comparison.c')
-rw-r--r--gcc/testsuite/gcc.target/aarch64/imm_choice_comparison.c56
1 files changed, 52 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/imm_choice_comparison.c b/gcc/testsuite/gcc.target/aarch64/imm_choice_comparison.c
index ebc44d6dbc7..d52d592b107 100644
--- a/gcc/testsuite/gcc.target/aarch64/imm_choice_comparison.c
+++ b/gcc/testsuite/gcc.target/aarch64/imm_choice_comparison.c
@@ -1,32 +1,69 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
+/* { dg-final { check-function-bodies "**" "" } } */
/* Go from four moves to two. */
+/*
+** foo:
+** ...
+** mov w[0-9]+, 2576980377
+** movk x[0-9]+, 0x9999, lsl 32
+** ...
+*/
+
int
foo (long long x)
{
- return x <= 0x1999999999999998;
+ return x <= 0x0000999999999998;
}
+/*
+** GT:
+** ...
+** mov w[0-9]+, -16777217
+** ...
+*/
+
int
GT (unsigned int x)
{
return x > 0xfefffffe;
}
+/*
+** LE:
+** ...
+** mov w[0-9]+, -16777217
+** ...
+*/
+
int
LE (unsigned int x)
{
return x <= 0xfefffffe;
}
+/*
+** GE:
+** ...
+** mov w[0-9]+, 4278190079
+** ...
+*/
+
int
GE (long long x)
{
return x >= 0xff000000;
}
+/*
+** LT:
+** ...
+** mov w[0-9]+, -16777217
+** ...
+*/
+
int
LT (int x)
{
@@ -35,6 +72,13 @@ LT (int x)
/* Optimize the immediate in conditionals. */
+/*
+** check:
+** ...
+** mov w[0-9]+, -16777217
+** ...
+*/
+
int
check (int x, int y)
{
@@ -44,11 +88,15 @@ check (int x, int y)
return x;
}
+/*
+** tern:
+** ...
+** mov w[0-9]+, -16777217
+** ...
+*/
+
int
tern (int x)
{
return x >= 0xff000000 ? 5 : -3;
}
-
-/* baz produces one movk instruction. */
-/* { dg-final { scan-assembler-times "movk" 1 } } */