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

Unified Diff: src/ia32/assembler-ia32.h

Issue 1069683002: [ia32] Introduce BMI instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Align with gdb disassembler Created 5 years, 8 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 | « no previous file | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/assembler-ia32.h
diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h
index 69046e189bc0fa08447f36270200bda02fc9120e..bb8098daee4fb41329460cbb074f7896983a0826 100644
--- a/src/ia32/assembler-ia32.h
+++ b/src/ia32/assembler-ia32.h
@@ -1314,6 +1314,90 @@ class Assembler : public AssemblerBase {
}
void vss(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
+ // BMI instruction
+ void andn(Register dst, Register src1, Register src2) {
+ andn(dst, src1, Operand(src2));
+ }
+ void andn(Register dst, Register src1, const Operand& src2) {
+ bmi1(0xf2, dst, src1, src2);
+ }
+ void bextr(Register dst, Register src1, Register src2) {
+ bextr(dst, Operand(src1), src2);
+ }
+ void bextr(Register dst, const Operand& src1, Register src2) {
+ bmi1(0xf7, dst, src2, src1);
+ }
+ void blsi(Register dst, Register src) { blsi(dst, Operand(src)); }
+ void blsi(Register dst, const Operand& src) {
+ Register ireg = {3};
+ bmi1(0xf3, ireg, dst, src);
+ }
+ void blsmsk(Register dst, Register src) { blsmsk(dst, Operand(src)); }
+ void blsmsk(Register dst, const Operand& src) {
+ Register ireg = {2};
+ bmi1(0xf3, ireg, dst, src);
+ }
+ void blsr(Register dst, Register src) { blsr(dst, Operand(src)); }
+ void blsr(Register dst, const Operand& src) {
+ Register ireg = {1};
+ bmi1(0xf3, ireg, dst, src);
+ }
+ void tzcnt(Register dst, Register src) { tzcnt(dst, Operand(src)); }
+ void tzcnt(Register dst, const Operand& src);
+
+ void lzcnt(Register dst, Register src) { lzcnt(dst, Operand(src)); }
+ void lzcnt(Register dst, const Operand& src);
+
+ void popcnt(Register dst, Register src) { popcnt(dst, Operand(src)); }
+ void popcnt(Register dst, const Operand& src);
+
+ void bzhi(Register dst, Register src1, Register src2) {
+ bzhi(dst, Operand(src1), src2);
+ }
+ void bzhi(Register dst, const Operand& src1, Register src2) {
+ bmi2(kNone, 0xf5, dst, src2, src1);
+ }
+ void mulx(Register dst1, Register dst2, Register src) {
+ mulx(dst1, dst2, Operand(src));
+ }
+ void mulx(Register dst1, Register dst2, const Operand& src) {
+ bmi2(kF2, 0xf6, dst1, dst2, src);
+ }
+ void pdep(Register dst, Register src1, Register src2) {
+ pdep(dst, src1, Operand(src2));
+ }
+ void pdep(Register dst, Register src1, const Operand& src2) {
+ bmi2(kF2, 0xf5, dst, src1, src2);
+ }
+ void pext(Register dst, Register src1, Register src2) {
+ pext(dst, src1, Operand(src2));
+ }
+ void pext(Register dst, Register src1, const Operand& src2) {
+ bmi2(kF3, 0xf5, dst, src1, src2);
+ }
+ void sarx(Register dst, Register src1, Register src2) {
+ sarx(dst, Operand(src1), src2);
+ }
+ void sarx(Register dst, const Operand& src1, Register src2) {
+ bmi2(kF3, 0xf7, dst, src2, src1);
+ }
+ void shlx(Register dst, Register src1, Register src2) {
+ shlx(dst, Operand(src1), src2);
+ }
+ void shlx(Register dst, const Operand& src1, Register src2) {
+ bmi2(k66, 0xf7, dst, src2, src1);
+ }
+ void shrx(Register dst, Register src1, Register src2) {
+ shrx(dst, Operand(src1), src2);
+ }
+ void shrx(Register dst, const Operand& src1, Register src2) {
+ bmi2(kF2, 0xf7, dst, src2, src1);
+ }
+ void rorx(Register dst, Register src, byte imm8) {
+ rorx(dst, Operand(src), imm8);
+ }
+ void rorx(Register dst, const Operand& src, byte imm8);
+
// Prefetch src position into cache level.
// Level 1, 2 or 3 specifies CPU cache level. Level 0 specifies a
// non-temporal
@@ -1425,11 +1509,13 @@ class Assembler : public AssemblerBase {
// Emit vex prefix
enum SIMDPrefix { kNone = 0x0, k66 = 0x1, kF3 = 0x2, kF2 = 0x3 };
- enum VectorLength { kL128 = 0x0, kL256 = 0x4, kLIG = kL128 };
+ enum VectorLength { kL128 = 0x0, kL256 = 0x4, kLIG = kL128, kLZ = kL128 };
enum VexW { kW0 = 0x0, kW1 = 0x80, kWIG = kW0 };
- enum LeadingOpcode { k0F = 0x1, k0F38 = 0x2, k0F3A = 0x2 };
+ enum LeadingOpcode { k0F = 0x1, k0F38 = 0x2, k0F3A = 0x3 };
inline void emit_vex_prefix(XMMRegister v, VectorLength l, SIMDPrefix pp,
LeadingOpcode m, VexW w);
+ inline void emit_vex_prefix(Register v, VectorLength l, SIMDPrefix pp,
+ LeadingOpcode m, VexW w);
// labels
void print(Label* L);
@@ -1441,6 +1527,11 @@ class Assembler : public AssemblerBase {
inline void emit_disp(Label* L, Displacement::Type type);
inline void emit_near_disp(Label* L);
+ // Most BMI instructions are similiar.
+ void bmi1(byte op, Register reg, Register vreg, const Operand& rm);
+ void bmi2(SIMDPrefix pp, byte op, Register reg, Register vreg,
+ const Operand& rm);
+
// record reloc info for current pc_
void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
« no previous file with comments | « no previous file | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698