summaryrefslogtreecommitdiff
path: root/src/jit/hwintrinsicxarch.cpp
diff options
context:
space:
mode:
authorTanner Gooding <tagoo@outlook.com>2018-06-02 08:29:36 -0700
committerTanner Gooding <tagoo@outlook.com>2018-06-02 14:23:38 -0700
commit565d5be3a5b109bb7dfd245fae3b261e05cc08bb (patch)
treeeb107f8da71cc4d3df8223822509ac628145fec7 /src/jit/hwintrinsicxarch.cpp
parent5d52f8c9f62c87909c62aa35a7db37a551951b8d (diff)
downloadcoreclr-565d5be3a5b109bb7dfd245fae3b261e05cc08bb.tar.gz
coreclr-565d5be3a5b109bb7dfd245fae3b261e05cc08bb.tar.bz2
coreclr-565d5be3a5b109bb7dfd245fae3b261e05cc08bb.zip
Moving the getHWIntrinsicInfo and getHWIntrinsicName methods to be static methods on HWIntrinsicInfo
Diffstat (limited to 'src/jit/hwintrinsicxarch.cpp')
-rw-r--r--src/jit/hwintrinsicxarch.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/jit/hwintrinsicxarch.cpp b/src/jit/hwintrinsicxarch.cpp
index 48b2d6791e..633a853a42 100644
--- a/src/jit/hwintrinsicxarch.cpp
+++ b/src/jit/hwintrinsicxarch.cpp
@@ -15,9 +15,22 @@ static const HWIntrinsicInfo hwIntrinsicInfoArray[] = {
#include "hwintrinsiclistxarch.h"
};
-extern const char* getHWIntrinsicName(NamedIntrinsic intrinsic)
+//------------------------------------------------------------------------
+// lookup: Gets the HWIntrinsicInfo associated with a given NamedIntrinsic
+//
+// Arguments:
+// id -- The NamedIntrinsic associated with the HWIntrinsic to lookup
+//
+// Return Value:
+// The HWIntrinsicInfo associated with id
+const HWIntrinsicInfo& HWIntrinsicInfo::lookup(NamedIntrinsic id)
{
- return hwIntrinsicInfoArray[intrinsic - NI_HW_INTRINSIC_START - 1].intrinsicName;
+ assert(id != NI_Illegal);
+
+ assert(id > NI_HW_INTRINSIC_START);
+ assert(id < NI_HW_INTRINSIC_END);
+
+ return hwIntrinsicInfoArray[id - NI_HW_INTRINSIC_START - 1];
}
//------------------------------------------------------------------------
@@ -124,9 +137,9 @@ NamedIntrinsic Compiler::lookupHWIntrinsic(const char* methodName, InstructionSe
{
for (int i = 0; i < NI_HW_INTRINSIC_END - NI_HW_INTRINSIC_START - 1; i++)
{
- if (isa == hwIntrinsicInfoArray[i].isa && strcmp(methodName, hwIntrinsicInfoArray[i].intrinsicName) == 0)
+ if (isa == hwIntrinsicInfoArray[i].isa && strcmp(methodName, hwIntrinsicInfoArray[i].name) == 0)
{
- result = hwIntrinsicInfoArray[i].intrinsicID;
+ result = hwIntrinsicInfoArray[i].id;
break;
}
}