summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/octeon-cins-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/mips/octeon-cins-1.c')
-rw-r--r--gcc/testsuite/gcc.target/mips/octeon-cins-1.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/mips/octeon-cins-1.c b/gcc/testsuite/gcc.target/mips/octeon-cins-1.c
new file mode 100644
index 000000000..ac85e2378
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/octeon-cins-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* The tests also work with -mgp32. For long long tests, only one of
+ the 32-bit parts is used. */
+/* { dg-options "-O -march=octeon" } */
+/* { dg-final { scan-assembler-times "\tcins\t" 3 } } */
+/* { dg-final { scan-assembler-not "\tandi\t|sll\t" } } */
+
+NOMIPS16 long long
+f (long long i)
+{
+ return (i & 0xff) << 34;
+}
+
+NOMIPS16 int
+g (int i)
+{
+ return (i << 4) & 0xff0;
+}
+
+NOMIPS16 long long
+h (long long i)
+{
+ return (i << 4) & 0xfff;
+}