This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: fix some ppu_intrinsics.h macros


This patch was discussed with Andrew Pinski some weeks ago, but was
somehow lost along the way.  I've included the test cases that I wrote
for these macros, as well.

Tested with make RUNTESTFLAGS=powerpc.exp check, no regressions.  Okay
for mainline?

2007-08-31  Ben Elliston  <bje@au.ibm.com>

        * config/rs6000/ppu_intrinsics.h (__protected_stream_count):
        Rename count macro arugment for clarity.
        (__protected_unlimited_stream_set): Pass UG=1 to __dcbt_TH1000.
        (__protected_stream_set): Likewise, pass 0.

testsuite/
2007-08-31  Ben Elliston  <bje@au.ibm.com>

        * gcc.target/powerpc/ppu-intrinsics.c: Add test cases for the
        __protected_stream family of macros.

Index: config/rs6000/ppu_intrinsics.h
===================================================================
--- config/rs6000/ppu_intrinsics.h      (revision 127941)
+++ config/rs6000/ppu_intrinsics.h      (working copy)
@@ -246,10 +246,10 @@ typedef int __V4SI __attribute__((vector
                               | ((ID) & 0xF))) : : "memory")
 
 #define __protected_unlimited_stream_set(DIRECTION, ADDR, ID)  \
-       __dcbt_TH1000 ((ADDR), (DIRECTION)>>1, 0, (ID))
+       __dcbt_TH1000 ((ADDR), (DIRECTION)>>1, 1, (ID))
 
 #define __protected_stream_set(DIRECTION, ADDR, ID)    \
-       __dcbt_TH1000 ((ADDR), (DIRECTION)>>1, 1, (ID))
+       __dcbt_TH1000 ((ADDR), (DIRECTION)>>1, 0, (ID))
 
 #define __protected_stream_stop_all()                  \
        __dcbt_TH1010 (0, 3, 0, 0, 0, 0)
@@ -257,8 +257,8 @@ typedef int __V4SI __attribute__((vector
 #define __protected_stream_stop(ID)                    \
        __dcbt_TH1010 (0, 2, 0, 0, 0, (ID))
 
-#define __protected_stream_count(CNT, ID)              \
-       __dcbt_TH1010 (0, 0, (CNT), 0, 0, (ID))
+#define __protected_stream_count(COUNT, ID)            \
+       __dcbt_TH1010 (0, 0, (COUNT), 0, 0, (ID))
 
 #define __protected_stream_go()                                \
        __dcbt_TH1010 (1, 0, 0, 0, 0, 0)

Index: testsuite/gcc.target/powerpc/ppu-intrinsics.c
===================================================================
--- testsuite/gcc.target/powerpc/ppu-intrinsics.c       (revision 127941)
+++ testsuite/gcc.target/powerpc/ppu-intrinsics.c       (working copy)
@@ -32,5 +32,12 @@ int main ()
   i = __fctiw (d);
   i = __fctiwz (d);
 
+  __protected_stream_count (1, 2);
+  __protected_stream_go ();
+  __protected_stream_set (1, 0x1000, 3);
+  __protected_stream_stop (3);
+  __protected_stream_stop_all ();
+  __protected_unlimited_stream_set (3, 0x1000, 1);
+
   return 0;
 }



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]