-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add support for Sve.DuplicateSelectedScalarToVector() #103228
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 6 commits
66dca24
98208f6
39f4a31
76acc39
2356305
c4db535
8d8e513
f2d4a93
4943c53
7ce4662
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 |
|---|---|---|
|
|
@@ -7902,7 +7902,9 @@ void emitter::emitIns_R_S(instruction ins, emitAttr attr, regNumber reg1, int va | |
| { | ||
| useRegForImm = true; | ||
| regNumber rsvdReg = codeGen->rsGetRsvdReg(); | ||
| codeGen->instGen_Set_Reg_To_Imm(EA_PTRSIZE, rsvdReg, imm); | ||
| codeGen->instGen_Set_Reg_To_Base_Plus_Imm(EA_PTRSIZE, rsvdReg, reg2, imm); | ||
| reg2 = rsvdReg; | ||
| imm = 0; | ||
| } | ||
| } | ||
| break; | ||
|
|
@@ -7930,7 +7932,9 @@ void emitter::emitIns_R_S(instruction ins, emitAttr attr, regNumber reg1, int va | |
| { | ||
| useRegForImm = true; | ||
| regNumber rsvdReg = codeGen->rsGetRsvdReg(); | ||
| codeGen->instGen_Set_Reg_To_Imm(EA_PTRSIZE, rsvdReg, imm); | ||
| codeGen->instGen_Set_Reg_To_Base_Plus_Imm(EA_PTRSIZE, rsvdReg, reg2, imm); | ||
| reg2 = rsvdReg; | ||
| imm = 0; | ||
| } | ||
| } | ||
| break; | ||
|
|
@@ -8181,7 +8185,9 @@ void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber reg1, int va | |
| { | ||
| useRegForImm = true; | ||
| regNumber rsvdReg = codeGen->rsGetRsvdReg(); | ||
| codeGen->instGen_Set_Reg_To_Imm(EA_PTRSIZE, rsvdReg, imm); | ||
| codeGen->instGen_Set_Reg_To_Base_Plus_Imm(EA_PTRSIZE, rsvdReg, reg2, imm); | ||
| reg2 = rsvdReg; | ||
| imm = 0; | ||
| } | ||
| } | ||
| break; | ||
|
|
@@ -8209,7 +8215,9 @@ void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber reg1, int va | |
| { | ||
| useRegForImm = true; | ||
| regNumber rsvdReg = codeGen->rsGetRsvdReg(); | ||
| codeGen->instGen_Set_Reg_To_Imm(EA_PTRSIZE, rsvdReg, imm); | ||
| codeGen->instGen_Set_Reg_To_Base_Plus_Imm(EA_PTRSIZE, rsvdReg, reg2, imm); | ||
|
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. Is this change related to the 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 might actually need it for https://github.com/dotnet/runtime/pull/104065/files#diff-2b2c8b9011607926410624d6f81613fad7b74c6e0516d578675a8b792998fe4fR7893-R7896, but I am curious if you found a repro, for which you had to add change here. 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. This is not related to DUP directly. However, tests trigger a scenario where we end up in having a store with a larger immediate. |
||
| reg2 = rsvdReg; | ||
| imm = 0; | ||
| } | ||
| } | ||
| break; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -421,6 +421,10 @@ void HWIntrinsicInfo::lookupImmBounds( | |||||
| immUpperBound = (int)SVE_PATTERN_ALL; | ||||||
| break; | ||||||
|
|
||||||
| case NI_Sve_DuplicateSelectedScalarToVector: | ||||||
| immUpperBound = (512 / (genTypeSize(baseType) * BITS_PER_BYTE)) - 1; | ||||||
|
||||||
| immUpperBound = (512 / (genTypeSize(baseType) * BITS_PER_BYTE)) - 1; | |
| immUpperBound = Compiler::getSIMDVectorLength(simdSize, baseType) - 1; |
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.
We may not able able to use the getSIMDVectorLength() here as the imm for DUP seems special [1].
Is the immediate index, in the range 0 to one less than the number of elements in 512 bits, encoded in "imm2:tsz".
I didn't find a better helper method for this so did it explicitly.
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.
I was actually little confused with that description and then this one:
The immediate element index is in the range of 0 to 63 (bytes), 31 (halfwords), 15 (words), 7 (doublewords) or 3 (quadwords).
With ^ description, it sounded me like getSIMDVectorLength(), no?
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.
It's a bit confusing. Unlike other cases, the index here does not depend on the vector length. A valid index range is fixed based on the element type, e.g., 0 to 63 for vectors of type byte.
Uh oh!
There was an error while loading. Please reload this page.