Index: src/x64/assembler-x64.h |
diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h |
index 7e309346402446c441d90a86a1c590ddcbb6e1c2..e8953329bffb8fbed0dcee02e39bcb931e4ac2eb 100644 |
--- a/src/x64/assembler-x64.h |
+++ b/src/x64/assembler-x64.h |
@@ -690,11 +690,22 @@ class Assembler : public Malloced { |
shift(dst, shift_amount, 0x7); |
} |
+ // Shifts dst right, duplicating sign bit, by shift_amount bits. |
+ // Shifting by 1 is handled efficiently. |
+ void sarl(Register dst, Immediate shift_amount) { |
+ shift_32(dst, shift_amount, 0x7); |
+ } |
+ |
// Shifts dst right, duplicating sign bit, by cl % 64 bits. |
void sar(Register dst) { |
shift(dst, 0x7); |
} |
+ // Shifts dst right, duplicating sign bit, by cl % 64 bits. |
+ void sarl(Register dst) { |
+ shift_32(dst, 0x7); |
+ } |
+ |
void shl(Register dst, Immediate shift_amount) { |
shift(dst, shift_amount, 0x4); |
} |
@@ -1123,6 +1134,7 @@ class Assembler : public Malloced { |
Immediate src); |
// Emit machine code for a shift operation. |
void shift(Register dst, Immediate shift_amount, int subcode); |
+ void shift_32(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); |