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

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

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: [Atomics] Make Atomics.exchange a builtin using TF Created 3 years, 11 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
Index: src/x64/assembler-x64.cc
diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc
index 8f8ed7b93f5d0444d42ce3e3646ea40c78e5f4a1..9625401b6fe343e73c048b0422b13e0c07555514 100644
--- a/src/x64/assembler-x64.cc
+++ b/src/x64/assembler-x64.cc
@@ -1979,7 +1979,7 @@ void Assembler::shrd(Register dst, Register src) {
emit_modrm(src, dst);
}
-void Assembler::xchgb(Register reg, const Operand& op) {
+void Assembler::xchgb(Register reg, const Operand& op, bool is_signed) {
EnsureSpace ensure_space(this);
if (!reg.is_byte_register()) {
// Register is not one of al, bl, cl, dl. Its encoding needs REX.
@@ -1989,14 +1989,24 @@ void Assembler::xchgb(Register reg, const Operand& op) {
}
emit(0x86);
emit_operand(reg, op);
+ if (is_signed) {
binji 2017/01/17 21:45:50 This is the wrong place to put this code; the asse
aseemgarg 2017/01/21 08:40:37 Removed. Moved the move part upstream in code-gene
+ movsxbl(reg, reg);
+ } else {
+ movzxbl(reg, reg);
+ }
}
-void Assembler::xchgw(Register reg, const Operand& op) {
+void Assembler::xchgw(Register reg, const Operand& op, bool is_signed) {
EnsureSpace ensure_space(this);
emit(0x66);
emit_optional_rex_32(reg, op);
emit(0x87);
emit_operand(reg, op);
+ if (is_signed) {
+ movsxwl(reg, reg);
+ } else {
+ movzxwl(reg, reg);
+ }
}
void Assembler::emit_xchg(Register dst, Register src, int size) {

Powered by Google App Engine
This is Rietveld 408576698