OpcodeDispatcher: Improve SHA1MSG1 output

We can simplify these inserts down to a single EXT
This commit is contained in:
Lioncache 2023-08-20 12:24:44 -04:00
parent 34722348e8
commit c3778a9729
2 changed files with 4 additions and 13 deletions

View File

@ -36,11 +36,7 @@ void OpDispatchBuilder::SHA1MSG1Op(OpcodeArgs) {
OrderedNode *Dest = LoadSource(FPRClass, Op, Op->Dest, Op->Flags, -1);
OrderedNode *Src = LoadSource(FPRClass, Op, Op->Src[0], Op->Flags, -1);
OrderedNode *NewVec{};
NewVec = _VInsElement(16, 4, 3, 1, Dest, Dest);
NewVec = _VInsElement(16, 4, 2, 0, NewVec, Dest);
NewVec = _VInsElement(16, 4, 1, 3, NewVec, Src);
NewVec = _VInsElement(16, 4, 0, 2, NewVec, Src);
OrderedNode *NewVec = _VExtr(16, 8, Dest, Src, 1);
// [W0, W1, W2, W3] ^ [W2, W3, W4, W5]
OrderedNode *Result = _VXor(16, 1, Dest, NewVec);

View File

@ -782,18 +782,13 @@
]
},
"sha1msg1 xmm0, xmm1": {
"ExpectedInstructionCount": 7,
"Optimal": "No",
"ExpectedInstructionCount": 2,
"Optimal": "Yes",
"Comment": [
"0x66 0x0f 0x38 0xc9"
],
"ExpectedArm64ASM": [
"mov v0.16b, v16.16b",
"mov v0.s[3], v16.s[1]",
"mov v4.16b, v0.16b",
"mov v4.s[2], v16.s[0]",
"mov v4.s[1], v17.s[3]",
"mov v4.s[0], v17.s[2]",
"ext v4.16b, v17.16b, v16.16b, #8",
"eor v16.16b, v16.16b, v4.16b"
]
},