Commit c4cf2ea4 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[codegen] Remove redundant xorpd instructions

It seems like they were originally added in https://crrev.com/23654026
(Sep 2013) to break dependences in the OOO pipeline. This code pattern
was then later copied for other instructions too
(https://crrev.com/1424333002).
The reason for the xorpd is not mentioned in the code though, and I
found no other compiler doing this. So maybe it's obsolete by now, and
only increases code size.

Let's remove them and see if we get any performance regressions.

R=ahaas@chromium.org
CC=yangguo@chromium.org

Change-Id: I0e6d65afa67f0ee286e5b0ba95c91092c5261c8f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1926427Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65077}
parent 149f7f4d
...@@ -511,12 +511,10 @@ void MacroAssembler::MaybeDropFrames() { ...@@ -511,12 +511,10 @@ void MacroAssembler::MaybeDropFrames() {
} }
void TurboAssembler::Cvtsi2ss(XMMRegister dst, Operand src) { void TurboAssembler::Cvtsi2ss(XMMRegister dst, Operand src) {
xorps(dst, dst);
cvtsi2ss(dst, src); cvtsi2ss(dst, src);
} }
void TurboAssembler::Cvtsi2sd(XMMRegister dst, Operand src) { void TurboAssembler::Cvtsi2sd(XMMRegister dst, Operand src) {
xorpd(dst, dst);
cvtsi2sd(dst, src); cvtsi2sd(dst, src);
} }
......
...@@ -736,10 +736,8 @@ void TurboAssembler::Cvtsd2ss(XMMRegister dst, Operand src) { ...@@ -736,10 +736,8 @@ void TurboAssembler::Cvtsd2ss(XMMRegister dst, Operand src) {
void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Register src) { void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Register src) {
if (CpuFeatures::IsSupported(AVX)) { if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX); CpuFeatureScope scope(this, AVX);
vxorpd(dst, dst, dst);
vcvtlsi2sd(dst, dst, src); vcvtlsi2sd(dst, dst, src);
} else { } else {
xorpd(dst, dst);
cvtlsi2sd(dst, src); cvtlsi2sd(dst, src);
} }
} }
...@@ -747,10 +745,8 @@ void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Register src) { ...@@ -747,10 +745,8 @@ void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Register src) {
void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Operand src) { void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Operand src) {
if (CpuFeatures::IsSupported(AVX)) { if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX); CpuFeatureScope scope(this, AVX);
vxorpd(dst, dst, dst);
vcvtlsi2sd(dst, dst, src); vcvtlsi2sd(dst, dst, src);
} else { } else {
xorpd(dst, dst);
cvtlsi2sd(dst, src); cvtlsi2sd(dst, src);
} }
} }
...@@ -802,10 +798,8 @@ void TurboAssembler::Cvtqsi2ss(XMMRegister dst, Operand src) { ...@@ -802,10 +798,8 @@ void TurboAssembler::Cvtqsi2ss(XMMRegister dst, Operand src) {
void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Register src) { void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Register src) {
if (CpuFeatures::IsSupported(AVX)) { if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX); CpuFeatureScope scope(this, AVX);
vxorpd(dst, dst, dst);
vcvtqsi2sd(dst, dst, src); vcvtqsi2sd(dst, dst, src);
} else { } else {
xorpd(dst, dst);
cvtqsi2sd(dst, src); cvtqsi2sd(dst, src);
} }
} }
...@@ -813,10 +807,8 @@ void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Register src) { ...@@ -813,10 +807,8 @@ void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Register src) {
void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Operand src) { void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Operand src) {
if (CpuFeatures::IsSupported(AVX)) { if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX); CpuFeatureScope scope(this, AVX);
vxorpd(dst, dst, dst);
vcvtqsi2sd(dst, dst, src); vcvtqsi2sd(dst, dst, src);
} else { } else {
xorpd(dst, dst);
cvtqsi2sd(dst, src); cvtqsi2sd(dst, src);
} }
} }
......
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