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

Side by Side Diff: test/cctest/test-assembler-x64.cc

Issue 60093005: Introduce addps/subps/mulps/divps for IA32/X64 (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Put all SSE1 instruction after SSE2 flag Created 7 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-assembler-ia32.cc ('k') | test/cctest/test-disasm-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 #endif 669 #endif
670 670
671 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); 671 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
672 uint64_t value1 = V8_2PART_UINT64_C(0x12345678, 87654321); 672 uint64_t value1 = V8_2PART_UINT64_C(0x12345678, 87654321);
673 CHECK_EQ(0x12345678, f(uint64_to_double(value1))); 673 CHECK_EQ(0x12345678, f(uint64_to_double(value1)));
674 uint64_t value2 = V8_2PART_UINT64_C(0x87654321, 12345678); 674 uint64_t value2 = V8_2PART_UINT64_C(0x87654321, 12345678);
675 CHECK_EQ(0x87654321, f(uint64_to_double(value2))); 675 CHECK_EQ(0x87654321, f(uint64_to_double(value2)));
676 } 676 }
677 677
678 678
679 typedef int (*F6)(float x, float y);
680 TEST(AssemblerX64SSE) {
681 CcTest::InitializeVM();
682
683 Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
684 HandleScope scope(isolate);
685 v8::internal::byte buffer[256];
686 MacroAssembler assm(isolate, buffer, sizeof buffer);
687 {
688 __ shufps(xmm0, xmm0, 0x0); // brocast first argument
689 __ shufps(xmm1, xmm1, 0x0); // brocast second argument
690 __ movaps(xmm2, xmm1);
691 __ addps(xmm2, xmm0);
692 __ mulps(xmm2, xmm1);
693 __ subps(xmm2, xmm0);
694 __ divps(xmm2, xmm1);
695 __ cvttss2si(rax, xmm2);
696 __ ret(0);
697 }
698
699 CodeDesc desc;
700 assm.GetCode(&desc);
701 Code* code = Code::cast(isolate->heap()->CreateCode(
702 desc,
703 Code::ComputeFlags(Code::STUB),
704 Handle<Code>())->ToObjectChecked());
705 CHECK(code->IsCode());
706 #ifdef OBJECT_PRINT
707 Code::cast(code)->Print();
708 #endif
709
710 F6 f = FUNCTION_CAST<F6>(Code::cast(code)->entry());
711 CHECK_EQ(2, f(1.0, 2.0));
712 }
679 #undef __ 713 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-ia32.cc ('k') | test/cctest/test-disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698