Adding a clarifying comment as to why HWIntrinsicInfo::lookupIval returns an inverted...
authorTanner Gooding <tagoo@outlook.com>
Wed, 6 May 2020 04:01:42 +0000 (21:01 -0700)
committerGitHub <noreply@github.com>
Wed, 6 May 2020 04:01:42 +0000 (04:01 +0000)
src/coreclr/src/jit/hwintrinsic.h

index fc3686f..b3c00f4 100644 (file)
@@ -328,6 +328,11 @@ struct HWIntrinsicInfo
                     return static_cast<int>(FloatComparisonMode::OrderedGreaterThanSignaling);
                 }
 
+                // CompareGreaterThan is not directly supported in hardware without AVX support.
+                // We will return the inverted case here and lowering will itself swap the ops
+                // to ensure the emitted code remains correct. This simplifies the overall logic
+                // here and for other use cases.
+
                 assert(id != NI_AVX_CompareGreaterThan);
                 return static_cast<int>(FloatComparisonMode::OrderedLessThanSignaling);
             }
@@ -352,6 +357,11 @@ struct HWIntrinsicInfo
                     return static_cast<int>(FloatComparisonMode::OrderedGreaterThanOrEqualSignaling);
                 }
 
+                // CompareGreaterThanOrEqual is not directly supported in hardware without AVX support.
+                // We will return the inverted case here and lowering will itself swap the ops
+                // to ensure the emitted code remains correct. This simplifies the overall logic
+                // here and for other use cases.
+
                 assert(id != NI_AVX_CompareGreaterThanOrEqual);
                 return static_cast<int>(FloatComparisonMode::OrderedLessThanOrEqualSignaling);
             }
@@ -385,6 +395,11 @@ struct HWIntrinsicInfo
                     return static_cast<int>(FloatComparisonMode::UnorderedNotGreaterThanSignaling);
                 }
 
+                // CompareNotGreaterThan is not directly supported in hardware without AVX support.
+                // We will return the inverted case here and lowering will itself swap the ops
+                // to ensure the emitted code remains correct. This simplifies the overall logic
+                // here and for other use cases.
+
                 assert(id != NI_AVX_CompareNotGreaterThan);
                 return static_cast<int>(FloatComparisonMode::UnorderedNotLessThanSignaling);
             }
@@ -409,6 +424,11 @@ struct HWIntrinsicInfo
                     return static_cast<int>(FloatComparisonMode::UnorderedNotGreaterThanOrEqualSignaling);
                 }
 
+                // CompareNotGreaterThanOrEqual is not directly supported in hardware without AVX support.
+                // We will return the inverted case here and lowering will itself swap the ops
+                // to ensure the emitted code remains correct. This simplifies the overall logic
+                // here and for other use cases.
+
                 assert(id != NI_AVX_CompareNotGreaterThanOrEqual);
                 return static_cast<int>(FloatComparisonMode::UnorderedNotLessThanOrEqualSignaling);
             }