Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2308)

Unified Diff: src/x64/macro-assembler-x64.h

Issue 1416053010: [x64] Replace addsd, subsd, mulsd, divsd with AVX versions under AVX. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.h
diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h
index 9a45049221b2e4afb0d902c6e033680caa20fd76..37816ddeca26ed5d7f406c5324078471dfa0f5a2 100644
--- a/src/x64/macro-assembler-x64.h
+++ b/src/x64/macro-assembler-x64.h
@@ -904,6 +904,39 @@ class MacroAssembler: public Assembler {
void Move(XMMRegister dst, float src) { Move(dst, bit_cast<uint32_t>(src)); }
void Move(XMMRegister dst, double src) { Move(dst, bit_cast<uint64_t>(src)); }
+#define AVX_OP2_WITH_TYPE(macro_name, name, src_type) \
+ void macro_name(XMMRegister dst, src_type src) { \
+ if (CpuFeatures::IsSupported(AVX)) { \
+ CpuFeatureScope scope(this, AVX); \
+ v##name(dst, dst, src); \
+ } else { \
+ name(dst, src); \
+ } \
+ }
+#define AVX_OP2_X(macro_name, name) \
+ AVX_OP2_WITH_TYPE(macro_name, name, XMMRegister)
+#define AVX_OP2_O(macro_name, name) \
+ AVX_OP2_WITH_TYPE(macro_name, name, const Operand&)
+#define AVX_OP2_XO(macro_name, name) \
+ AVX_OP2_X(macro_name, name) \
+ AVX_OP2_O(macro_name, name)
+
+ AVX_OP2_XO(Addsd, addsd)
+ AVX_OP2_XO(Subsd, subsd)
+ AVX_OP2_XO(Mulsd, mulsd)
+ AVX_OP2_XO(Divsd, divsd)
+ AVX_OP2_X(Andpd, andpd)
+ AVX_OP2_X(Orpd, orpd)
+ AVX_OP2_X(Xorpd, xorpd)
+ AVX_OP2_X(Pcmpeqd, pcmpeqd)
+ AVX_OP2_WITH_TYPE(Psllq, psllq, byte)
+ AVX_OP2_WITH_TYPE(Psrlq, psrlq, byte)
+
+#undef AVX_OP2_O
+#undef AVX_OP2_X
+#undef AVX_OP2_XO
+#undef AVX_OP2_WITH_TYPE
+
void Movsd(XMMRegister dst, XMMRegister src);
void Movsd(XMMRegister dst, const Operand& src);
void Movsd(const Operand& dst, XMMRegister src);
@@ -930,13 +963,6 @@ class MacroAssembler: public Assembler {
void Ucomisd(XMMRegister src1, XMMRegister src2);
void Ucomisd(XMMRegister src1, const Operand& src2);
- void Andpd(XMMRegister dst, XMMRegister src);
- void Orpd(XMMRegister dst, XMMRegister src);
- void Xorpd(XMMRegister dst, XMMRegister src);
- void Pcmpeqd(XMMRegister dst, XMMRegister src);
- void Psllq(XMMRegister dst, byte imm8);
- void Psrlq(XMMRegister dst, byte imm8);
-
// Control Flow
void Jump(Address destination, RelocInfo::Mode rmode);
void Jump(ExternalReference ext);
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698