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

Side by Side Diff: src/compiler/mips/code-generator-mips.cc

Issue 2827143002: [WASM SIMD] Remove opcodes that are slow on some platforms. (Closed)
Patch Set: Remove stray tests. Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | src/compiler/mips/instruction-codes-mips.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 #include "src/compilation-info.h" 6 #include "src/compilation-info.h"
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/osr.h" 10 #include "src/compiler/osr.h"
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 case kMipsF32x4Neg: { 1775 case kMipsF32x4Neg: {
1776 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 1776 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1777 __ bnegi_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31); 1777 __ bnegi_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31);
1778 break; 1778 break;
1779 } 1779 }
1780 case kMipsF32x4RecipApprox: { 1780 case kMipsF32x4RecipApprox: {
1781 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 1781 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1782 __ frcp_w(i.OutputSimd128Register(), i.InputSimd128Register(0)); 1782 __ frcp_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
1783 break; 1783 break;
1784 } 1784 }
1785 case kMipsF32x4RecipRefine: {
1786 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1787 Simd128Register dst = i.OutputSimd128Register();
1788 // Emulate with 2.0f - a * b
1789 __ ldi_w(kSimd128ScratchReg, 2);
1790 __ ffint_u_w(kSimd128ScratchReg, kSimd128ScratchReg);
1791 __ fmul_w(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
1792 __ fsub_w(dst, kSimd128ScratchReg, dst);
1793 break;
1794 }
1795 case kMipsF32x4RecipSqrtApprox: { 1785 case kMipsF32x4RecipSqrtApprox: {
1796 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 1786 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1797 __ frsqrt_w(i.OutputSimd128Register(), i.InputSimd128Register(0)); 1787 __ frsqrt_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
1798 break; 1788 break;
1799 } 1789 }
1800 case kMipsF32x4RecipSqrtRefine: {
1801 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1802 Simd128Register dst = i.OutputSimd128Register();
1803 // Emulate with (3.0f - a * b) * 0.5f;
1804 __ ldi_w(kSimd128ScratchReg, 3);
1805 __ ffint_u_w(kSimd128ScratchReg, kSimd128ScratchReg);
1806 __ fmul_w(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
1807 __ fsub_w(dst, kSimd128ScratchReg, dst);
1808 __ ldi_w(kSimd128ScratchReg, 0x3f);
1809 __ slli_w(kSimd128ScratchReg, kSimd128ScratchReg, 24);
1810 __ fmul_w(dst, dst, kSimd128ScratchReg);
1811 break;
1812 }
1813 case kMipsF32x4Add: { 1790 case kMipsF32x4Add: {
1814 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 1791 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1815 __ fadd_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 1792 __ fadd_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
1816 i.InputSimd128Register(1)); 1793 i.InputSimd128Register(1));
1817 break; 1794 break;
1818 } 1795 }
1819 case kMipsF32x4Sub: { 1796 case kMipsF32x4Sub: {
1820 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 1797 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1821 __ fsub_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 1798 __ fsub_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
1822 i.InputSimd128Register(1)); 1799 i.InputSimd128Register(1));
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 padding_size -= v8::internal::Assembler::kInstrSize; 2640 padding_size -= v8::internal::Assembler::kInstrSize;
2664 } 2641 }
2665 } 2642 }
2666 } 2643 }
2667 2644
2668 #undef __ 2645 #undef __
2669 2646
2670 } // namespace compiler 2647 } // namespace compiler
2671 } // namespace internal 2648 } // namespace internal
2672 } // namespace v8 2649 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | src/compiler/mips/instruction-codes-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698