Merge pull request #2810 from kumpera/fix_hazard_free
[mono.git] / mono / arch / ppc / ppc-codegen.h
index f98082c455d1f383a755519df26947a7cc239661..869365b4bccd9b3d93d99dd1184dfbc049253d8f 100644 (file)
@@ -8,6 +8,7 @@
    Copyright (C)  2007-2008 Andreas Faerber
 
    for testing do the following: ./test | as -o test.o
+   Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */
 
 #ifndef __MONO_PPC_CODEGEN_H__
@@ -123,7 +124,7 @@ enum {
        PPC_TRAP_GE_UN = 16 + PPC_TRAP_EQ
 };
 
-#define ppc_emit32(c,x) do { *((guint32 *) (c)) = GUINT32_TO_BE (x); (c) = (gpointer)((guint8 *)(c) + sizeof (guint32));} while (0)
+#define ppc_emit32(c,x) do { *((guint32 *) (c)) = (guint32) (x); (c) = (gpointer)((guint8 *)(c) + sizeof (guint32));} while (0)
 
 #define ppc_is_imm16(val) ((((val)>> 15) == 0) || (((val)>> 15) == -1))
 #define ppc_is_uimm16(val) ((glong)(val) >= 0L && (glong)(val) <= 65535L)
@@ -806,11 +807,15 @@ my and Ximian's copyright to this code. ;)
                }       \
        } G_STMT_END
 
+#if _CALL_ELF == 2
+#define ppc_load_func(c,D,V)         ppc_load_sequence ((c), (D), (V))
+#else
 #define ppc_load_func(c,D,v) G_STMT_START { \
-               ppc_load_sequence ((c), ppc_r11, (guint64)(gsize)(v));  \
-               ppc_ldptr ((c), ppc_r2, 8, ppc_r11);    \
-               ppc_ldptr ((c), (D), 0, ppc_r11);       \
+               ppc_load_sequence ((c), ppc_r12, (guint64)(gsize)(v));  \
+               ppc_ldptr ((c), ppc_r2, sizeof (gpointer), ppc_r12);    \
+               ppc_ldptr ((c), (D), 0, ppc_r12);       \
        } G_STMT_END
+#endif
 
 #define ppc_load_multiple_regs(c,D,d,A) G_STMT_START { \
                int __i, __o = (d);                     \