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

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

Issue 764863002: [x64] introduce vex prefix version of float64 arithmetic binop (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 6 years, 1 month 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/assembler-x64.cc ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/assembler-x64-inl.h
diff --git a/src/x64/assembler-x64-inl.h b/src/x64/assembler-x64-inl.h
index c3d2cdf2eba0cf8b8a51428497d916f99bb3d4bf..caf7af6ec94368b5140b485fc7caa06469ad2c2c 100644
--- a/src/x64/assembler-x64-inl.h
+++ b/src/x64/assembler-x64-inl.h
@@ -189,6 +189,65 @@ void Assembler::emit_optional_rex_32(const Operand& op) {
}
+// byte 1 of 3-byte VEX
+void Assembler::emit_vex3_byte1(XMMRegister reg, XMMRegister rm,
+ LeadingOpcode m) {
+ byte rxb = ~((reg.high_bit() << 2) | rm.high_bit()) << 5;
+ emit(rxb | m);
+}
+
+
+// byte 1 of 3-byte VEX
+void Assembler::emit_vex3_byte1(XMMRegister reg, const Operand& rm,
+ LeadingOpcode m) {
+ byte rxb = ~((reg.high_bit() << 2) | rm.rex_) << 5;
+ emit(rxb | m);
+}
+
+
+// byte 1 of 2-byte VEX
+void Assembler::emit_vex2_byte1(XMMRegister reg, XMMRegister v, VectorLength l,
+ SIMDPrefix pp) {
+ byte rv = ~((reg.high_bit() << 4) | v.code()) << 3;
+ emit(rv | l | pp);
+}
+
+
+// byte 2 of 3-byte VEX
+void Assembler::emit_vex3_byte2(VexW w, XMMRegister v, VectorLength l,
+ SIMDPrefix pp) {
+ emit(w | ((~v.code() & 0xf) << 3) | l | pp);
+}
+
+
+void Assembler::emit_vex_prefix(XMMRegister reg, XMMRegister vreg,
+ XMMRegister rm, VectorLength l, SIMDPrefix pp,
+ LeadingOpcode mm, VexW w) {
+ if (rm.high_bit() || mm != k0F || w != kW0) {
+ emit_vex3_byte0();
+ emit_vex3_byte1(reg, rm, mm);
+ emit_vex3_byte2(w, vreg, l, pp);
+ } else {
+ emit_vex2_byte0();
+ emit_vex2_byte1(reg, vreg, l, pp);
+ }
+}
+
+
+void Assembler::emit_vex_prefix(XMMRegister reg, XMMRegister vreg,
+ const Operand& rm, VectorLength l,
+ SIMDPrefix pp, LeadingOpcode mm, VexW w) {
+ if (rm.rex_ || mm != k0F || w != kW0) {
+ emit_vex3_byte0();
+ emit_vex3_byte1(reg, rm, mm);
+ emit_vex3_byte2(w, vreg, l, pp);
+ } else {
+ emit_vex2_byte0();
+ emit_vex2_byte1(reg, vreg, l, pp);
+ }
+}
+
+
Address Assembler::target_address_at(Address pc,
ConstantPoolArray* constant_pool) {
return Memory::int32_at(pc) + pc + 4;
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698