From c4cf2ea4fd33a7897f8e521d3e7a843c25cecc74 Mon Sep 17 00:00:00 2001 From: Clemens Backes Date: Wed, 20 Nov 2019 15:40:12 +0100 Subject: [PATCH] [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/+/1926427 Reviewed-by: Yang Guo Reviewed-by: Andreas Haas Commit-Queue: Clemens Backes Cr-Commit-Position: refs/heads/master@{#65077} --- src/codegen/ia32/macro-assembler-ia32.cc | 2 -- src/codegen/x64/macro-assembler-x64.cc | 8 -------- 2 files changed, 10 deletions(-) diff --git a/src/codegen/ia32/macro-assembler-ia32.cc b/src/codegen/ia32/macro-assembler-ia32.cc index dfb71aeb69..c923589ab2 100644 --- a/src/codegen/ia32/macro-assembler-ia32.cc +++ b/src/codegen/ia32/macro-assembler-ia32.cc @@ -511,12 +511,10 @@ void MacroAssembler::MaybeDropFrames() { } void TurboAssembler::Cvtsi2ss(XMMRegister dst, Operand src) { - xorps(dst, dst); cvtsi2ss(dst, src); } void TurboAssembler::Cvtsi2sd(XMMRegister dst, Operand src) { - xorpd(dst, dst); cvtsi2sd(dst, src); } diff --git a/src/codegen/x64/macro-assembler-x64.cc b/src/codegen/x64/macro-assembler-x64.cc index dc34b284cb..2c7ea016ea 100644 --- a/src/codegen/x64/macro-assembler-x64.cc +++ b/src/codegen/x64/macro-assembler-x64.cc @@ -736,10 +736,8 @@ void TurboAssembler::Cvtsd2ss(XMMRegister dst, Operand src) { void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Register src) { if (CpuFeatures::IsSupported(AVX)) { CpuFeatureScope scope(this, AVX); - vxorpd(dst, dst, dst); vcvtlsi2sd(dst, dst, src); } else { - xorpd(dst, dst); cvtlsi2sd(dst, src); } } @@ -747,10 +745,8 @@ void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Register src) { void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Operand src) { if (CpuFeatures::IsSupported(AVX)) { CpuFeatureScope scope(this, AVX); - vxorpd(dst, dst, dst); vcvtlsi2sd(dst, dst, src); } else { - xorpd(dst, dst); cvtlsi2sd(dst, src); } } @@ -802,10 +798,8 @@ void TurboAssembler::Cvtqsi2ss(XMMRegister dst, Operand src) { void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Register src) { if (CpuFeatures::IsSupported(AVX)) { CpuFeatureScope scope(this, AVX); - vxorpd(dst, dst, dst); vcvtqsi2sd(dst, dst, src); } else { - xorpd(dst, dst); cvtqsi2sd(dst, src); } } @@ -813,10 +807,8 @@ void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Register src) { void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Operand src) { if (CpuFeatures::IsSupported(AVX)) { CpuFeatureScope scope(this, AVX); - vxorpd(dst, dst, dst); vcvtqsi2sd(dst, dst, src); } else { - xorpd(dst, dst); cvtqsi2sd(dst, src); } }