2008-11-20 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Thu, 20 Nov 2008 17:51:23 +0000 (17:51 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Thu, 20 Nov 2008 17:51:23 +0000 (17:51 -0000)
* basic-simd.cs: Add tests for accessors of Vector4i and Vector4ui.

svn path=/trunk/mono/; revision=119479

mono/mini/ChangeLog
mono/mini/basic-simd.cs

index 09ac99c2c41cc4215f607da6e14dd2dc366b3f29..b8ec736be6f840a58b0a0289cc73296590f052dd 100644 (file)
@@ -1,3 +1,7 @@
+2008-11-20  Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * basic-simd.cs: Add tests for accessors of Vector4i and Vector4ui.
+
 2008-11-20  Rodrigo Kumpera  <rkumpera@novell.com>
 
        * mini-ops.h: Added OP_INSERTX_I4_SLOW,.
index 32c8c9ca414a7c331837a09052022da1c65bbb1e..bb47187f3b493b828d1f2c26f6f1263647a5e0df 100644 (file)
@@ -2,6 +2,62 @@ using System;
 using Mono.Simd;
 
 public class SimdTests {
+       public static int test_0_accessor_vecto4i () {
+               Vector4i a = new Vector4i (0x70000000, -1, 3, 4);
+
+               if (a.X != 0x70000000)
+                       return 1;
+               if (a.Y != -1)
+                       return 2;
+               if (a.Z != 3)
+                       return 3;
+               if (a.W != 4)
+                       return 4;
+
+               a.X = 11;
+               a.Y = 22;
+               a.Z = 33333344;
+               a.W = -44444444;
+               
+               if (a.X != 11)
+                       return 5;
+               if (a.Y != 22)
+                       return 6;
+               if (a.Z != 33333344)
+                       return 7;
+               if (a.W != -44444444)
+                       return 8;
+               return 0;
+       }
+
+       public static int test_0_accessor_vecto4ui () {
+               Vector4ui a = new Vector4ui (0xF0000000, 0xF0000, 3, 4);
+
+               if (a.X != 0xF0000000)
+                       return 1;
+               if (a.Y != 0xF0000)
+                       return 2;
+               if (a.Z != 3)
+                       return 3;
+               if (a.W != 4)
+                       return 4;
+
+               a.X = 11;
+               a.Y = 22;
+               a.Z = 33333344;
+               a.W = 44444444;
+
+               if (a.X != 11)
+                       return 5;
+               if (a.Y != 22)
+                       return 6;
+               if (a.Z != 33333344)
+                       return 7;
+               if (a.W != 44444444)
+                       return 8;
+               return 0;
+       }
+       
        static float use_getter_with_byref (ref Vector4f a) {
                return a.W;
        }