상속: Instruction
예제 #1
0
        public void Visit(UnaryOp ins)
        {
            Vector4f a = ctx.ReadValue (ins.Source);
            Vector4f res = new Vector4f ();
            switch (ins.Operation) {
            case UnaryOpKind.Rcp:
                //Reciprocal intrinsic precision is too small
                res = new Vector4f (1f) / a;
                break;
            case UnaryOpKind.Frc:
                res = a.FractionalPart ();
                break;
            case UnaryOpKind.Rsq:
                //Reciprocal intrinsic precision is too small
                res = a.SquareRootReciprocal ();
                break;
            case UnaryOpKind.Abs:
                res = a.Absolute ();
                break;
            default:
                throw new Exception ("Cant handle " + ins.Operation);
            }

            if (Tracing.Enabled) Console.WriteLine ("{0} {1} => {2} == {3}", ins.Source, ins.Operation, a, res);
            ctx.StoreValue (ins.Dest, res);
        }
예제 #2
0
        public void Visit(UnaryOp ins)
        {
            Vector4f a = ctx.ReadValue (ins.Source);
            Vector4f res = new Vector4f ();
            switch (ins.Operation) {
            case UnaryOpKind.Rcp:
                res = a.Reciprocal ();
                break;
            }

            if (Tracing.Enabled) Console.WriteLine ("{0} {1} => {2} == {3}", ins.Source, ins.Operation, a, res);
            ctx.StoreValue (ins.Dest, res);
        }
예제 #3
0
 public void Visit(UnaryOp ins)
 {
     VisitSrcReg (ins.Source);
     VisitDestReg (ins.Dest);
 }
예제 #4
0
 public void Visit(UnaryOp ins)
 {
 }
예제 #5
0
 public void Visit(UnaryOp ins)
 {
     ctx.EmitUnary (ins);
     ctx.StoreValue (ins.Dest);
 }
예제 #6
0
 internal void EmitUnary(UnaryOp ins)
 {
     switch (ins.Operation) {
     case UnaryOpKind.Rcp:
         EmitTempVector4f (1);
         LoadValue (ins.Source);
         ilgen.Emit (OpCodes.Call, typeof (Vector4f).GetMethod ("op_Division"));
         break;
     case UnaryOpKind.Frc:
         LoadValue (ins.Source);
         ilgen.Emit (OpCodes.Call, typeof (SimdExtras).GetMethod ("FractionalPart"));
         break;
     case UnaryOpKind.Rsq:
         LoadValue (ins.Source);
         ilgen.Emit (OpCodes.Call, typeof (SimdExtras).GetMethod ("SquareRootReciprocal"));
         break;
     case UnaryOpKind.Abs:
         LoadValue (ins.Source);
         ilgen.Emit (OpCodes.Call, typeof (SimdExtras).GetMethod ("Absolute"));
         break;
     default:
         throw new Exception ("can't handle unop " + ins.Operation);
     }
 }