Implement GT_INTRINSIC_Sqrt for floating-point
authorHyung-Kyu Choi <hk0110.choi@samsung.com>
Tue, 24 Jan 2017 11:04:09 +0000 (20:04 +0900)
committerHyung-Kyu Choi <hk0110.choi@samsung.com>
Tue, 24 Jan 2017 11:04:09 +0000 (20:04 +0900)
Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
src/jit/codegenarm.cpp
src/jit/lowerarm.cpp

index 2884fe0056bc1ab6171de2294be3253e4cb84a52..1ff7614fabed0d914341d6dc4010d6f9a3ed4d2e 100644 (file)
@@ -93,7 +93,8 @@ void CodeGen::genIntrinsic(GenTreePtr treeNode)
             break;
 
         case CORINFO_INTRINSIC_Sqrt:
-            NYI_ARM("genIntrinsic for sqrt - not implementd yet");
+            genConsumeOperands(treeNode->AsOp());
+            getEmitter()->emitInsBinary(INS_vsqrt, emitTypeSize(treeNode), treeNode, srcNode);
             break;
 
         default:
index 42dfbee4f279258677f5724623458fb6f87522c5..6739844678eb64abde777b5f69ec2ec51b572d1e 100644 (file)
@@ -882,11 +882,12 @@ void Lowering::TreeNodeInfoInit(GenTree* tree)
             switch (tree->gtIntrinsic.gtIntrinsicId)
             {
                 case CORINFO_INTRINSIC_Abs:
+                case CORINFO_INTRINSIC_Sqrt:
                     info->srcCount = 1;
                     info->dstCount = 1;
                     break;
                 default:
-                    NYI_ARM("Lowering::TreeNodeInfoInit for GT_INRINSIC");
+                    NYI_ARM("Lowering::TreeNodeInfoInit for GT_INTRINSIC");
                     break;
             }
         }