Commit 421ea59c authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

[wasm][simd][ia32] Fix unaligned loads for F32x4Abs, F32x4Neg, etc.

- Fix unaligned accesses by inserting a move.
- These ops seem to have the issue:

https://source.chromium.org/chromium/chromium/src/+/master:v8/src/compiler/backend/ia32/instruction-selector-ia32.cc;drc=fbc697b50b13df0c4078ad9c1fc6991f1f670e2e;l=2150

Bug: chromium:1142528
Change-Id: I502edf02f80c70f1d26b1b6dafd4d362e7dc5f96
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2499294Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70768}
parent 795c0b1c
......@@ -2213,9 +2213,11 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ psrld(kScratchDoubleReg, 1);
__ andps(dst, kScratchDoubleReg);
} else {
// TODO(zhin) Improve codegen for this case.
__ pcmpeqd(dst, dst);
__ movups(kScratchDoubleReg, src);
__ psrld(dst, 1);
__ andps(dst, src);
__ andps(dst, kScratchDoubleReg);
}
break;
}
......@@ -2235,9 +2237,11 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ pslld(kScratchDoubleReg, 31);
__ xorps(dst, kScratchDoubleReg);
} else {
// TODO(zhin) Improve codegen for this case.
__ pcmpeqd(dst, dst);
__ movups(kScratchDoubleReg, src);
__ pslld(dst, 31);
__ xorps(dst, src);
__ xorps(dst, kScratchDoubleReg);
}
break;
}
......@@ -2250,7 +2254,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kSSEF32x4Sqrt: {
__ sqrtps(i.OutputSimd128Register(), i.InputOperand(0));
// TODO(zhin) Improve codegen for this case.
__ movups(kScratchDoubleReg, i.InputOperand(0));
__ sqrtps(i.OutputSimd128Register(), kScratchDoubleReg);
break;
}
case kAVXF32x4Sqrt: {
......@@ -3643,8 +3649,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
__ pxor(dst, kScratchDoubleReg);
} else {
// TODO(zhin) Improve codegen for this case.
__ pcmpeqd(dst, dst);
__ pxor(dst, src);
__ movups(kScratchDoubleReg, src);
__ pxor(dst, kScratchDoubleReg);
}
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment