-
Notifications
You must be signed in to change notification settings - Fork 5k
[RISC-V] Use zero register as argument for atomics #112693
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
Changes from all commits
08f16f1
45094aa
bee8945
f137e8f
798f80c
68730b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,6 +200,26 @@ static bool isValidSimm32(ssize_t value) | |
return (-(((ssize_t)1) << 31) - 0x800) <= value && value < (((ssize_t)1) << 31) - 0x800; | ||
} | ||
|
||
//------------------------------------------------------------------------ | ||
// isSingleInstructionFpImm: checks if the floating-point constant can be synthesized with one instruction | ||
// | ||
// Arguments: | ||
// value - the constant to be imm'ed | ||
// size - size of the target immediate | ||
// outBits - [out] the bits of the immediate | ||
// | ||
// Return Value: | ||
// Whether the floating-point immediate can be synthesized with one instruction | ||
// | ||
static bool isSingleInstructionFpImm(double value, emitAttr size, int64_t* outBits) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be more useful to return out some enum that indicates if we're doing, none, Simm12, or Simm20 instead of the bool? There is significant coupling of the callers to this and them subsequently doing the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about it but it complicated the signature of this simple helper, besides LSRA doesn't need to know which instruction will be used. |
||
{ | ||
assert(size == EA_4BYTE || size == EA_8BYTE); | ||
*outBits = (size == EA_4BYTE) | ||
? (int32_t)BitOperations::SingleToUInt32Bits(FloatingPointUtils::convertToSingle(value)) | ||
: (int64_t)BitOperations::DoubleToUInt64Bits(value); | ||
return isValidSimm12(*outBits) || (((*outBits & 0xfff) == 0) && isValidSimm20(*outBits >> 12)); | ||
} | ||
|
||
// Returns the number of bits used by the given 'size'. | ||
inline static unsigned getBitWidth(emitAttr size) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/dotnet/runtime/pull/111529/files#r1949135179