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

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

Issue 1419983002: [x64] Implement vpcmpeqd, vpslld, vpsrld AVX instructions. (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/macro-assembler-x64.h ('k') | test/cctest/test-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.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index 4a6ed90c8be070f1783177729f0a4c721ebb43ac..e26bc68623961932321eae9175508ae6ba15d139 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -2490,7 +2490,7 @@ void MacroAssembler::Move(XMMRegister dst, uint32_t src) {
unsigned pop = base::bits::CountPopulation32(src);
DCHECK_NE(0u, pop);
if (pop == 32) {
- pcmpeqd(dst, dst);
+ Pcmpeqd(dst, dst);
} else {
movl(kScratchRegister, Immediate(src));
Movq(dst, kScratchRegister);
@@ -2508,13 +2508,13 @@ void MacroAssembler::Move(XMMRegister dst, uint64_t src) {
unsigned pop = base::bits::CountPopulation64(src);
DCHECK_NE(0u, pop);
if (pop == 64) {
- pcmpeqd(dst, dst);
+ Pcmpeqd(dst, dst);
} else if (pop + ntz == 64) {
- pcmpeqd(dst, dst);
- psllq(dst, ntz);
+ Pcmpeqd(dst, dst);
+ Psllq(dst, ntz);
} else if (pop + nlz == 64) {
- pcmpeqd(dst, dst);
- psrlq(dst, nlz);
+ Pcmpeqd(dst, dst);
+ Psrlq(dst, nlz);
} else {
uint32_t lower = static_cast<uint32_t>(src);
uint32_t upper = static_cast<uint32_t>(src >> 32);
@@ -2719,6 +2719,36 @@ void MacroAssembler::Xorpd(XMMRegister dst, XMMRegister src) {
}
+void MacroAssembler::Pcmpeqd(XMMRegister dst, XMMRegister src) {
+ if (CpuFeatures::IsSupported(AVX)) {
+ CpuFeatureScope scope(this, AVX);
+ vpcmpeqd(dst, dst, src);
+ } else {
+ pcmpeqd(dst, src);
+ }
+}
+
+
+void MacroAssembler::Psllq(XMMRegister dst, byte imm8) {
+ if (CpuFeatures::IsSupported(AVX)) {
+ CpuFeatureScope scope(this, AVX);
+ vpsllq(dst, dst, imm8);
+ } else {
+ psllq(dst, imm8);
+ }
+}
+
+
+void MacroAssembler::Psrlq(XMMRegister dst, byte imm8) {
+ if (CpuFeatures::IsSupported(AVX)) {
+ CpuFeatureScope scope(this, AVX);
+ vpsrlq(dst, dst, imm8);
+ } else {
+ psrlq(dst, imm8);
+ }
+}
+
+
void MacroAssembler::Cmp(Register dst, Handle<Object> source) {
AllowDeferredHandleDereference smi_check;
if (source->IsSmi()) {
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/test-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698