summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.target/microblaze/isa/vanilla.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.target/microblaze/isa/vanilla.c')
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/vanilla.c89
1 files changed, 89 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c b/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c
new file mode 100644
index 000000000..1d6ba807b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c
@@ -0,0 +1,89 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mcpu=v6.00.a" } */
+
+volatile int m1, m2, m3;
+volatile long l1, l2;
+volatile long long llp;
+volatile unsigned int u1, u2, u3;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler-not "mul\tr" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler-not "muli" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler-not "mulh" } } */
+ llp = ((long long)l1 * l2);
+
+ /* { dg-final { scan-assembler-not "mulhu" } } */
+ ullp = ((unsigned long long)ul1 * ul2);
+
+ /* { dg-final { scan-assembler-not "mulhsu" } } */
+ llp = ((long long)l1 * ul2);
+
+ /* { dg-final { scan-assembler-not "bslli" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler-not "bsll" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler-not "bsrai" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler-not "bsra" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler-not "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler-not "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler-not "pcmpne" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler-not "pcmpeq" } } */
+ return (m1 == m2);
+}
+
+
+
+volatile float f1, f2, f3;
+
+void float_func ()
+{
+ /* { dg-final { scan-assembler-not "fmul" } } */
+ f1 = f2 * f3;
+
+ /* { dg-final { scan-assembler-not "fadd" } } */
+ f1 = f2 + f3;
+
+ /* { dg-final { scan-assembler-not "frsub" } } */
+ f1 = f2 - f3;
+
+ /* { dg-final { scan-assembler-not "fdiv" } } */
+ f1 = f2 / f3;
+
+}
+
+void float_cmp_func ()
+{
+ /* { dg-final { scan-assembler-not "fcmp" } } */
+ if (f2 <= f3)
+ print ("le");
+ else if (f2 == f3)
+ print ("eq");
+ else if (f2 < f3)
+ print ("lt");
+ else if (f2 > f3)
+ print ("gt");
+ else if (f2 >= f3)
+ print ("ge");
+ else if (f2 != f3)
+ print ("ne");
+
+}