Index: runtime/vm/assembler_ia32_test.cc |
diff --git a/runtime/vm/assembler_ia32_test.cc b/runtime/vm/assembler_ia32_test.cc |
index 4ea1c65053e9250eb147a147efaed2f26ad1bb8d..85c5e995d99fc71d43179337fd3544eb9e861ad7 100644 |
--- a/runtime/vm/assembler_ia32_test.cc |
+++ b/runtime/vm/assembler_ia32_test.cc |
@@ -15,32 +15,27 @@ namespace dart { |
#define __ assembler-> |
- |
ASSEMBLER_TEST_GENERATE(Simple, assembler) { |
__ movl(EAX, Immediate(42)); |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Simple, test) { |
typedef int (*SimpleCode)(); |
EXPECT_EQ(42, reinterpret_cast<SimpleCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(ReadArgument, assembler) { |
__ movl(EAX, Address(ESP, kWordSize)); |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(ReadArgument, test) { |
typedef int (*ReadArgumentCode)(int n); |
EXPECT_EQ(42, reinterpret_cast<ReadArgumentCode>(test->entry())(42)); |
EXPECT_EQ(87, reinterpret_cast<ReadArgumentCode>(test->entry())(87)); |
} |
- |
ASSEMBLER_TEST_GENERATE(AddressingModes, assembler) { |
__ movl(EAX, Address(ESP, 0)); |
__ movl(EAX, Address(EBP, 0)); |
@@ -98,12 +93,10 @@ ASSEMBLER_TEST_GENERATE(AddressingModes, assembler) { |
__ movl(EAX, Address(ESP, EAX, TIMES_2, 256 * kWordSize)); |
} |
- |
ASSEMBLER_TEST_RUN(AddressingModes, test) { |
// Avoid running the code since it is constructed to lead to crashes. |
} |
- |
ASSEMBLER_TEST_GENERATE(JumpAroundCrash, assembler) { |
Label done; |
// Make sure all the condition jumps work. |
@@ -123,7 +116,6 @@ ASSEMBLER_TEST_GENERATE(JumpAroundCrash, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(JumpAroundCrash, test) { |
Instr* instr = Instr::At(test->entry()); |
EXPECT(!instr->IsBreakPoint()); |
@@ -131,7 +123,6 @@ ASSEMBLER_TEST_RUN(JumpAroundCrash, test) { |
reinterpret_cast<JumpAroundCrashCode>(test->entry())(); |
} |
- |
ASSEMBLER_TEST_GENERATE(NearJumpAroundCrash, assembler) { |
Label done; |
// Make sure all the condition jumps work. |
@@ -151,13 +142,11 @@ ASSEMBLER_TEST_GENERATE(NearJumpAroundCrash, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(NearJumpAroundCrash, test) { |
typedef void (*NearJumpAroundCrashCode)(); |
reinterpret_cast<NearJumpAroundCrashCode>(test->entry())(); |
} |
- |
ASSEMBLER_TEST_GENERATE(SimpleLoop, assembler) { |
__ movl(EAX, Immediate(0)); |
__ movl(ECX, Immediate(0)); |
@@ -170,13 +159,11 @@ ASSEMBLER_TEST_GENERATE(SimpleLoop, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SimpleLoop, test) { |
typedef int (*SimpleLoopCode)(); |
EXPECT_EQ(2 * 87, reinterpret_cast<SimpleLoopCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(Cmpb, assembler) { |
Label done; |
__ movl(EAX, Immediate(1)); |
@@ -189,13 +176,11 @@ ASSEMBLER_TEST_GENERATE(Cmpb, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Cmpb, test) { |
typedef int (*CmpbCode)(); |
EXPECT_EQ(1, reinterpret_cast<CmpbCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(Testb, assembler) { |
__ movl(EAX, Immediate(1)); |
__ movl(ECX, Immediate(0)); |
@@ -210,13 +195,11 @@ ASSEMBLER_TEST_GENERATE(Testb, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Testb, test) { |
typedef int (*TestbCode)(); |
EXPECT_EQ(1, reinterpret_cast<TestbCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(Increment, assembler) { |
__ movl(EAX, Immediate(0)); |
__ pushl(EAX); |
@@ -228,13 +211,11 @@ ASSEMBLER_TEST_GENERATE(Increment, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Increment, test) { |
typedef int (*IncrementCode)(); |
EXPECT_EQ(2, reinterpret_cast<IncrementCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(Decrement, assembler) { |
__ movl(EAX, Immediate(2)); |
__ pushl(EAX); |
@@ -246,13 +227,11 @@ ASSEMBLER_TEST_GENERATE(Decrement, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Decrement, test) { |
typedef int (*DecrementCode)(); |
EXPECT_EQ(0, reinterpret_cast<DecrementCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(AddressBinOp, assembler) { |
__ movl(EAX, Address(ESP, kWordSize)); |
__ addl(EAX, Address(ESP, kWordSize)); |
@@ -262,14 +241,12 @@ ASSEMBLER_TEST_GENERATE(AddressBinOp, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(AddressBinOp, test) { |
typedef int (*AddressBinOpCode)(int a); |
EXPECT_EQ((2 + 2 + 1 - 2) * 2, |
reinterpret_cast<AddressBinOpCode>(test->entry())(2)); |
} |
- |
ASSEMBLER_TEST_GENERATE(SignedMultiply, assembler) { |
__ movl(EAX, Immediate(2)); |
__ movl(ECX, Immediate(4)); |
@@ -278,13 +255,11 @@ ASSEMBLER_TEST_GENERATE(SignedMultiply, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SignedMultiply, test) { |
typedef int (*SignedMultiply)(); |
EXPECT_EQ(8000, reinterpret_cast<SignedMultiply>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(OverflowSignedMultiply, assembler) { |
__ movl(EDX, Immediate(0)); |
__ movl(EAX, Immediate(0x0fffffff)); |
@@ -294,13 +269,11 @@ ASSEMBLER_TEST_GENERATE(OverflowSignedMultiply, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(OverflowSignedMultiply, test) { |
typedef int (*OverflowSignedMultiply)(); |
EXPECT_EQ(0, reinterpret_cast<OverflowSignedMultiply>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(SignedMultiply1, assembler) { |
__ pushl(EBX); // preserve EBX. |
__ movl(EBX, Immediate(2)); |
@@ -312,13 +285,11 @@ ASSEMBLER_TEST_GENERATE(SignedMultiply1, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SignedMultiply1, test) { |
typedef int (*SignedMultiply1)(); |
EXPECT_EQ(8000, reinterpret_cast<SignedMultiply1>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(Negate, assembler) { |
__ movl(ECX, Immediate(42)); |
__ negl(ECX); |
@@ -326,13 +297,11 @@ ASSEMBLER_TEST_GENERATE(Negate, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Negate, test) { |
typedef int (*Negate)(); |
EXPECT_EQ(-42, reinterpret_cast<Negate>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(BitScanReverse, assembler) { |
__ movl(ECX, Address(ESP, kWordSize)); |
__ movl(EAX, Immediate(666)); // Marker for conditional write. |
@@ -340,7 +309,6 @@ ASSEMBLER_TEST_GENERATE(BitScanReverse, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(BitScanReverse, test) { |
typedef int (*Bsr)(int input); |
Bsr call = reinterpret_cast<Bsr>(test->entry()); |
@@ -353,7 +321,6 @@ ASSEMBLER_TEST_RUN(BitScanReverse, test) { |
EXPECT_EQ(31, call(-1)); |
} |
- |
ASSEMBLER_TEST_GENERATE(MoveExtend, assembler) { |
__ pushl(EBX); // preserve EBX. |
__ movl(EDX, Immediate(0x1234ffff)); |
@@ -366,13 +333,11 @@ ASSEMBLER_TEST_GENERATE(MoveExtend, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(MoveExtend, test) { |
typedef int (*MoveExtend)(); |
EXPECT_EQ(0xff - 1 + 0xffff, reinterpret_cast<MoveExtend>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(MoveExtendMemory, assembler) { |
__ pushl(EBX); // preserve EBX. |
__ movl(EDX, Immediate(0x1234ffff)); |
@@ -389,14 +354,12 @@ ASSEMBLER_TEST_GENERATE(MoveExtendMemory, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(MoveExtendMemory, test) { |
typedef int (*MoveExtendMemory)(); |
EXPECT_EQ(0xff - 1 + 0xffff, |
reinterpret_cast<MoveExtendMemory>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(Bitwise, assembler) { |
__ movl(ECX, Immediate(42)); |
__ xorl(ECX, ECX); |
@@ -424,7 +387,6 @@ ASSEMBLER_TEST_GENERATE(Bitwise, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Bitwise, test) { |
typedef int (*Bitwise)(int* value); |
int value = 0xA; |
@@ -433,7 +395,6 @@ ASSEMBLER_TEST_RUN(Bitwise, test) { |
EXPECT_EQ(0xBA, value); |
} |
- |
ASSEMBLER_TEST_GENERATE(LogicalOps, assembler) { |
Label donetest1; |
__ movl(EAX, Immediate(4)); |
@@ -622,13 +583,11 @@ ASSEMBLER_TEST_GENERATE(LogicalOps, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LogicalOps, test) { |
typedef int (*LogicalOpsCode)(); |
EXPECT_EQ(0, reinterpret_cast<LogicalOpsCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(LogicalTest, assembler) { |
__ pushl(EBX); // save EBX. |
Label donetest1; |
@@ -683,13 +642,11 @@ ASSEMBLER_TEST_GENERATE(LogicalTest, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LogicalTest, test) { |
typedef int (*LogicalTestCode)(); |
EXPECT_EQ(0, reinterpret_cast<LogicalTestCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(CompareSwapEQ, assembler) { |
__ movl(EAX, Immediate(0)); |
__ pushl(EAX); |
@@ -701,13 +658,11 @@ ASSEMBLER_TEST_GENERATE(CompareSwapEQ, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(CompareSwapEQ, test) { |
typedef int (*CompareSwapEQCode)(); |
EXPECT_EQ(0, reinterpret_cast<CompareSwapEQCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(CompareSwapNEQ, assembler) { |
__ movl(EAX, Immediate(0)); |
__ pushl(EAX); |
@@ -719,13 +674,11 @@ ASSEMBLER_TEST_GENERATE(CompareSwapNEQ, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(CompareSwapNEQ, test) { |
typedef int (*CompareSwapNEQCode)(); |
EXPECT_EQ(4, reinterpret_cast<CompareSwapNEQCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(SignedDivide, assembler) { |
__ movl(EAX, Immediate(-87)); |
__ movl(EDX, Immediate(123)); |
@@ -735,13 +688,11 @@ ASSEMBLER_TEST_GENERATE(SignedDivide, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SignedDivide, test) { |
typedef int (*SignedDivide)(); |
EXPECT_EQ(-87 / 42, reinterpret_cast<SignedDivide>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(UnsignedDivide, assembler) { |
__ movl(EAX, Immediate(0xffffffbe)); |
__ movl(EDX, Immediate(0x41)); |
@@ -750,13 +701,11 @@ ASSEMBLER_TEST_GENERATE(UnsignedDivide, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(UnsignedDivide, test) { |
typedef int (*UnsignedDivide)(); |
EXPECT_EQ(0x42, reinterpret_cast<UnsignedDivide>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(Exchange, assembler) { |
__ movl(EAX, Immediate(123456789)); |
__ movl(EDX, Immediate(987654321)); |
@@ -765,13 +714,11 @@ ASSEMBLER_TEST_GENERATE(Exchange, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Exchange, test) { |
typedef int (*Exchange)(); |
EXPECT_EQ(987654321 - 123456789, reinterpret_cast<Exchange>(test->entry())()); |
} |
- |
static int ComputeStackSpaceReservation(int needed, int fixed) { |
return (OS::ActivationFrameAlignment() > 1) |
? Utils::RoundUp(needed + fixed, OS::ActivationFrameAlignment()) - |
@@ -779,17 +726,14 @@ static int ComputeStackSpaceReservation(int needed, int fixed) { |
: needed; |
} |
- |
static int LeafReturn42() { |
return 42; |
} |
- |
static int LeafReturnArgument(int x) { |
return x + 87; |
} |
- |
ASSEMBLER_TEST_GENERATE(CallSimpleLeaf, assembler) { |
ExternalLabel call1(reinterpret_cast<uword>(LeafReturn42)); |
ExternalLabel call2(reinterpret_cast<uword>(LeafReturnArgument)); |
@@ -805,13 +749,11 @@ ASSEMBLER_TEST_GENERATE(CallSimpleLeaf, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(CallSimpleLeaf, test) { |
typedef int (*CallSimpleLeafCode)(); |
EXPECT_EQ(42 + 87, reinterpret_cast<CallSimpleLeafCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(JumpSimpleLeaf, assembler) { |
ExternalLabel call1(reinterpret_cast<uword>(LeafReturn42)); |
Label L; |
@@ -824,13 +766,11 @@ ASSEMBLER_TEST_GENERATE(JumpSimpleLeaf, assembler) { |
__ jmp(&call1); |
} |
- |
ASSEMBLER_TEST_RUN(JumpSimpleLeaf, test) { |
typedef int (*JumpSimpleLeafCode)(); |
EXPECT_EQ(42, reinterpret_cast<JumpSimpleLeafCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(JumpConditionalSimpleLeaf, assembler) { |
ExternalLabel call1(reinterpret_cast<uword>(LeafReturn42)); |
Label L; |
@@ -845,14 +785,12 @@ ASSEMBLER_TEST_GENERATE(JumpConditionalSimpleLeaf, assembler) { |
__ int3(); |
} |
- |
ASSEMBLER_TEST_RUN(JumpConditionalSimpleLeaf, test) { |
typedef int (*JumpConditionalSimpleLeafCode)(); |
EXPECT_EQ(42, |
reinterpret_cast<JumpConditionalSimpleLeafCode>(test->entry())()); |
} |
- |
ASSEMBLER_TEST_GENERATE(SingleFPMoves, assembler) { |
__ movl(EAX, Immediate(bit_cast<int32_t, float>(234.0f))); |
__ movd(XMM0, EAX); |
@@ -871,14 +809,12 @@ ASSEMBLER_TEST_GENERATE(SingleFPMoves, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SingleFPMoves, test) { |
typedef float (*SingleFPMovesCode)(); |
float res = reinterpret_cast<SingleFPMovesCode>(test->entry())(); |
EXPECT_EQ(234.0f, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(SingleFPMoves2, assembler) { |
__ pushl(EBX); // preserve EBX. |
__ pushl(ECX); // preserve ECX. |
@@ -894,14 +830,12 @@ ASSEMBLER_TEST_GENERATE(SingleFPMoves2, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SingleFPMoves2, test) { |
typedef float (*SingleFPMoves2Code)(); |
float res = reinterpret_cast<SingleFPMoves2Code>(test->entry())(); |
EXPECT_EQ(234.0f, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(SingleFPUStackMoves, assembler) { |
__ movl(EAX, Immediate(1131020288)); // 234.0f |
__ pushl(EAX); |
@@ -914,14 +848,12 @@ ASSEMBLER_TEST_GENERATE(SingleFPUStackMoves, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SingleFPUStackMoves, test) { |
typedef int (*SingleFPUStackMovesCode)(); |
int res = reinterpret_cast<SingleFPUStackMovesCode>(test->entry())(); |
EXPECT_EQ(234.0f, (bit_cast<float, int>(res))); |
} |
- |
ASSEMBLER_TEST_GENERATE(SingleFPOperations, assembler) { |
__ movl(EAX, Immediate(bit_cast<int32_t, float>(12.3f))); |
__ movd(XMM0, EAX); |
@@ -938,14 +870,12 @@ ASSEMBLER_TEST_GENERATE(SingleFPOperations, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SingleFPOperations, test) { |
typedef float (*SingleFPOperationsCode)(); |
float res = reinterpret_cast<SingleFPOperationsCode>(test->entry())(); |
EXPECT_FLOAT_EQ(14.7f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedFPOperations, assembler) { |
__ movl(EAX, Immediate(bit_cast<int32_t, float>(12.3f))); |
__ movd(XMM0, EAX); |
@@ -966,14 +896,12 @@ ASSEMBLER_TEST_GENERATE(PackedFPOperations, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedFPOperations, test) { |
typedef float (*PackedFPOperationsCode)(); |
float res = reinterpret_cast<PackedFPOperationsCode>(test->entry())(); |
EXPECT_FLOAT_EQ(14.7f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedIntOperations, assembler) { |
__ movl(EAX, Immediate(0x2)); |
__ movd(XMM0, EAX); |
@@ -991,14 +919,12 @@ ASSEMBLER_TEST_GENERATE(PackedIntOperations, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedIntOperations, test) { |
typedef uint32_t (*PackedIntOperationsCode)(); |
uint32_t res = reinterpret_cast<PackedIntOperationsCode>(test->entry())(); |
EXPECT_EQ(static_cast<uword>(0x5), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedFPOperations2, assembler) { |
__ movl(EAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
__ movd(XMM0, EAX); |
@@ -1018,14 +944,12 @@ ASSEMBLER_TEST_GENERATE(PackedFPOperations2, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedFPOperations2, test) { |
typedef float (*PackedFPOperations2Code)(); |
float res = reinterpret_cast<PackedFPOperations2Code>(test->entry())(); |
EXPECT_FLOAT_EQ(0.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedCompareEQ, assembler) { |
__ set1ps(XMM0, EAX, Immediate(bit_cast<int32_t, float>(2.0f))); |
__ set1ps(XMM1, EAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
@@ -1038,14 +962,12 @@ ASSEMBLER_TEST_GENERATE(PackedCompareEQ, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedCompareEQ, test) { |
typedef uint32_t (*PackedCompareEQCode)(); |
uint32_t res = reinterpret_cast<PackedCompareEQCode>(test->entry())(); |
EXPECT_EQ(static_cast<uword>(0x0), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedCompareNEQ, assembler) { |
__ set1ps(XMM0, EAX, Immediate(bit_cast<int32_t, float>(2.0f))); |
__ set1ps(XMM1, EAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
@@ -1058,14 +980,12 @@ ASSEMBLER_TEST_GENERATE(PackedCompareNEQ, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedCompareNEQ, test) { |
typedef uint32_t (*PackedCompareNEQCode)(); |
uint32_t res = reinterpret_cast<PackedCompareNEQCode>(test->entry())(); |
EXPECT_EQ(static_cast<uword>(0xFFFFFFFF), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedCompareLT, assembler) { |
__ set1ps(XMM0, EAX, Immediate(bit_cast<int32_t, float>(2.0f))); |
__ set1ps(XMM1, EAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
@@ -1078,14 +998,12 @@ ASSEMBLER_TEST_GENERATE(PackedCompareLT, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedCompareLT, test) { |
typedef uint32_t (*PackedCompareLTCode)(); |
uint32_t res = reinterpret_cast<PackedCompareLTCode>(test->entry())(); |
EXPECT_EQ(static_cast<uword>(0xFFFFFFFF), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedCompareLE, assembler) { |
__ set1ps(XMM0, EAX, Immediate(bit_cast<int32_t, float>(2.0f))); |
__ set1ps(XMM1, EAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
@@ -1098,14 +1016,12 @@ ASSEMBLER_TEST_GENERATE(PackedCompareLE, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedCompareLE, test) { |
typedef uint32_t (*PackedCompareLECode)(); |
uint32_t res = reinterpret_cast<PackedCompareLECode>(test->entry())(); |
EXPECT_EQ(static_cast<uword>(0xFFFFFFFF), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedCompareNLT, assembler) { |
__ set1ps(XMM0, EAX, Immediate(bit_cast<int32_t, float>(2.0f))); |
__ set1ps(XMM1, EAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
@@ -1118,14 +1034,12 @@ ASSEMBLER_TEST_GENERATE(PackedCompareNLT, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedCompareNLT, test) { |
typedef uint32_t (*PackedCompareNLTCode)(); |
uint32_t res = reinterpret_cast<PackedCompareNLTCode>(test->entry())(); |
EXPECT_EQ(static_cast<uword>(0x0), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedCompareNLE, assembler) { |
__ set1ps(XMM0, EAX, Immediate(bit_cast<int32_t, float>(2.0f))); |
__ set1ps(XMM1, EAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
@@ -1138,14 +1052,12 @@ ASSEMBLER_TEST_GENERATE(PackedCompareNLE, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedCompareNLE, test) { |
typedef uint32_t (*PackedCompareNLECode)(); |
uint32_t res = reinterpret_cast<PackedCompareNLECode>(test->entry())(); |
EXPECT_EQ(static_cast<uword>(0x0), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedNegate, assembler) { |
__ movl(EAX, Immediate(bit_cast<int32_t, float>(12.3f))); |
__ movd(XMM0, EAX); |
@@ -1160,14 +1072,12 @@ ASSEMBLER_TEST_GENERATE(PackedNegate, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedNegate, test) { |
typedef float (*PackedNegateCode)(); |
float res = reinterpret_cast<PackedNegateCode>(test->entry())(); |
EXPECT_FLOAT_EQ(-12.3f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedAbsolute, assembler) { |
__ movl(EAX, Immediate(bit_cast<int32_t, float>(-15.3f))); |
__ movd(XMM0, EAX); |
@@ -1182,14 +1092,12 @@ ASSEMBLER_TEST_GENERATE(PackedAbsolute, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedAbsolute, test) { |
typedef float (*PackedAbsoluteCode)(); |
float res = reinterpret_cast<PackedAbsoluteCode>(test->entry())(); |
EXPECT_FLOAT_EQ(15.3f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedSetWZero, assembler) { |
__ set1ps(XMM0, EAX, Immediate(bit_cast<int32_t, float>(12.3f))); |
__ zerowps(XMM0); |
@@ -1202,14 +1110,12 @@ ASSEMBLER_TEST_GENERATE(PackedSetWZero, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedSetWZero, test) { |
typedef float (*PackedSetWZeroCode)(); |
float res = reinterpret_cast<PackedSetWZeroCode>(test->entry())(); |
EXPECT_FLOAT_EQ(0.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedMin, assembler) { |
__ set1ps(XMM0, EAX, Immediate(bit_cast<int32_t, float>(2.0f))); |
__ set1ps(XMM1, EAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
@@ -1222,14 +1128,12 @@ ASSEMBLER_TEST_GENERATE(PackedMin, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedMin, test) { |
typedef float (*PackedMinCode)(); |
float res = reinterpret_cast<PackedMinCode>(test->entry())(); |
EXPECT_FLOAT_EQ(2.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedMax, assembler) { |
__ set1ps(XMM0, EAX, Immediate(bit_cast<int32_t, float>(2.0f))); |
__ set1ps(XMM1, EAX, Immediate(bit_cast<int32_t, float>(4.0f))); |
@@ -1242,14 +1146,12 @@ ASSEMBLER_TEST_GENERATE(PackedMax, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedMax, test) { |
typedef float (*PackedMaxCode)(); |
float res = reinterpret_cast<PackedMaxCode>(test->entry())(); |
EXPECT_FLOAT_EQ(4.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedLogicalOr, assembler) { |
static const struct ALIGN16 { |
uint32_t a; |
@@ -1274,14 +1176,12 @@ ASSEMBLER_TEST_GENERATE(PackedLogicalOr, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedLogicalOr, test) { |
typedef uint32_t (*PackedLogicalOrCode)(); |
uint32_t res = reinterpret_cast<PackedLogicalOrCode>(test->entry())(); |
EXPECT_EQ(0xFFFFFFFF, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedLogicalAnd, assembler) { |
static const struct ALIGN16 { |
uint32_t a; |
@@ -1305,14 +1205,12 @@ ASSEMBLER_TEST_GENERATE(PackedLogicalAnd, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedLogicalAnd, test) { |
typedef uint32_t (*PackedLogicalAndCode)(); |
uint32_t res = reinterpret_cast<PackedLogicalAndCode>(test->entry())(); |
EXPECT_EQ(static_cast<uword>(0x0000F000), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedLogicalNot, assembler) { |
static const struct ALIGN16 { |
uint32_t a; |
@@ -1330,14 +1228,12 @@ ASSEMBLER_TEST_GENERATE(PackedLogicalNot, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedLogicalNot, test) { |
typedef uint32_t (*PackedLogicalNotCode)(); |
uint32_t res = reinterpret_cast<PackedLogicalNotCode>(test->entry())(); |
EXPECT_EQ(static_cast<uword>(0x0), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedMoveHighLow, assembler) { |
static const struct ALIGN16 { |
float a; |
@@ -1370,14 +1266,12 @@ ASSEMBLER_TEST_GENERATE(PackedMoveHighLow, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedMoveHighLow, test) { |
typedef float (*PackedMoveHighLow)(); |
float res = reinterpret_cast<PackedMoveHighLow>(test->entry())(); |
EXPECT_FLOAT_EQ(15.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedMoveLowHigh, assembler) { |
static const struct ALIGN16 { |
float a; |
@@ -1410,14 +1304,12 @@ ASSEMBLER_TEST_GENERATE(PackedMoveLowHigh, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedMoveLowHigh, test) { |
typedef float (*PackedMoveLowHigh)(); |
float res = reinterpret_cast<PackedMoveLowHigh>(test->entry())(); |
EXPECT_FLOAT_EQ(11.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedUnpackLow, assembler) { |
static const struct ALIGN16 { |
float a; |
@@ -1449,14 +1341,12 @@ ASSEMBLER_TEST_GENERATE(PackedUnpackLow, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedUnpackLow, test) { |
typedef float (*PackedUnpackLow)(); |
float res = reinterpret_cast<PackedUnpackLow>(test->entry())(); |
EXPECT_FLOAT_EQ(11.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedUnpackHigh, assembler) { |
static const struct ALIGN16 { |
float a; |
@@ -1488,14 +1378,12 @@ ASSEMBLER_TEST_GENERATE(PackedUnpackHigh, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedUnpackHigh, test) { |
typedef float (*PackedUnpackHigh)(); |
float res = reinterpret_cast<PackedUnpackHigh>(test->entry())(); |
EXPECT_FLOAT_EQ(7.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedUnpackLowPair, assembler) { |
static const struct ALIGN16 { |
float a; |
@@ -1527,14 +1415,12 @@ ASSEMBLER_TEST_GENERATE(PackedUnpackLowPair, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedUnpackLowPair, test) { |
typedef float (*PackedUnpackLowPair)(); |
float res = reinterpret_cast<PackedUnpackLowPair>(test->entry())(); |
EXPECT_FLOAT_EQ(6.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedUnpackHighPair, assembler) { |
static const struct ALIGN16 { |
float a; |
@@ -1566,14 +1452,12 @@ ASSEMBLER_TEST_GENERATE(PackedUnpackHighPair, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedUnpackHighPair, test) { |
typedef float (*PackedUnpackHighPair)(); |
float res = reinterpret_cast<PackedUnpackHighPair>(test->entry())(); |
EXPECT_FLOAT_EQ(12.0f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleAdd, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1595,14 +1479,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleAdd, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleAdd, test) { |
typedef double (*PackedDoubleAdd)(); |
double res = reinterpret_cast<PackedDoubleAdd>(test->entry())(); |
EXPECT_FLOAT_EQ(4.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleSub, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1624,14 +1506,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleSub, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleSub, test) { |
typedef double (*PackedDoubleSub)(); |
double res = reinterpret_cast<PackedDoubleSub>(test->entry())(); |
EXPECT_FLOAT_EQ(-2.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleNegate, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1648,14 +1528,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleNegate, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleNegate, test) { |
typedef double (*PackedDoubleNegate)(); |
double res = reinterpret_cast<PackedDoubleNegate>(test->entry())(); |
EXPECT_FLOAT_EQ(-1.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleAbsolute, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1672,14 +1550,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleAbsolute, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleAbsolute, test) { |
typedef double (*PackedDoubleAbsolute)(); |
double res = reinterpret_cast<PackedDoubleAbsolute>(test->entry())(); |
EXPECT_FLOAT_EQ(1.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleMul, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1701,14 +1577,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleMul, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleMul, test) { |
typedef double (*PackedDoubleMul)(); |
double res = reinterpret_cast<PackedDoubleMul>(test->entry())(); |
EXPECT_FLOAT_EQ(9.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleDiv, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1730,14 +1604,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleDiv, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleDiv, test) { |
typedef double (*PackedDoubleDiv)(); |
double res = reinterpret_cast<PackedDoubleDiv>(test->entry())(); |
EXPECT_FLOAT_EQ(3.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleSqrt, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1754,14 +1626,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleSqrt, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleSqrt, test) { |
typedef double (*PackedDoubleSqrt)(); |
double res = reinterpret_cast<PackedDoubleSqrt>(test->entry())(); |
EXPECT_FLOAT_EQ(4.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleMin, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1783,14 +1653,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleMin, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleMin, test) { |
typedef double (*PackedDoubleMin)(); |
double res = reinterpret_cast<PackedDoubleMin>(test->entry())(); |
EXPECT_FLOAT_EQ(3.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleMax, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1812,14 +1680,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleMax, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleMax, test) { |
typedef double (*PackedDoubleMax)(); |
double res = reinterpret_cast<PackedDoubleMax>(test->entry())(); |
EXPECT_FLOAT_EQ(9.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleShuffle, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1840,14 +1706,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleShuffle, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleShuffle, test) { |
typedef double (*PackedDoubleShuffle)(); |
double res = reinterpret_cast<PackedDoubleShuffle>(test->entry())(); |
EXPECT_FLOAT_EQ(9.0, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedDoubleToSingle, assembler) { |
static const struct ALIGN16 { |
double a; |
@@ -1862,14 +1726,12 @@ ASSEMBLER_TEST_GENERATE(PackedDoubleToSingle, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedDoubleToSingle, test) { |
typedef float (*PackedDoubleToSingle)(); |
float res = reinterpret_cast<PackedDoubleToSingle>(test->entry())(); |
EXPECT_FLOAT_EQ(9.0f, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(PackedSingleToDouble, assembler) { |
static const struct ALIGN16 { |
float a; |
@@ -1888,14 +1750,12 @@ ASSEMBLER_TEST_GENERATE(PackedSingleToDouble, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(PackedSingleToDouble, test) { |
typedef double (*PackedSingleToDouble)(); |
double res = reinterpret_cast<PackedSingleToDouble>(test->entry())(); |
EXPECT_FLOAT_EQ(9.0f, res, 0.000001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(SingleFPOperationsStack, assembler) { |
__ movl(EAX, Immediate(bit_cast<int32_t, float>(12.3f))); |
__ movd(XMM0, EAX); |
@@ -1910,14 +1770,12 @@ ASSEMBLER_TEST_GENERATE(SingleFPOperationsStack, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SingleFPOperationsStack, test) { |
typedef float (*SingleFPOperationsStackCode)(float f); |
float res = reinterpret_cast<SingleFPOperationsStackCode>(test->entry())(3.4); |
EXPECT_FLOAT_EQ(14.7f, res, 0.001f); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleFPMoves, assembler) { |
int64_t l = bit_cast<int64_t, double>(1024.67); |
__ movl(EAX, Immediate(Utils::High32Bits(l))); |
@@ -1953,7 +1811,6 @@ ASSEMBLER_TEST_GENERATE(DoubleFPMoves, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleFPMoves, test) { |
typedef double (*DoubleFPMovesCode)(); |
double res = reinterpret_cast<DoubleFPMovesCode>(test->entry())(); |
@@ -1975,14 +1832,12 @@ ASSEMBLER_TEST_GENERATE(DoubleFPUStackMoves, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleFPUStackMoves, test) { |
typedef int64_t (*DoubleFPUStackMovesCode)(); |
int64_t res = reinterpret_cast<DoubleFPUStackMovesCode>(test->entry())(); |
EXPECT_FLOAT_EQ(1024.67, (bit_cast<double, int64_t>(res)), 0.001); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleFPOperations, assembler) { |
int64_t l = bit_cast<int64_t, double>(12.3); |
__ movl(EAX, Immediate(Utils::High32Bits(l))); |
@@ -2009,14 +1864,12 @@ ASSEMBLER_TEST_GENERATE(DoubleFPOperations, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleFPOperations, test) { |
typedef double (*DoubleFPOperationsCode)(); |
double res = reinterpret_cast<DoubleFPOperationsCode>(test->entry())(); |
EXPECT_FLOAT_EQ(14.7, res, 0.001); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleFPOperationsStack, assembler) { |
int64_t l = bit_cast<int64_t, double>(12.3); |
__ movl(EAX, Immediate(Utils::High32Bits(l))); |
@@ -2041,7 +1894,6 @@ ASSEMBLER_TEST_GENERATE(DoubleFPOperationsStack, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleFPOperationsStack, test) { |
typedef double (*DoubleFPOperationsStackCode)(double d); |
double res = |
@@ -2049,7 +1901,6 @@ ASSEMBLER_TEST_RUN(DoubleFPOperationsStack, test) { |
EXPECT_FLOAT_EQ(14.7, res, 0.001); |
} |
- |
ASSEMBLER_TEST_GENERATE(IntToDoubleConversion, assembler) { |
__ movl(EDX, Immediate(6)); |
__ cvtsi2sd(XMM1, EDX); |
@@ -2062,27 +1913,23 @@ ASSEMBLER_TEST_GENERATE(IntToDoubleConversion, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(IntToDoubleConversion, test) { |
typedef double (*IntToDoubleConversionCode)(); |
double res = reinterpret_cast<IntToDoubleConversionCode>(test->entry())(); |
EXPECT_FLOAT_EQ(6.0, res, 0.001); |
} |
- |
ASSEMBLER_TEST_GENERATE(IntToDoubleConversion2, assembler) { |
__ filds(Address(ESP, kWordSize)); |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(IntToDoubleConversion2, test) { |
typedef double (*IntToDoubleConversion2Code)(int i); |
double res = reinterpret_cast<IntToDoubleConversion2Code>(test->entry())(3); |
EXPECT_FLOAT_EQ(3.0, res, 0.001); |
} |
- |
ASSEMBLER_TEST_GENERATE(Int64ToDoubleConversion, assembler) { |
__ movl(EAX, Immediate(0)); |
__ movl(EDX, Immediate(6)); |
@@ -2094,14 +1941,12 @@ ASSEMBLER_TEST_GENERATE(Int64ToDoubleConversion, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Int64ToDoubleConversion, test) { |
typedef double (*Int64ToDoubleConversionCode)(); |
double res = reinterpret_cast<Int64ToDoubleConversionCode>(test->entry())(); |
EXPECT_EQ(6.0, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(NegativeInt64ToDoubleConversion, assembler) { |
__ movl(EAX, Immediate(0xFFFFFFFF)); |
__ movl(EDX, Immediate(0xFFFFFFFA)); |
@@ -2113,7 +1958,6 @@ ASSEMBLER_TEST_GENERATE(NegativeInt64ToDoubleConversion, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(NegativeInt64ToDoubleConversion, test) { |
typedef double (*NegativeInt64ToDoubleConversionCode)(); |
double res = |
@@ -2121,7 +1965,6 @@ ASSEMBLER_TEST_RUN(NegativeInt64ToDoubleConversion, test) { |
EXPECT_EQ(-6.0, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(IntToFloatConversion, assembler) { |
__ movl(EDX, Immediate(6)); |
__ cvtsi2ss(XMM1, EDX); |
@@ -2132,14 +1975,12 @@ ASSEMBLER_TEST_GENERATE(IntToFloatConversion, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(IntToFloatConversion, test) { |
typedef float (*IntToFloatConversionCode)(); |
float res = reinterpret_cast<IntToFloatConversionCode>(test->entry())(); |
EXPECT_FLOAT_EQ(6.0, res, 0.001); |
} |
- |
ASSEMBLER_TEST_GENERATE(FloatToIntConversionRound, assembler) { |
__ movsd(XMM1, Address(ESP, kWordSize)); |
__ cvtss2si(EDX, XMM1); |
@@ -2147,7 +1988,6 @@ ASSEMBLER_TEST_GENERATE(FloatToIntConversionRound, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(FloatToIntConversionRound, test) { |
typedef int (*FloatToIntConversionRoundCode)(float f); |
int res = |
@@ -2157,7 +1997,6 @@ ASSEMBLER_TEST_RUN(FloatToIntConversionRound, test) { |
EXPECT_EQ(13, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(FloatToIntConversionTrunc, assembler) { |
__ movsd(XMM1, Address(ESP, kWordSize)); |
__ cvttss2si(EDX, XMM1); |
@@ -2165,7 +2004,6 @@ ASSEMBLER_TEST_GENERATE(FloatToIntConversionTrunc, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(FloatToIntConversionTrunc, test) { |
typedef int (*FloatToIntConversionTruncCode)(float f); |
int res = |
@@ -2175,7 +2013,6 @@ ASSEMBLER_TEST_RUN(FloatToIntConversionTrunc, test) { |
EXPECT_EQ(12, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(FloatToDoubleConversion, assembler) { |
__ movl(EAX, Immediate(bit_cast<int32_t, float>(12.3f))); |
__ movd(XMM1, EAX); |
@@ -2190,14 +2027,12 @@ ASSEMBLER_TEST_GENERATE(FloatToDoubleConversion, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(FloatToDoubleConversion, test) { |
typedef double (*FloatToDoubleConversionCode)(); |
double res = reinterpret_cast<FloatToDoubleConversionCode>(test->entry())(); |
EXPECT_FLOAT_EQ(12.3, res, 0.001); |
} |
- |
ASSEMBLER_TEST_GENERATE(FloatCompare, assembler) { |
// Count errors in EAX. EAX is zero if no errors found. |
Label is_nan, is_above, is_ok, cont_1, cont_2; |
@@ -2239,14 +2074,12 @@ ASSEMBLER_TEST_GENERATE(FloatCompare, assembler) { |
__ jmp(&cont_2); |
} |
- |
ASSEMBLER_TEST_RUN(FloatCompare, test) { |
typedef int (*FloatCompareCode)(); |
int res = reinterpret_cast<FloatCompareCode>(test->entry())(); |
EXPECT_EQ(0, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleCompare, assembler) { |
int64_t a = bit_cast<int64_t, double>(12.3); |
int64_t b = bit_cast<int64_t, double>(12.5); |
@@ -2310,14 +2143,12 @@ ASSEMBLER_TEST_GENERATE(DoubleCompare, assembler) { |
__ jmp(&cont_2); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleCompare, test) { |
typedef int (*DoubleCompareCode)(); |
int res = reinterpret_cast<DoubleCompareCode>(test->entry())(); |
EXPECT_EQ(0, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleToFloatConversion, assembler) { |
int64_t l = bit_cast<int64_t, double>(12.3); |
__ movl(EAX, Immediate(Utils::High32Bits(l))); |
@@ -2333,21 +2164,18 @@ ASSEMBLER_TEST_GENERATE(DoubleToFloatConversion, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleToFloatConversion, test) { |
typedef float (*DoubleToFloatConversionCode)(); |
float res = reinterpret_cast<DoubleToFloatConversionCode>(test->entry())(); |
EXPECT_FLOAT_EQ(12.3f, res, 0.001); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleToIntConversionRound, assembler) { |
__ movsd(XMM3, Address(ESP, kWordSize)); |
__ cvtsd2si(EAX, XMM3); |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleToIntConversionRound, test) { |
typedef int (*DoubleToIntConversionRoundCode)(double d); |
int res = |
@@ -2357,14 +2185,12 @@ ASSEMBLER_TEST_RUN(DoubleToIntConversionRound, test) { |
EXPECT_EQ(13, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleToIntConversionTrunc, assembler) { |
__ movsd(XMM3, Address(ESP, kWordSize)); |
__ cvttsd2si(EAX, XMM3); |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleToIntConversionTrunc, test) { |
typedef int (*DoubleToIntConversionTruncCode)(double d); |
int res = |
@@ -2374,7 +2200,6 @@ ASSEMBLER_TEST_RUN(DoubleToIntConversionTrunc, test) { |
EXPECT_EQ(12, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleToDoubleTrunc, assembler) { |
__ movsd(XMM3, Address(ESP, kWordSize)); |
__ roundsd(XMM2, XMM3, Assembler::kRoundToZero); |
@@ -2387,7 +2212,6 @@ ASSEMBLER_TEST_GENERATE(DoubleToDoubleTrunc, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleToDoubleTrunc, test) { |
typedef double (*DoubleToDoubleTruncCode)(double d); |
double res = reinterpret_cast<DoubleToDoubleTruncCode>(test->entry())(12.3); |
@@ -2400,7 +2224,6 @@ ASSEMBLER_TEST_RUN(DoubleToDoubleTrunc, test) { |
EXPECT_EQ(-12.0, res); |
} |
- |
static const double kDoubleConst = 3.226; |
ASSEMBLER_TEST_GENERATE(GlobalAddress, assembler) { |
@@ -2414,21 +2237,18 @@ ASSEMBLER_TEST_GENERATE(GlobalAddress, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(GlobalAddress, test) { |
typedef double (*GlobalAddressCode)(); |
double res = reinterpret_cast<GlobalAddressCode>(test->entry())(); |
EXPECT_FLOAT_EQ(kDoubleConst, res, 0.000001); |
} |
- |
ASSEMBLER_TEST_GENERATE(Sine, assembler) { |
__ flds(Address(ESP, kWordSize)); |
__ fsin(); |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Sine, test) { |
typedef float (*SineCode)(float f); |
const float kFloatConst = 0.7; |
@@ -2436,14 +2256,12 @@ ASSEMBLER_TEST_RUN(Sine, test) { |
EXPECT_FLOAT_EQ(sin(kFloatConst), res, 0.0001); |
} |
- |
ASSEMBLER_TEST_GENERATE(Cosine, assembler) { |
__ flds(Address(ESP, kWordSize)); |
__ fcos(); |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Cosine, test) { |
typedef float (*CosineCode)(float f); |
const float kFloatConst = 0.7; |
@@ -2451,7 +2269,6 @@ ASSEMBLER_TEST_RUN(Cosine, test) { |
EXPECT_FLOAT_EQ(cos(kFloatConst), res, 0.0001); |
} |
- |
ASSEMBLER_TEST_GENERATE(SinCos, assembler) { |
__ fldl(Address(ESP, kWordSize)); |
__ fsincos(); |
@@ -2467,7 +2284,6 @@ ASSEMBLER_TEST_GENERATE(SinCos, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SinCos, test) { |
typedef double (*SinCosCode)(double d); |
const double arg = 1.2345; |
@@ -2476,7 +2292,6 @@ ASSEMBLER_TEST_RUN(SinCos, test) { |
EXPECT_FLOAT_EQ(expected, res, 0.000001); |
} |
- |
ASSEMBLER_TEST_GENERATE(Tangent, assembler) { |
__ fldl(Address(ESP, kWordSize)); |
__ fptan(); |
@@ -2485,7 +2300,6 @@ ASSEMBLER_TEST_GENERATE(Tangent, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Tangent, test) { |
typedef double (*TangentCode)(double d); |
const double kDoubleConst = 0.6108652375000001; |
@@ -2493,7 +2307,6 @@ ASSEMBLER_TEST_RUN(Tangent, test) { |
EXPECT_FLOAT_EQ(tan(kDoubleConst), res, 0.0001); |
} |
- |
ASSEMBLER_TEST_GENERATE(SquareRootFloat, assembler) { |
__ movss(XMM0, Address(ESP, kWordSize)); |
__ sqrtss(XMM1, XMM0); |
@@ -2504,7 +2317,6 @@ ASSEMBLER_TEST_GENERATE(SquareRootFloat, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SquareRootFloat, test) { |
typedef float (*SquareRootFloatCode)(float f); |
const float kFloatConst = 0.7; |
@@ -2512,7 +2324,6 @@ ASSEMBLER_TEST_RUN(SquareRootFloat, test) { |
EXPECT_FLOAT_EQ(sqrt(kFloatConst), res, 0.0001); |
} |
- |
ASSEMBLER_TEST_GENERATE(SquareRootDouble, assembler) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
__ sqrtsd(XMM1, XMM0); |
@@ -2525,7 +2336,6 @@ ASSEMBLER_TEST_GENERATE(SquareRootDouble, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(SquareRootDouble, test) { |
typedef double (*SquareRootDoubleCode)(double d); |
const double kDoubleConst = .7; |
@@ -2534,7 +2344,6 @@ ASSEMBLER_TEST_RUN(SquareRootDouble, test) { |
EXPECT_FLOAT_EQ(sqrt(kDoubleConst), res, 0.0001); |
} |
- |
ASSEMBLER_TEST_GENERATE(FloatNegate, assembler) { |
__ movss(XMM0, Address(ESP, kWordSize)); |
__ FloatNegate(XMM0); |
@@ -2545,7 +2354,6 @@ ASSEMBLER_TEST_GENERATE(FloatNegate, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(FloatNegate, test) { |
typedef float (*FloatNegateCode)(float f); |
const float kFloatConst = 12.345; |
@@ -2553,7 +2361,6 @@ ASSEMBLER_TEST_RUN(FloatNegate, test) { |
EXPECT_FLOAT_EQ(-kFloatConst, res, 0.0001); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleNegate, assembler) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
__ DoubleNegate(XMM0); |
@@ -2566,7 +2373,6 @@ ASSEMBLER_TEST_GENERATE(DoubleNegate, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleNegate, test) { |
typedef double (*DoubleNegateCode)(double f); |
const double kDoubleConst = 12.345; |
@@ -2574,7 +2380,6 @@ ASSEMBLER_TEST_RUN(DoubleNegate, test) { |
EXPECT_FLOAT_EQ(-kDoubleConst, res, 0.0001); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongMulReg, assembler) { |
__ movl(ECX, Address(ESP, kWordSize)); |
__ movl(EAX, Address(ESP, 2 * kWordSize)); |
@@ -2582,7 +2387,6 @@ ASSEMBLER_TEST_GENERATE(LongMulReg, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongMulReg, test) { |
typedef int64_t (*LongMulRegCode)(int a, int b); |
const int a = -12; |
@@ -2592,14 +2396,12 @@ ASSEMBLER_TEST_RUN(LongMulReg, test) { |
EXPECT_EQ(mul_res, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongMulAddress, assembler) { |
__ movl(EAX, Address(ESP, 2 * kWordSize)); |
__ imull(Address(ESP, kWordSize)); |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongMulAddress, test) { |
typedef int64_t (*LongMulAddressCode)(int a, int b); |
const int a = -12; |
@@ -2609,7 +2411,6 @@ ASSEMBLER_TEST_RUN(LongMulAddress, test) { |
EXPECT_EQ(mul_res, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongUnsignedMulReg, assembler) { |
__ movl(ECX, Address(ESP, kWordSize)); |
__ movl(EAX, Address(ESP, 2 * kWordSize)); |
@@ -2617,7 +2418,6 @@ ASSEMBLER_TEST_GENERATE(LongUnsignedMulReg, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongUnsignedMulReg, test) { |
typedef uint64_t (*LongUnsignedMulRegCode)(uint32_t a, uint32_t b); |
uint32_t a = 3; |
@@ -2632,14 +2432,12 @@ ASSEMBLER_TEST_RUN(LongUnsignedMulReg, test) { |
EXPECT_EQ(mul_res, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongUnsignedMulAddress, assembler) { |
__ movl(EAX, Address(ESP, 2 * kWordSize)); |
__ mull(Address(ESP, kWordSize)); |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongUnsignedMulAddress, test) { |
typedef uint64_t (*LongUnsignedMulAddressCode)(uint32_t a, uint32_t b); |
uint32_t a = 12; |
@@ -2655,7 +2453,6 @@ ASSEMBLER_TEST_RUN(LongUnsignedMulAddress, test) { |
EXPECT_EQ(mul_res, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongAddReg, assembler) { |
// Preserve clobbered callee-saved register (EBX). |
__ pushl(EBX); |
@@ -2670,7 +2467,6 @@ ASSEMBLER_TEST_GENERATE(LongAddReg, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongAddReg, test) { |
typedef int64_t (*LongAddRegCode)(int64_t a, int64_t b); |
int64_t a = 12; |
@@ -2683,7 +2479,6 @@ ASSEMBLER_TEST_RUN(LongAddReg, test) { |
EXPECT_EQ((a + b), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongAddAddress, assembler) { |
__ movl(EAX, Address(ESP, 1 * kWordSize)); // left low. |
__ movl(EDX, Address(ESP, 2 * kWordSize)); // left high. |
@@ -2693,7 +2488,6 @@ ASSEMBLER_TEST_GENERATE(LongAddAddress, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongAddAddress, test) { |
typedef int64_t (*LongAddAddressCode)(int64_t a, int64_t b); |
int64_t a = 12; |
@@ -2706,7 +2500,6 @@ ASSEMBLER_TEST_RUN(LongAddAddress, test) { |
EXPECT_EQ((a + b), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongSubReg, assembler) { |
// Preserve clobbered callee-saved register (EBX). |
__ pushl(EBX); |
@@ -2721,7 +2514,6 @@ ASSEMBLER_TEST_GENERATE(LongSubReg, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongSubReg, test) { |
typedef int64_t (*LongSubRegCode)(int64_t a, int64_t b); |
int64_t a = 12; |
@@ -2734,7 +2526,6 @@ ASSEMBLER_TEST_RUN(LongSubReg, test) { |
EXPECT_EQ((a - b), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongSubAddress, assembler) { |
__ movl(EAX, Address(ESP, 1 * kWordSize)); // left low. |
__ movl(EDX, Address(ESP, 2 * kWordSize)); // left high. |
@@ -2744,7 +2535,6 @@ ASSEMBLER_TEST_GENERATE(LongSubAddress, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongSubAddress, test) { |
typedef int64_t (*LongSubAddressCode)(int64_t a, int64_t b); |
int64_t a = 12; |
@@ -2757,7 +2547,6 @@ ASSEMBLER_TEST_RUN(LongSubAddress, test) { |
EXPECT_EQ((a - b), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongSubAddress2, assembler) { |
// Preserve clobbered callee-saved register (EBX). |
__ pushl(EBX); |
@@ -2778,7 +2567,6 @@ ASSEMBLER_TEST_GENERATE(LongSubAddress2, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongSubAddress2, test) { |
typedef int64_t (*LongSubAddress2Code)(int64_t a, int64_t b); |
int64_t a = 12; |
@@ -2791,7 +2579,6 @@ ASSEMBLER_TEST_RUN(LongSubAddress2, test) { |
EXPECT_EQ((a - b), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(LongAddAddress2, assembler) { |
// Preserve clobbered callee-saved register (EBX). |
__ pushl(EBX); |
@@ -2812,7 +2599,6 @@ ASSEMBLER_TEST_GENERATE(LongAddAddress2, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(LongAddAddress2, test) { |
typedef int64_t (*LongAddAddress2Code)(int64_t a, int64_t b); |
int64_t a = 12; |
@@ -2825,7 +2611,6 @@ ASSEMBLER_TEST_RUN(LongAddAddress2, test) { |
EXPECT_EQ((a + b), res); |
} |
- |
// Testing only the lower 64-bit value of 'cvtdq2pd'. |
ASSEMBLER_TEST_GENERATE(IntegerToDoubleConversion, assembler) { |
__ movsd(XMM1, Address(ESP, kWordSize)); |
@@ -2839,7 +2624,6 @@ ASSEMBLER_TEST_GENERATE(IntegerToDoubleConversion, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(IntegerToDoubleConversion, test) { |
typedef double (*IntegerToDoubleConversionCode)(int32_t); |
const int32_t val = -12; |
@@ -2848,7 +2632,6 @@ ASSEMBLER_TEST_RUN(IntegerToDoubleConversion, test) { |
EXPECT_FLOAT_EQ(static_cast<double>(val), res, 0.001); |
} |
- |
// Implement with truncation. |
ASSEMBLER_TEST_GENERATE(FPUStoreLong, assembler) { |
__ fldl(Address(ESP, kWordSize)); |
@@ -2869,7 +2652,6 @@ ASSEMBLER_TEST_GENERATE(FPUStoreLong, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(FPUStoreLong, test) { |
typedef int64_t (*FPUStoreLongCode)(double d); |
double val = 12.2; |
@@ -2886,7 +2668,6 @@ ASSEMBLER_TEST_RUN(FPUStoreLong, test) { |
EXPECT_EQ(static_cast<int64_t>(val), res); |
} |
- |
ASSEMBLER_TEST_GENERATE(XorpdZeroing, assembler) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
__ xorpd(XMM0, XMM0); |
@@ -2899,14 +2680,12 @@ ASSEMBLER_TEST_GENERATE(XorpdZeroing, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(XorpdZeroing, test) { |
typedef double (*XorpdZeroingCode)(double d); |
double res = reinterpret_cast<XorpdZeroingCode>(test->entry())(12.56e3); |
EXPECT_FLOAT_EQ(0.0, res, 0.0001); |
} |
- |
ASSEMBLER_TEST_GENERATE(Pxor, assembler) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
__ pxor(XMM0, XMM0); |
@@ -2919,14 +2698,12 @@ ASSEMBLER_TEST_GENERATE(Pxor, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Pxor, test) { |
typedef double (*PxorCode)(double d); |
double res = reinterpret_cast<PxorCode>(test->entry())(12.3456e3); |
EXPECT_FLOAT_EQ(0.0, res, 0.0); |
} |
- |
ASSEMBLER_TEST_GENERATE(Orpd, assembler) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
__ xorpd(XMM1, XMM1); |
@@ -2941,14 +2718,12 @@ ASSEMBLER_TEST_GENERATE(Orpd, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Orpd, test) { |
typedef double (*OrpdCode)(double d); |
double res = reinterpret_cast<OrpdCode>(test->entry())(12.56e3); |
EXPECT_FLOAT_EQ(-12.56e3, res, 0.0); |
} |
- |
ASSEMBLER_TEST_GENERATE(Pextrd0, assembler) { |
if (TargetCPUFeatures::sse4_1_supported()) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
@@ -2957,7 +2732,6 @@ ASSEMBLER_TEST_GENERATE(Pextrd0, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Pextrd0, test) { |
if (TargetCPUFeatures::sse4_1_supported()) { |
typedef int32_t (*PextrdCode0)(double d); |
@@ -2966,7 +2740,6 @@ ASSEMBLER_TEST_RUN(Pextrd0, test) { |
} |
} |
- |
ASSEMBLER_TEST_GENERATE(Pextrd1, assembler) { |
if (TargetCPUFeatures::sse4_1_supported()) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
@@ -2975,7 +2748,6 @@ ASSEMBLER_TEST_GENERATE(Pextrd1, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Pextrd1, test) { |
if (TargetCPUFeatures::sse4_1_supported()) { |
typedef int32_t (*PextrdCode1)(double d); |
@@ -2984,7 +2756,6 @@ ASSEMBLER_TEST_RUN(Pextrd1, test) { |
} |
} |
- |
ASSEMBLER_TEST_GENERATE(Pmovsxdq, assembler) { |
if (TargetCPUFeatures::sse4_1_supported()) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
@@ -2994,7 +2765,6 @@ ASSEMBLER_TEST_GENERATE(Pmovsxdq, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Pmovsxdq, test) { |
if (TargetCPUFeatures::sse4_1_supported()) { |
typedef int32_t (*PmovsxdqCode)(double d); |
@@ -3003,7 +2773,6 @@ ASSEMBLER_TEST_RUN(Pmovsxdq, test) { |
} |
} |
- |
ASSEMBLER_TEST_GENERATE(Pcmpeqq, assembler) { |
if (TargetCPUFeatures::sse4_1_supported()) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
@@ -3014,7 +2783,6 @@ ASSEMBLER_TEST_GENERATE(Pcmpeqq, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Pcmpeqq, test) { |
if (TargetCPUFeatures::sse4_1_supported()) { |
typedef int32_t (*PcmpeqqCode)(double d); |
@@ -3023,7 +2791,6 @@ ASSEMBLER_TEST_RUN(Pcmpeqq, test) { |
} |
} |
- |
ASSEMBLER_TEST_GENERATE(AndPd, assembler) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
__ andpd(XMM0, XMM0); |
@@ -3036,14 +2803,12 @@ ASSEMBLER_TEST_GENERATE(AndPd, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(AndPd, test) { |
typedef double (*AndpdCode)(double d); |
double res = reinterpret_cast<AndpdCode>(test->entry())(12.56e3); |
EXPECT_FLOAT_EQ(12.56e3, res, 0.0); |
} |
- |
ASSEMBLER_TEST_GENERATE(Movq, assembler) { |
__ movq(XMM0, Address(ESP, kWordSize)); |
__ subl(ESP, Immediate(kDoubleSize)); |
@@ -3053,14 +2818,12 @@ ASSEMBLER_TEST_GENERATE(Movq, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(Movq, test) { |
typedef double (*MovqCode)(double d); |
double res = reinterpret_cast<MovqCode>(test->entry())(12.34e5); |
EXPECT_FLOAT_EQ(12.34e5, res, 0.0); |
} |
- |
ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
__ DoubleAbs(XMM0); |
@@ -3073,7 +2836,6 @@ ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(DoubleAbs, test) { |
typedef double (*DoubleAbsCode)(double d); |
double val = -12.45; |
@@ -3084,7 +2846,6 @@ ASSEMBLER_TEST_RUN(DoubleAbs, test) { |
EXPECT_FLOAT_EQ(val, res, 0.001); |
} |
- |
ASSEMBLER_TEST_GENERATE(ExtractSignBits, assembler) { |
__ movsd(XMM0, Address(ESP, kWordSize)); |
__ movmskpd(EAX, XMM0); |
@@ -3092,7 +2853,6 @@ ASSEMBLER_TEST_GENERATE(ExtractSignBits, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(ExtractSignBits, test) { |
typedef int (*ExtractSignBits)(double d); |
int res = reinterpret_cast<ExtractSignBits>(test->entry())(1.0); |
@@ -3103,7 +2863,6 @@ ASSEMBLER_TEST_RUN(ExtractSignBits, test) { |
EXPECT_EQ(1, res); |
} |
- |
// Return -1 if signed, 1 if not signed and 0 otherwise. |
ASSEMBLER_TEST_GENERATE(ConditionalMovesSign, assembler) { |
// Preserve clobbered callee-saved register (EBX). |
@@ -3123,7 +2882,6 @@ ASSEMBLER_TEST_GENERATE(ConditionalMovesSign, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(ConditionalMovesSign, test) { |
typedef int (*ConditionalMovesSignCode)(int i); |
int res = reinterpret_cast<ConditionalMovesSignCode>(test->entry())(785); |
@@ -3132,7 +2890,6 @@ ASSEMBLER_TEST_RUN(ConditionalMovesSign, test) { |
EXPECT_EQ(-1, res); |
} |
- |
// Return 1 if overflow, 0 if no overflow. |
ASSEMBLER_TEST_GENERATE(ConditionalMovesNoOverflow, assembler) { |
__ movl(EDX, Address(ESP, 1 * kWordSize)); |
@@ -3143,7 +2900,6 @@ ASSEMBLER_TEST_GENERATE(ConditionalMovesNoOverflow, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(ConditionalMovesNoOverflow, test) { |
typedef int (*ConditionalMovesNoOverflowCode)(int i, int j); |
int res = reinterpret_cast<ConditionalMovesNoOverflowCode>(test->entry())( |
@@ -3153,7 +2909,6 @@ ASSEMBLER_TEST_RUN(ConditionalMovesNoOverflow, test) { |
EXPECT_EQ(0, res); |
} |
- |
// Return 1 if equal, 0 if not equal. |
ASSEMBLER_TEST_GENERATE(ConditionalMovesEqual, assembler) { |
__ xorl(EAX, EAX); |
@@ -3164,7 +2919,6 @@ ASSEMBLER_TEST_GENERATE(ConditionalMovesEqual, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(ConditionalMovesEqual, test) { |
typedef int (*ConditionalMovesEqualCode)(int i); |
int res = reinterpret_cast<ConditionalMovesEqualCode>(test->entry())(785); |
@@ -3173,7 +2927,6 @@ ASSEMBLER_TEST_RUN(ConditionalMovesEqual, test) { |
EXPECT_EQ(0, res); |
} |
- |
// Return 1 if not equal, 0 if equal. |
ASSEMBLER_TEST_GENERATE(ConditionalMovesNotEqual, assembler) { |
__ xorl(EAX, EAX); |
@@ -3184,7 +2937,6 @@ ASSEMBLER_TEST_GENERATE(ConditionalMovesNotEqual, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(ConditionalMovesNotEqual, test) { |
typedef int (*ConditionalMovesNotEqualCode)(int i); |
int res = reinterpret_cast<ConditionalMovesNotEqualCode>(test->entry())(785); |
@@ -3193,7 +2945,6 @@ ASSEMBLER_TEST_RUN(ConditionalMovesNotEqual, test) { |
EXPECT_EQ(1, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(ConditionalMovesCompare, assembler) { |
__ movl(EDX, Immediate(1)); // Greater equal. |
__ movl(ECX, Immediate(-1)); // Less |
@@ -3204,7 +2955,6 @@ ASSEMBLER_TEST_GENERATE(ConditionalMovesCompare, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(ConditionalMovesCompare, test) { |
typedef int (*ConditionalMovesCompareCode)(int i, int j); |
int res = reinterpret_cast<ConditionalMovesCompareCode>(test->entry())(10, 5); |
@@ -3215,7 +2965,6 @@ ASSEMBLER_TEST_RUN(ConditionalMovesCompare, test) { |
EXPECT_EQ(-1, res); // Less. |
} |
- |
ASSEMBLER_TEST_GENERATE(TestLoadDoubleConstant, assembler) { |
__ LoadDoubleConstant(XMM3, -12.34); |
__ pushl(EAX); |
@@ -3227,14 +2976,12 @@ ASSEMBLER_TEST_GENERATE(TestLoadDoubleConstant, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(TestLoadDoubleConstant, test) { |
typedef double (*TestLoadDoubleConstantCode)(); |
double res = reinterpret_cast<TestLoadDoubleConstantCode>(test->entry())(); |
EXPECT_FLOAT_EQ(-12.34, res, 0.0001); |
} |
- |
ASSEMBLER_TEST_GENERATE(TestObjectCompare, assembler) { |
ObjectStore* object_store = Isolate::Current()->object_store(); |
const Object& obj = Object::ZoneHandle(object_store->smi_class()); |
@@ -3252,14 +2999,12 @@ ASSEMBLER_TEST_GENERATE(TestObjectCompare, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(TestObjectCompare, test) { |
typedef bool (*TestObjectCompare)(); |
bool res = reinterpret_cast<TestObjectCompare>(test->entry())(); |
EXPECT_EQ(true, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(TestSetCC, assembler) { |
__ movl(EAX, Immediate(0xFFFFFFFF)); |
__ cmpl(EAX, EAX); |
@@ -3267,14 +3012,12 @@ ASSEMBLER_TEST_GENERATE(TestSetCC, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(TestSetCC, test) { |
typedef uword (*TestSetCC)(); |
uword res = reinterpret_cast<TestSetCC>(test->entry())(); |
EXPECT_EQ(0xFFFFFF00, res); |
} |
- |
ASSEMBLER_TEST_GENERATE(TestNop, assembler) { |
__ nop(1); |
__ nop(2); |
@@ -3288,28 +3031,24 @@ ASSEMBLER_TEST_GENERATE(TestNop, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(TestNop, test) { |
typedef int (*TestNop)(); |
int res = reinterpret_cast<TestNop>(test->entry())(); |
EXPECT_EQ(36, res); // 36 nop bytes emitted. |
} |
- |
ASSEMBLER_TEST_GENERATE(TestAlign0, assembler) { |
__ Align(4, 0); |
__ movl(EAX, Immediate(assembler->CodeSize())); // Return code size. |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(TestAlign0, test) { |
typedef int (*TestAlign0)(); |
int res = reinterpret_cast<TestAlign0>(test->entry())(); |
EXPECT_EQ(0, res); // 0 bytes emitted. |
} |
- |
ASSEMBLER_TEST_GENERATE(TestAlign1, assembler) { |
__ nop(1); |
__ Align(4, 0); |
@@ -3317,14 +3056,12 @@ ASSEMBLER_TEST_GENERATE(TestAlign1, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(TestAlign1, test) { |
typedef int (*TestAlign1)(); |
int res = reinterpret_cast<TestAlign1>(test->entry())(); |
EXPECT_EQ(4, res); // 4 bytes emitted. |
} |
- |
ASSEMBLER_TEST_GENERATE(TestAlign1Offset1, assembler) { |
__ nop(1); |
__ Align(4, 1); |
@@ -3332,14 +3069,12 @@ ASSEMBLER_TEST_GENERATE(TestAlign1Offset1, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(TestAlign1Offset1, test) { |
typedef int (*TestAlign1Offset1)(); |
int res = reinterpret_cast<TestAlign1Offset1>(test->entry())(); |
EXPECT_EQ(3, res); // 3 bytes emitted. |
} |
- |
ASSEMBLER_TEST_GENERATE(TestAlignLarge, assembler) { |
__ nop(1); |
__ Align(16, 0); |
@@ -3347,14 +3082,12 @@ ASSEMBLER_TEST_GENERATE(TestAlignLarge, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(TestAlignLarge, test) { |
typedef int (*TestAlignLarge)(); |
int res = reinterpret_cast<TestAlignLarge>(test->entry())(); |
EXPECT_EQ(16, res); // 16 bytes emitted. |
} |
- |
ASSEMBLER_TEST_GENERATE(TestRepMovsBytes, assembler) { |
// Preserve registers. |
__ pushl(ESI); |
@@ -3370,7 +3103,6 @@ ASSEMBLER_TEST_GENERATE(TestRepMovsBytes, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(TestRepMovsBytes, test) { |
const char* from = "0123456789"; |
const char* to = new char[10]; |
@@ -3383,7 +3115,6 @@ ASSEMBLER_TEST_RUN(TestRepMovsBytes, test) { |
delete[] to; |
} |
- |
// Called from assembler_test.cc. |
ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { |
__ pushl(THR); |
@@ -3398,7 +3129,6 @@ ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_GENERATE(BitTest, assembler) { |
__ movl(EAX, Immediate(4)); |
__ movl(ECX, Immediate(2)); |
@@ -3411,7 +3141,6 @@ ASSEMBLER_TEST_GENERATE(BitTest, assembler) { |
__ ret(); |
} |
- |
ASSEMBLER_TEST_RUN(BitTest, test) { |
typedef int (*BitTest)(); |
EXPECT_EQ(1, reinterpret_cast<BitTest>(test->entry())()); |