Commit 73fcafd6 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Bring back the fisttp instruction on machines with SSE3, but check the

input so we don't have to check the exception flags afterwards.
Review URL: http://codereview.chromium.org/509001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3504 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e1b13fc3
...@@ -1675,6 +1675,15 @@ void Assembler::fisttp_s(const Operand& adr) { ...@@ -1675,6 +1675,15 @@ void Assembler::fisttp_s(const Operand& adr) {
} }
void Assembler::fisttp_d(const Operand& adr) {
ASSERT(CpuFeatures::IsEnabled(SSE3));
EnsureSpace ensure_space(this);
last_pc_ = pc_;
EMIT(0xDD);
emit_operand(ecx, adr);
}
void Assembler::fist_s(const Operand& adr) { void Assembler::fist_s(const Operand& adr) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
last_pc_ = pc_; last_pc_ = pc_;
......
...@@ -693,6 +693,7 @@ class Assembler : public Malloced { ...@@ -693,6 +693,7 @@ class Assembler : public Malloced {
void fistp_d(const Operand& adr); void fistp_d(const Operand& adr);
void fisttp_s(const Operand& adr); void fisttp_s(const Operand& adr);
void fisttp_d(const Operand& adr);
void fabs(); void fabs();
void fchs(); void fchs();
......
This diff is collapsed.
...@@ -537,7 +537,7 @@ function testShiftNonSmis() { ...@@ -537,7 +537,7 @@ function testShiftNonSmis() {
one = four - three; one = four - three;
zero = one - one; zero = one - one;
// Begin block A repeat 3 // Begin block A repeat 3
assertEquals(pos_non_smi, (pos_non_smi) >> zero); assertEquals(pos_non_smi, (pos_non_smi) >> zero);
assertEquals(pos_non_smi, (pos_non_smi) >>> zero); assertEquals(pos_non_smi, (pos_non_smi) >>> zero);
assertEquals(pos_non_smi, (pos_non_smi) << zero); assertEquals(pos_non_smi, (pos_non_smi) << zero);
...@@ -638,6 +638,31 @@ function testShiftNonSmis() { ...@@ -638,6 +638,31 @@ function testShiftNonSmis() {
testShiftNonSmis(); testShiftNonSmis();
function intConversion() {
function foo(x) {
assertEquals(x, (x * 1.0000000001) | 0, "foo more " + x);
assertEquals(x, x | 0, "foo " + x);
if (x > 0) {
assertEquals(x - 1, (x * 0.9999999999) | 0, "foo less " + x);
} else {
assertEquals(x + 1, (x * 0.9999999999) | 0, "foo less " + x);
}
}
for (var i = 1; i < 0x80000000; i *= 2) {
foo(i);
foo(-i);
}
for (var i = 1; i < 1/0; i *= 2) {
assertEquals(i | 0, (i * 1.0000000000000001) | 0, "b" + i);
assertEquals(-i | 0, (i * -1.0000000000000001) | 0, "c" + i);
}
for (var i = 0.5; i > 0; i /= 2) {
assertEquals(0, i | 0, "d" + i);
assertEquals(0, -i | 0, "e" + i);
}
}
intConversion();
// Verify that we handle the (optimized) corner case of shifting by // Verify that we handle the (optimized) corner case of shifting by
// zero even for non-smis. // zero even for non-smis.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment