Revision: 19280
Author: [email protected]
Date: Tue Feb 11 13:07:32 2014 UTC
Log: Revert 19279 "A64: When truncating to an int, store the result in
a ..."
[email protected]
BUG=none
LOG=n
Review URL: https://codereview.chromium.org/135273017
http://code.google.com/p/v8/source/detail?r=19280
Modified:
/branches/experimental/a64/src/a64/lithium-codegen-a64.cc
/branches/experimental/a64/src/a64/macro-assembler-a64.cc
/branches/experimental/a64/src/a64/macro-assembler-a64.h
/branches/experimental/a64/test/cctest/test-assembler-a64.cc
=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Tue Feb 11
12:58:23 2014 UTC
+++ /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Tue Feb 11
13:07:32 2014 UTC
@@ -5493,7 +5493,7 @@
ToRegister(instr->temp2()),
instr->tag_result()
? MacroAssembler::SMI
- : MacroAssembler::INT32);
+ : MacroAssembler::INT32_IN_W);
}
=======================================
--- /branches/experimental/a64/src/a64/macro-assembler-a64.cc Tue Feb 11
12:58:23 2014 UTC
+++ /branches/experimental/a64/src/a64/macro-assembler-a64.cc Tue Feb 11
13:07:32 2014 UTC
@@ -2544,7 +2544,14 @@
Bind(&tag);
switch (format) {
- case INT32:
+ case INT32_IN_W:
+ // There is nothing to do; the upper 32 bits are undefined.
+ if (emit_debug_code()) {
+ __ Mov(scratch1, 0x55555555);
+ __ Bfi(result, scratch1, 32, 32);
+ }
+ break;
+ case INT32_IN_X:
Sxtw(result, result);
break;
case SMI:
=======================================
--- /branches/experimental/a64/src/a64/macro-assembler-a64.h Tue Feb 11
12:58:23 2014 UTC
+++ /branches/experimental/a64/src/a64/macro-assembler-a64.h Tue Feb 11
13:07:32 2014 UTC
@@ -1094,9 +1094,13 @@
// ---- Floating point helpers ----
enum ECMA262ToInt32Result {
+ // Provide an untagged int32_t which can be read using result.W().
That is,
+ // the upper 32 bits of result are undefined.
+ INT32_IN_W,
+
// Provide an untagged int32_t which can be read using the 64-bit
result
// register. The int32_t result is sign-extended.
- INT32,
+ INT32_IN_X,
// Tag the int32_t result as a smi.
SMI
@@ -1107,7 +1111,7 @@
DoubleRegister input,
Register scratch1,
Register scratch2,
- ECMA262ToInt32Result format = INT32);
+ ECMA262ToInt32Result format = INT32_IN_X);
// As ECMA262ToInt32, but operate on a HeapNumber.
void HeapNumberECMA262ToInt32(Register result,
@@ -1115,7 +1119,7 @@
Register scratch1,
Register scratch2,
DoubleRegister double_scratch,
- ECMA262ToInt32Result format = INT32);
+ ECMA262ToInt32Result format = INT32_IN_X);
// ---- Code generation helpers ----
=======================================
--- /branches/experimental/a64/test/cctest/test-assembler-a64.cc Tue Feb 11
12:58:23 2014 UTC
+++ /branches/experimental/a64/test/cctest/test-assembler-a64.cc Tue Feb 11
13:07:32 2014 UTC
@@ -9352,15 +9352,21 @@
__ Fmov(d0, input);
- __ ECMA262ToInt32(x1, d0, x10, x11, MacroAssembler::INT32);
+ __ ECMA262ToInt32(x0, d0, x10, x11, MacroAssembler::INT32_IN_W);
+ __ ECMA262ToInt32(x1, d0, x10, x11, MacroAssembler::INT32_IN_X);
__ ECMA262ToInt32(x2, d0, x10, x11, MacroAssembler::SMI);
+ // The upper bits of INT32_IN_W are undefined, so make sure we don't try
to
+ // test them.
+ __ Mov(w0, w0);
+
END();
RUN();
int64_t expected64 = expected;
+ ASSERT_EQUAL_32(expected, w0);
ASSERT_EQUAL_64(expected64, x1);
ASSERT_EQUAL_64(expected64 << kSmiShift | kSmiTag, x2);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.