[Pcre-svn] [998] code/trunk/sljit/sljitNativePPC_common.c: F…

Página superior
Eliminar este mensaje
Autor: Subversion repository
Fecha:  
A: pcre-svn
Asunto: [Pcre-svn] [998] code/trunk/sljit/sljitNativePPC_common.c: Final touches on Power/ PowerPC cache flush
Revision: 998
          http://vcs.pcre.org/viewvc?view=rev&revision=998
Author:   zherczeg
Date:     2012-08-03 12:45:53 +0100 (Fri, 03 Aug 2012)


Log Message:
-----------
Final touches on Power/PowerPC cache flush

Modified Paths:
--------------
    code/trunk/sljit/sljitNativePPC_common.c


Modified: code/trunk/sljit/sljitNativePPC_common.c
===================================================================
--- code/trunk/sljit/sljitNativePPC_common.c    2012-07-27 11:31:03 UTC (rev 997)
+++ code/trunk/sljit/sljitNativePPC_common.c    2012-08-03 11:45:53 UTC (rev 998)
@@ -40,8 +40,9 @@
 static void ppc_cache_flush(sljit_ins *from, sljit_ins *to)
 {
 #ifdef _AIX
-    _sync_cache_range((caddr_t)from, (int)((size_t)(to - from) * sizeof(sljit_ins)));
-#elif defined(_ARCH_PWR) || defined(_ARCH_PWR2)
+    _sync_cache_range((caddr_t)from, (int)((size_t)to - (size_t)from));
+#elif defined(__GNUC__) || (defined(__IBM_GCC_ASM) && __IBM_GCC_ASM)
+#    if defined(_ARCH_PWR) || defined(_ARCH_PWR2)
     /* Cache flush for POWER architecture. */
     while (from < to) {
         __asm__ volatile (
@@ -52,7 +53,9 @@
         from++;
     }
     __asm__ volatile ( "ics" );
-#elif defined(__GNUC__) || (defined(__IBM_GCC_ASM) && __IBM_GCC_ASM)
+#    elif defined(_ARCH_COM) && !defined(_ARCH_PPC)
+#    error "Cache flush is not implemented for PowerPC/POWER common mode."
+#    else
     /* Cache flush for PowerPC architecture. */
     while (from < to) {
         __asm__ volatile (
@@ -64,9 +67,10 @@
         from++;
     }
     __asm__ volatile ( "isync" );
-#ifdef __xlc__
-#warning "This file may fail to compile if -qfuncsect is used."
-#endif
+#    endif
+#    ifdef __xlc__
+#    warning "This file may fail to compile if -qfuncsect is used"
+#    endif
 #elif defined(__xlc__)
 #error "Please enable GCC syntax for inline assembly statements with -qasm=gcc"
 #else