Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a clarifying comment as to why HWIntrinsicInfo::lookupIval returns an inverted comparison op #35867

Merged
1 commit merged into from
May 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/coreclr/src/jit/hwintrinsic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down