]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/valgrind/src/valgrind-3.6.0-svn/none/tests/ppc32/jm-insns.c
update
[l4.git] / l4 / pkg / valgrind / src / valgrind-3.6.0-svn / none / tests / ppc32 / jm-insns.c
index 16adc731b4f475cc0d8d90d5c7cfd730dd90afc3..f056d8e1ed30a5e8e43398e4276d528f641f31a1 100644 (file)
@@ -167,15 +167,32 @@ case I chased).
 
 #include <stdint.h>
 #include "tests/sys_mman.h"
+#include "tests/malloc.h"       // memalign16
+
+#define STATIC_ASSERT(e) sizeof(struct { int:-!(e); })
 
 /* Something of the same size as void*, so can be safely be coerced
-   to/from a pointer type. Also same size as the host's gp registers. */
+ * to/from a pointer type. Also same size as the host's gp registers.
+ * According to the AltiVec section of the GCC manual, the syntax does
+ * not allow the use of a typedef name as a type specifier in conjunction
+ * with the vector keyword, so typedefs uint[32|64]_t are #undef'ed here
+ * and redefined using #define.
+ */
+#undef uint32_t
+#undef uint64_t
+#define uint32_t unsigned int
+#define uint64_t unsigned long long int
+
 #ifndef __powerpc64__
 typedef uint32_t  HWord_t;
 #else
 typedef uint64_t  HWord_t;
-#endif // #ifndef __powerpc64__
+#endif /* __powerpc64__ */
 
+enum {
+    compile_time_test1 = STATIC_ASSERT(sizeof(uint32_t) == 4),
+    compile_time_test2 = STATIC_ASSERT(sizeof(uint64_t) == 8),
+};
 
 #define ALLCR "cr0","cr1","cr2","cr3","cr4","cr5","cr6","cr7"
 
@@ -210,17 +227,17 @@ typedef uint64_t  HWord_t;
 
 
 /* XXXX these must all be callee-save regs! */
-register double f14 __asm__ ("f14");
-register double f15 __asm__ ("f15");
-register double f16 __asm__ ("f16");
-register double f17 __asm__ ("f17");
+register double f14 __asm__ ("fr14");
+register double f15 __asm__ ("fr15");
+register double f16 __asm__ ("fr16");
+register double f17 __asm__ ("fr17");
 register HWord_t r14 __asm__ ("r14");
 register HWord_t r15 __asm__ ("r15");
 register HWord_t r16 __asm__ ("r16");
 register HWord_t r17 __asm__ ("r17");
 
-#include "config.h"
-#if defined (HAVE_ALTIVEC_H)
+#include "config.h"         // HAS_ALTIVEC
+#if defined (HAS_ALTIVEC)
 #   include <altivec.h>
 #endif
 #include <assert.h>
@@ -4597,7 +4614,7 @@ static void test_int_three_args (const char* name, test_func_t func,
 #ifndef __powerpc64__
             printf("%s %08x, %08x, %08x => %08x (%08x %08x)\n",
 #else
-            printf("%s %016lx, %016lx, %016lx => %016lx (%08x %08x)\n",
+            printf("%s %016llx, %016llx, %016llx => %016llx (%08x %08x)\n",
 #endif
                    name, iargs[i], iargs[j], iargs[k], res, flags, xer);
          }
@@ -4641,7 +4658,7 @@ static void test_int_two_args (const char* name, test_func_t func,
          printf("%s %08x, %08x => %08x (%08x %08x)\n",
 #else
          if (zap_hi32) res &= 0xFFFFFFFFULL;
-         printf("%s %016lx, %016lx => %016lx (%08x %08x)\n",
+         printf("%s %016llx, %016llx => %016llx (%08x %08x)\n",
 #endif
                 name, iargs[i], iargs[j], res, flags, xer);
       }
@@ -4673,7 +4690,7 @@ static void test_int_one_arg (const char* name, test_func_t func,
 #ifndef __powerpc64__
       printf("%s %08x => %08x (%08x %08x)\n",
 #else
-      printf("%s %016lx => %016lx (%08x %08x)\n",
+      printf("%s %016llx => %016llx (%08x %08x)\n",
 #endif
              name, iargs[i], res, flags, xer);
    }
@@ -4773,7 +4790,7 @@ static void test_int_one_reg_imm16 (const char* name,
 #ifndef __powerpc64__
          printf("%s %08x, %08x => %08x (%08x %08x)\n",
 #else
-         printf("%s %016lx, %08x => %016lx (%08x %08x)\n",
+         printf("%s %016llx, %08x => %016llx (%08x %08x)\n",
 #endif
                 name, iargs[i], ii16[j], res, flags, xer);
       }
@@ -4838,7 +4855,7 @@ static void rlwi_cb (const char* name, test_func_t func_IN,
 #ifndef __powerpc64__
                printf("%s %08x, %2d, %2d, %2d => %08x (%08x %08x)\n",
 #else
-               printf("%s %016lx, %2d, %2d, %2d => %016lx (%08x %08x)\n",
+               printf("%s %016llx, %2d, %2d, %2d => %016llx (%08x %08x)\n",
 #endif
                       name, iargs[i], j, k, l, res, flags, xer);
             }
@@ -4879,7 +4896,7 @@ static void rlwnm_cb (const char* name, test_func_t func_IN,
 #ifndef __powerpc64__
                printf("%s %08x, %08x, %2d, %2d => %08x (%08x %08x)\n",
 #else
-               printf("%s %016lx, %016lx, %2d, %2d => %016lx (%08x %08x)\n",
+               printf("%s %016llx, %016llx, %2d, %2d => %016llx (%08x %08x)\n",
 #endif
                       name, iargs[i], iargs[j], k, l, res, flags, xer);
             }
@@ -4916,7 +4933,7 @@ static void srawi_cb (const char* name, test_func_t func_IN,
 #ifndef __powerpc64__
          printf("%s %08x, %2d => %08x (%08x %08x)\n",
 #else
-         printf("%s %016lx, %2d => %016lx (%08x %08x)\n",
+         printf("%s %016llx, %2d => %016llx (%08x %08x)\n",
 #endif
                 name, iargs[i], j, res, flags, xer);
       }
@@ -4952,7 +4969,7 @@ static void mcrf_cb (const char* name, test_func_t func_IN,
 #ifndef __powerpc64__
             printf("%s %d, %d (%08x) => (%08x %08x)\n",
 #else
-            printf("%s %d, %d (%016lx) => (%08x %08x)\n",
+            printf("%s %d, %d (%016llx) => (%08x %08x)\n",
 #endif
                    name, j, k, iargs[i], flags, xer);
          }
@@ -5012,7 +5029,7 @@ static void mfcr_cb (const char* name, test_func_t func,
 #ifndef __powerpc64__
       printf("%s (%08x) => %08x (%08x %08x)\n",
 #else
-      printf("%s (%016lx) => %016lx (%08x %08x)\n",
+      printf("%s (%016llx) => %016llx (%08x %08x)\n",
 #endif
              name, iargs[i], res, flags, xer);
    }
@@ -5040,7 +5057,7 @@ static void mfspr_cb (const char* name, test_func_t func,
 #ifndef __powerpc64__
       printf("%s 1 (%08x) -> mtxer -> mfxer => %08x\n",
 #else
-      printf("%s 1 (%08x) -> mtxer -> mfxer => %016lx\n",
+      printf("%s 1 (%08x) -> mtxer -> mfxer => %016llx\n",
 #endif
              name, j, res);
    }
@@ -5057,7 +5074,7 @@ static void mfspr_cb (const char* name, test_func_t func,
 #ifndef __powerpc64__
       printf("%s 8 (%08x) ->  mtlr ->  mflr => %08x\n",
 #else
-      printf("%s 8 (%08x) ->  mtlr ->  mflr => %016lx\n",
+      printf("%s 8 (%08x) ->  mtlr ->  mflr => %016llx\n",
 #endif
              name, j, res);
    }
@@ -5074,7 +5091,7 @@ static void mfspr_cb (const char* name, test_func_t func,
 #ifndef __powerpc64__
       printf("%s 9 (%08x) -> mtctr -> mfctr => %08x\n",
 #else
-      printf("%s 9 (%08x) -> mtctr -> mfctr => %016lx\n",
+      printf("%s 9 (%08x) -> mtctr -> mfctr => %016llx\n",
 #endif
              name, j, res);
    }
@@ -5105,7 +5122,7 @@ static void mtcrf_cb (const char* name, test_func_t func_IN,
 #ifndef __powerpc64__
          printf("%s %3d, %08x => (%08x %08x)\n",
 #else
-         printf("%s %3d, %016lx => (%08x %08x)\n",
+         printf("%s %3d, %016llx => (%08x %08x)\n",
 #endif
                 name, j, iargs[i], flags, xer);
       }
@@ -5146,7 +5163,7 @@ static void rldc_cb (const char* name, test_func_t func_IN,
             GET_CR_XER(flags,xer);
             res = r17;
 
-            printf("%s %016lx, %016lx, %2d => %016lx (%08x %08x)\n",
+            printf("%s %016llx, %016llx, %2d => %016llx (%08x %08x)\n",
                    name, iargs[i], iargs[j], k, res, flags, xer);
          }
          if (verbose) printf("\n");
@@ -5181,7 +5198,7 @@ static void rldi_cb (const char* name, test_func_t func_IN,
             GET_CR_XER(flags,xer);
             res = r17;
 
-            printf("%s %016lx, %2d, %2d => %016lx (%08x %08x)\n",
+            printf("%s %016llx, %2d, %2d => %016llx (%08x %08x)\n",
                    name, iargs[i], j, k, res, flags, xer);
          }
          if (verbose) printf("\n");
@@ -5214,7 +5231,7 @@ static void sradi_cb (const char* name, test_func_t func_IN,
          GET_CR_XER(flags,xer);
          res = r17;
 
-         printf("%s %016lx, %2d => %016lx (%08x %08x)\n",
+         printf("%s %016llx, %2d => %016llx (%08x %08x)\n",
                 name, iargs[i], j, res, flags, xer);
       }
       if (verbose) printf("\n");
@@ -5429,7 +5446,7 @@ static void test_int_ld_one_reg_imm16 (const char* name,
 #ifndef __powerpc64__
       printf("%s %2d, (%08x) => %08x, %2d (%08x %08x)\n",
 #else
-      printf("%s %3d, (%016lx) => %016lx, %3ld (%08x %08x)\n",
+      printf("%s %3d, (%016llx) => %016llx, %3lld (%08x %08x)\n",
 #endif
              name, offs, iargs[i], res, r14-base, flags, xer);
    }
@@ -5454,7 +5471,7 @@ static void test_int_ld_one_reg_imm16 (const char* name,
 #ifndef __powerpc64__
       printf("%s %2d, (%08x) => %08x, %2d (%08x %08x)\n",
 #else
-      printf("%s %3d, (%016lx) => %016lx, %3ld (%08x %08x)\n",
+      printf("%s %3d, (%016llx) => %016llx, %3lld (%08x %08x)\n",
 #endif
              name, offs, iargs[nb_iargs-1+i], res, r14-base, flags, xer);
    }
@@ -5483,7 +5500,7 @@ static void test_int_ld_two_regs (const char* name,
 #ifndef __powerpc64__
       printf("%s %d (%08x) => %08x, %d (%08x %08x)\n",
 #else
-      printf("%s %3d, (%016lx) => %016lx, %2ld (%08x %08x)\n",
+      printf("%s %3d, (%016llx) => %016llx, %2lld (%08x %08x)\n",
 #endif
              name, offs, iargs[i], res, r14-base, flags, xer);
    }
@@ -5524,7 +5541,7 @@ static void test_int_st_two_regs_imm16 (const char* name,
 #ifndef __powerpc64__
       printf("%s %08x, %2d => %08x, %2d (%08x %08x)\n",
 #else
-      printf("%s %016lx, %3d => %016lx, %3ld (%08x %08x)\n",
+      printf("%s %016llx, %3d => %016llx, %3lld (%08x %08x)\n",
 #endif
              name, iargs[i], offs, iargs_priv[i], r15-base, flags, xer);
    }
@@ -5552,7 +5569,7 @@ static void test_int_st_two_regs_imm16 (const char* name,
 #ifndef __powerpc64__
       printf("%s %08x, %2d => %08x, %2d (%08x %08x)\n",
 #else
-      printf("%s %016lx, %3d => %016lx, %3ld (%08x %08x)\n",
+      printf("%s %016llx, %3d => %016llx, %3lld (%08x %08x)\n",
 #endif
              name, iargs[nb_iargs-1+i], offs, iargs_priv[nb_iargs-1+i],
              r15-base, flags, xer);
@@ -5588,7 +5605,7 @@ static void test_int_st_three_regs (const char* name,
 #ifndef __powerpc64__
       printf("%s %08x, %d => %08x, %d (%08x %08x)\n",
 #else
-      printf("%s %016lx, %3d => %016lx, %2ld (%08x %08x)\n",
+      printf("%s %016llx, %3d => %016llx, %2lld (%08x %08x)\n",
 #endif
              name, iargs[i], offs, iargs_priv[i], r15-base, flags, xer);
    }
@@ -5650,7 +5667,7 @@ static void test_float_three_args (const char* name, test_func_t func,
 #ifndef __powerpc64__
             printf("%s %016llx, %016llx, %016llx => %016llx",
 #else
-            printf("%s %016lx, %016lx, %016lx => %016lx",
+            printf("%s %016llx, %016llx, %016llx => %016llx",
 #endif
                    name, u0, u1, u2, ur);
 #if defined TEST_FLOAT_FLAGS
@@ -5688,7 +5705,7 @@ static void test_float_two_args (const char* name, test_func_t func,
 #ifndef __powerpc64__
          printf("%s %016llx, %016llx => %016llx",
 #else
-         printf("%s %016lx, %016lx => %016lx",
+         printf("%s %016llx, %016llx => %016llx",
 #endif
                 name, u0, u1, ur);
 #if defined TEST_FLOAT_FLAGS
@@ -5729,7 +5746,7 @@ static void test_float_one_arg (const char* name, test_func_t func,
 #ifndef __powerpc64__
       printf("%s %016llx => %016llx",
 #else
-      printf("%s %016lx => %016lx",
+      printf("%s %016llx => %016llx",
 #endif
              name, u0, ur);
 #if defined TEST_FLOAT_FLAGS
@@ -5837,7 +5854,7 @@ static void test_float_ld_one_reg_imm16 (const char* name,
 #ifndef __powerpc64__
       printf("%s %016llx, %4d => %016llx, %4d",
 #else
-      printf("%s %016lx, %4d => %016lx, %4ld",
+      printf("%s %016llx, %4d => %016llx, %4lld",
 #endif
              name, double_to_bits(src), offs,
              double_to_bits(res), r14-base);
@@ -5880,7 +5897,7 @@ static void test_float_ld_two_regs (const char* name,
 #ifndef __powerpc64__
       printf("%s %016llx, %4d => %016llx, %4d",
 #else
-      printf("%s %016lx, %4ld => %016lx, %4ld",
+      printf("%s %016llx, %4lld => %016llx, %4lld",
 #endif
              name, double_to_bits(src), r15/*offs*/,
              double_to_bits(res), r14-base);
@@ -5948,7 +5965,7 @@ static void test_float_st_two_regs_imm16 (const char* name,
 #ifndef __powerpc64__
       printf("%s %016llx, %4d => %016llx, %4d",
 #else
-      printf("%s %016lx, %4d => %016lx, %4ld",
+      printf("%s %016llx, %4d => %016llx, %4lld",
 #endif
              name, double_to_bits(src), offs,
              double_to_bits(*p_dst), r15-base);
@@ -6011,7 +6028,7 @@ static void test_float_st_three_regs (const char* name,
 #ifndef __powerpc64__
       printf("%s %016llx, %4d => %016llx, %4d",
 #else
-      printf("%s %016lx, %4ld => %016lx, %4ld",
+      printf("%s %016llx, %4lld => %016llx, %4lld",
 #endif
              name, double_to_bits(src), r16/*offs*/,
              double_to_bits(*p_dst), r15-base);
@@ -6026,7 +6043,7 @@ static void test_float_st_three_regs (const char* name,
 #ifndef __powerpc64__
       printf("%s %016llx (%014e), %4d => %016llx (%014e), %08x (%08x %08x)\n",
 #else
-      printf("%s %016lx (%014e), %4d => %016lx (%014e), %08x (%08x %08x)\n",
+      printf("%s %016llx (%014e), %4d => %016llx (%014e), %08x (%08x %08x)\n",
 #endif
              name, double_to_bits(src), src, offs,
              double_to_bits(*p_dst), *p_dst, r15, flags, xer);
@@ -6035,7 +6052,7 @@ static void test_float_st_three_regs (const char* name,
 #ifndef __powerpc64__
       printf("%s %016llx (%014e), %4d => %08x (%f), %08x (%08x %08x)\n",
 #else
-      printf("%s %016lx (%014e), %4d => %08x (%f), %08x (%08x %08x)\n",
+      printf("%s %016llx (%014e), %4d => %08x (%f), %08x (%08x %08x)\n",
 #endif
              name, double_to_bits(src), src, offs,
              (uint32_t)(double_to_bits(*p_dst) >> 32),
@@ -6075,9 +6092,9 @@ static test_loop_t float_loops[] = {
          volatile vector unsigned int v2 =
             //            (vector unsigned int){ 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF };
             (vector unsigned int){ 0x01010101,0x01010101,0x01010101,0x01010101 };
-         //__asm__ __volatile__ ("vcmpequw. 31,%0,%1" : : "vr" (v1), "vr" (v2));   // sets CR[6]
-         //__asm__ __volatile__ ("vpkswss 31,%0,%1" : : "vr" (v1), "vr" (v2));     // sets VSCR[SAT]
-         __asm__ __volatile__ ("vsubsbs 31,%0,%1" : : "vr" (v1), "vr" (v2));       // sets VSCR[SAT]
+         //__asm__ __volatile__ ("vcmpequw. 31,%0,%1" : : "v" (v1), "v" (v2));   // sets CR[6]
+         //__asm__ __volatile__ ("vpkswss 31,%0,%1" : : "v" (v1), "v" (v2));     // sets VSCR[SAT]
+         __asm__ __volatile__ ("vsubsbs 31,%0,%1" : : "v" (v1), "v" (v2));       // sets VSCR[SAT]
 */
 
 //#define DEFAULT_VSCR 0x00010000
@@ -6106,11 +6123,11 @@ static void test_av_int_one_arg (const char* name, test_func_t func,
       // reset VSCR and CR
       vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
       flags = 0;
-      __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+      __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
       __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
 
       // load input -> r14
-      __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in));
+      __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in));
       
       // do stuff
       (*func)();
@@ -6124,7 +6141,7 @@ static void test_av_int_one_arg (const char* name, test_func_t func,
       
       /* Restore flags */
       __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-      __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+      __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
 
       src = (unsigned int*)&vec_in;
       dst = (unsigned int*)&vec_out;
@@ -6167,12 +6184,12 @@ static void test_av_int_two_args (const char* name, test_func_t func,
          // reset VSCR and CR
          vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
          flags = 0;
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
          __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
 
          // load inputs -> r14,r15
-         __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in1));
-         __asm__ __volatile__ ("vor 15,%0,%0" : : "vr" (vec_in2));
+         __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in1));
+         __asm__ __volatile__ ("vor 15,%0,%0" : : "v" (vec_in2));
          
          // do stuff
          (*func)();
@@ -6186,7 +6203,7 @@ static void test_av_int_two_args (const char* name, test_func_t func,
          
          /* Restore flags */
          __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
 
          src1 = (unsigned int*)&vec_in1;
          src2 = (unsigned int*)&vec_in2;
@@ -6235,13 +6252,13 @@ static void test_av_int_three_args (const char* name, test_func_t func,
             // reset VSCR and CR
             vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
             flags = 0;
-            __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+            __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
             __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
             
             // load inputs -> r14,r15,r16
-            __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in1));
-            __asm__ __volatile__ ("vor 15,%0,%0" : : "vr" (vec_in2));
-            __asm__ __volatile__ ("vor 16,%0,%0" : : "vr" (vec_in3));
+            __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in1));
+            __asm__ __volatile__ ("vor 15,%0,%0" : : "v" (vec_in2));
+            __asm__ __volatile__ ("vor 16,%0,%0" : : "v" (vec_in3));
             
             // do stuff
             (*func)();
@@ -6255,7 +6272,7 @@ static void test_av_int_three_args (const char* name, test_func_t func,
             
             /* Restore flags */
             __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-            __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+            __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
 
             src1 = (unsigned int*)&vec_in1;
             src2 = (unsigned int*)&vec_in2;
@@ -6309,12 +6326,12 @@ static void vs128_cb (const char* name, test_func_t func,
          // reset VSCR and CR
          vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
          flags = 0;
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
          __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
          
          // load inputs -> r14,r15
-         __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in1));
-         __asm__ __volatile__ ("vor 15,%0,%0" : : "vr" (vec_shft));
+         __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in1));
+         __asm__ __volatile__ ("vor 15,%0,%0" : : "v" (vec_shft));
          
          // do stuff
          (*func)();
@@ -6328,7 +6345,7 @@ static void vs128_cb (const char* name, test_func_t func,
          
          /* Restore flags */
          __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
 
          src1 = (unsigned int*)&vec_in1;
          src2 = (unsigned int*)&vec_shft;
@@ -6382,11 +6399,11 @@ static void vsplt_cb (const char* name, test_func_t func_IN,
          // reset VSCR and CR
          vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
          flags = 0;
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
          __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
          
          // load input -> r14
-         __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in1));
+         __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in1));
          
          // do stuff
          (*func)();
@@ -6400,7 +6417,7 @@ static void vsplt_cb (const char* name, test_func_t func_IN,
          
          /* Restore flags */
          __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
 
          src1 = (unsigned int*)&vec_in1;
          dst  = (unsigned int*)&vec_out;
@@ -6449,7 +6466,7 @@ static void vspltis_cb (const char* name, test_func_t func_IN,
       // reset VSCR and CR
       vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
       flags = 0;
-      __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+      __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
       __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
       
       // do stuff
@@ -6464,7 +6481,7 @@ static void vspltis_cb (const char* name, test_func_t func_IN,
       
       /* Restore flags */
       __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-      __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+      __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
       
       dst = (unsigned int*)&vec_out;
 
@@ -6511,12 +6528,12 @@ static void vsldoi_cb (const char* name, test_func_t func_IN,
             // reset VSCR and CR
             vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
             flags = 0;
-            __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+            __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
             __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
             
             // load inputs -> r14,r15
-            __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in1));
-            __asm__ __volatile__ ("vor 15,%0,%0" : : "vr" (vec_in2));
+            __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in1));
+            __asm__ __volatile__ ("vor 15,%0,%0" : : "v" (vec_in2));
             
             // do stuff
             (*func)();
@@ -6530,7 +6547,7 @@ static void vsldoi_cb (const char* name, test_func_t func_IN,
             
             /* Restore flags */
             __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-            __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+            __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
             
             src1   = (unsigned int*)&vec_in1;
             src2   = (unsigned int*)&vec_in2;
@@ -6582,7 +6599,7 @@ static void lvs_cb (const char *name, test_func_t func,
       // reset VSCR and CR
       vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
       flags = 0;
-      __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+      __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
       __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));         
       
       // do stuff
@@ -6597,7 +6614,7 @@ static void lvs_cb (const char *name, test_func_t func,
       
       /* Restore flags */
       __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-      __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+      __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
       
       dst = (unsigned int*)&vec_out;
 
@@ -6695,7 +6712,7 @@ static void test_av_int_ld_two_regs (const char *name,
          // reset VSCR and CR
          vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
          flags = 0;
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
          __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
 
          // do stuff
@@ -6710,7 +6727,7 @@ static void test_av_int_ld_two_regs (const char *name,
          
          /* Restore flags */
          __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
          
          vec_in = (vector unsigned int)viargs[i];
          src = (unsigned int*)&vec_in;
@@ -6781,11 +6798,11 @@ static void test_av_int_st_three_regs (const char *name,
          // reset VSCR and CR
          vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
          flags = 0;
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
          __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
 
          // load inputs -> r14
-         __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in));
+         __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in));
          
          // do stuff
          (*func)();
@@ -6798,7 +6815,7 @@ static void test_av_int_st_three_regs (const char *name,
          
          /* Restore flags */
          __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
          
          vec_out = (vector unsigned int)viargs_priv[i];
          src = (unsigned int*)&vec_in;
@@ -6862,11 +6879,11 @@ static void test_av_float_one_arg (const char* name, test_func_t func,
       // reset VSCR and CR
       vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
       flags = 0;
-      __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+      __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
       __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
       
       // load input -> r14
-      __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in));
+      __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in));
       
       // do stuff
       (*func)();
@@ -6880,7 +6897,7 @@ static void test_av_float_one_arg (const char* name, test_func_t func,
       
       /* Restore flags */
       __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-      __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+      __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
 
       src = (unsigned int*)&vec_in;
       dst = (unsigned int*)&vec_out;
@@ -6924,12 +6941,12 @@ static void test_av_float_two_args (const char* name, test_func_t func,
          // reset VSCR and CR
          vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
          flags = 0;
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
          __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
 
          // load inputs -> r14,r15
-         __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in1));
-         __asm__ __volatile__ ("vor 15,%0,%0" : : "vr" (vec_in2));
+         __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in1));
+         __asm__ __volatile__ ("vor 15,%0,%0" : : "v" (vec_in2));
 
          // do stuff
          (*func)();
@@ -6943,7 +6960,7 @@ static void test_av_float_two_args (const char* name, test_func_t func,
 
          /* Restore flags */
          __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
 
          src1 = (unsigned int*)&vec_in1;
          src2 = (unsigned int*)&vec_in2;
@@ -6993,13 +7010,13 @@ static void test_av_float_three_args (const char* name, test_func_t func,
             // reset VSCR and CR
             vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
             flags = 0;
-            __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+            __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
             __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
 
             // load inputs -> r14,r15,r16
-            __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in1));
-            __asm__ __volatile__ ("vor 15,%0,%0" : : "vr" (vec_in2));
-            __asm__ __volatile__ ("vor 16,%0,%0" : : "vr" (vec_in3));
+            __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in1));
+            __asm__ __volatile__ ("vor 15,%0,%0" : : "v" (vec_in2));
+            __asm__ __volatile__ ("vor 16,%0,%0" : : "v" (vec_in3));
 
             // do stuff
             (*func)();
@@ -7013,7 +7030,7 @@ static void test_av_float_three_args (const char* name, test_func_t func,
 
             /* Restore flags */
             __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-            __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+            __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
 
             src1 = (unsigned int*)&vec_in1;
             src2 = (unsigned int*)&vec_in2;
@@ -7069,11 +7086,11 @@ static void vcvt_cb (const char* name, test_func_t func_IN,
          // reset VSCR and CR
          vscr = (vector unsigned int){ 0,0,0,DEFAULT_VSCR };
          flags = 0;
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (vscr) );
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (vscr) );
          __asm__ __volatile__ ("mtcr   %0" : : "r" (flags));
          
          // load input -> r14
-         __asm__ __volatile__ ("vor 14,%0,%0" : : "vr" (vec_in));
+         __asm__ __volatile__ ("vor 14,%0,%0" : : "v" (vec_in));
          
          // do stuff
          (*func)();
@@ -7087,7 +7104,7 @@ static void vcvt_cb (const char* name, test_func_t func_IN,
          
          /* Restore flags */
          __asm__ __volatile__ ("mtcr   %0" : : "r"  (tmpcr));
-         __asm__ __volatile__ ("mtvscr %0" : : "vr" (tmpvscr));
+         __asm__ __volatile__ ("mtvscr %0" : : "v" (tmpvscr));
 
          src = (unsigned int*)&vec_in;
          dst = (unsigned int*)&vec_out;