Index: src/x64/assembler-x64.h |
diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h |
index 650c218f1112a01f66814055568b232423c193bf..6b08ef478c48d00bd9bf9e03da4efe648e29b246 100644 |
--- a/src/x64/assembler-x64.h |
+++ b/src/x64/assembler-x64.h |
@@ -115,6 +115,35 @@ extern Register r14; |
extern Register r15; |
extern Register no_reg; |
+ |
+struct MMXRegister { |
+ bool is_valid() const { return 0 <= code_ && code_ < 2; } |
+ int code() const { |
+ ASSERT(is_valid()); |
+ return code_; |
+ } |
+ |
+ int code_; |
+}; |
+ |
+extern MMXRegister mm0; |
+extern MMXRegister mm1; |
+extern MMXRegister mm2; |
+extern MMXRegister mm3; |
+extern MMXRegister mm4; |
+extern MMXRegister mm5; |
+extern MMXRegister mm6; |
+extern MMXRegister mm7; |
+extern MMXRegister mm8; |
+extern MMXRegister mm9; |
+extern MMXRegister mm10; |
+extern MMXRegister mm11; |
+extern MMXRegister mm12; |
+extern MMXRegister mm13; |
+extern MMXRegister mm14; |
+extern MMXRegister mm15; |
+ |
+ |
struct XMMRegister { |
bool is_valid() const { return 0 <= code_ && code_ < 2; } |
int code() const { |
@@ -446,6 +475,9 @@ class Assembler : public Malloced { |
void movq(Register dst, ExternalReference ext); |
void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode); |
+ void movsxlq(Register dst, Register src); |
+ void movzxbq(Register dst, const Operand& src); |
+ |
// New x64 instruction to load from an immediate 64-bit pointer into RAX. |
void load_rax(void* ptr, RelocInfo::Mode rmode); |
void load_rax(ExternalReference ext); |
@@ -461,6 +493,10 @@ class Assembler : public Malloced { |
arithmetic_op(0x03, dst, src); |
} |
+ void addl(Register dst, Register src) { |
+ arithmetic_op_32(0x03, dst, src); |
+ } |
+ |
void addq(Register dst, const Operand& src) { |
arithmetic_op(0x03, dst, src); |
} |
@@ -502,6 +538,10 @@ class Assembler : public Malloced { |
immediate_arithmetic_op(0x7, dst, src); |
} |
+ void cmpl(Register dst, Immediate src) { |
+ immediate_arithmetic_op_32(0x7, dst, src); |
+ } |
+ |
void cmpq(const Operand& dst, Immediate src) { |
immediate_arithmetic_op(0x7, dst, src); |
} |
@@ -540,6 +580,8 @@ class Assembler : public Malloced { |
void imul(Register dst, const Operand& src); |
// Performs the operation dst = src * imm. |
void imul(Register dst, Register src, Immediate imm); |
+ // Multiply 32 bit registers |
+ void imull(Register dst, Register src); |
void incq(Register dst); |
void incq(const Operand& dst); |
@@ -604,6 +646,10 @@ class Assembler : public Malloced { |
shift(dst, 0x4); |
} |
+ void shll(Register dst) { |
+ shift_32(dst, 0x4); |
+ } |
+ |
void shr(Register dst, Immediate shift_amount) { |
shift(dst, shift_amount, 0x5); |
} |
@@ -612,6 +658,10 @@ class Assembler : public Malloced { |
shift(dst, 0x5); |
} |
+ void shrl(Register dst) { |
+ shift_32(dst, 0x5); |
+ } |
+ |
void store_rax(void* dst, RelocInfo::Mode mode); |
void store_rax(ExternalReference ref); |
@@ -635,6 +685,10 @@ class Assembler : public Malloced { |
immediate_arithmetic_op(0x5, dst, src); |
} |
+ void subl(Register dst, Register src) { |
+ arithmetic_op_32(0x2B, dst, src); |
+ } |
+ |
void subl(const Operand& dst, Immediate src) { |
immediate_arithmetic_op_32(0x5, dst, src); |
} |
@@ -770,9 +824,12 @@ class Assembler : public Malloced { |
void fwait(); |
void fnclex(); |
+ void fsin(); |
+ void fcos(); |
+ |
void frndint(); |
- // SSE2 instructions |
+ // SSE2 instructions |
void cvttss2si(Register dst, const Operand& src); |
void cvttsd2si(Register dst, const Operand& src); |
@@ -959,13 +1016,17 @@ class Assembler : public Malloced { |
// similar, differing just in the opcode or in the reg field of the |
// ModR/M byte. |
void arithmetic_op(byte opcode, Register dst, Register src); |
+ void arithmetic_op_32(byte opcode, Register dst, Register src); |
void arithmetic_op(byte opcode, Register reg, const Operand& op); |
void immediate_arithmetic_op(byte subcode, Register dst, Immediate src); |
void immediate_arithmetic_op(byte subcode, const Operand& dst, Immediate src); |
- // Operate on a 32-bit word in memory. |
+ // Operate on a 32-bit word in memory or register. |
void immediate_arithmetic_op_32(byte subcode, |
const Operand& dst, |
Immediate src); |
+ void immediate_arithmetic_op_32(byte subcode, |
+ Register dst, |
+ Immediate src); |
// Operate on a byte in memory. |
void immediate_arithmetic_op_8(byte subcode, |
const Operand& dst, |
@@ -974,8 +1035,9 @@ class Assembler : public Malloced { |
void shift(Register dst, Immediate shift_amount, int subcode); |
// Shift dst by cl % 64 bits. |
void shift(Register dst, int subcode); |
+ void shift_32(Register dst, int subcode); |
- // void emit_farith(int b1, int b2, int i); |
+ void emit_farith(int b1, int b2, int i); |
// labels |
// void print(Label* L); |