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

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

Issue 2795143003: MIPS[64]: Support for some SIMD operations (5) (Closed)
Patch Set: Fix x64 build error Created 3 years, 7 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/instruction-selector.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 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1842 case kMipsI32x4SConvertF32x4: { 1842 case kMipsI32x4SConvertF32x4: {
1843 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 1843 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1844 __ ftrunc_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0)); 1844 __ ftrunc_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
1845 break; 1845 break;
1846 } 1846 }
1847 case kMipsI32x4UConvertF32x4: { 1847 case kMipsI32x4UConvertF32x4: {
1848 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 1848 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1849 __ ftrunc_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0)); 1849 __ ftrunc_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
1850 break; 1850 break;
1851 } 1851 }
1852 case kMipsI32x4Neg: {
1853 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1854 __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
1855 __ subv_w(i.OutputSimd128Register(), kSimd128RegZero,
1856 i.InputSimd128Register(0));
1857 break;
1858 }
1859 case kMipsI32x4LtS: {
1860 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1861 __ clt_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
1862 i.InputSimd128Register(1));
1863 break;
1864 }
1865 case kMipsI32x4LeS: {
1866 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1867 __ cle_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
1868 i.InputSimd128Register(1));
1869 break;
1870 }
1871 case kMipsI32x4LtU: {
1872 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1873 __ clt_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
1874 i.InputSimd128Register(1));
1875 break;
1876 }
1877 case kMipsI32x4LeU: {
1878 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1879 __ cle_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
1880 i.InputSimd128Register(1));
1881 break;
1882 }
1883 case kMipsI16x8Splat: {
1884 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1885 __ fill_h(i.OutputSimd128Register(), i.InputRegister(0));
1886 break;
1887 }
1888 case kMipsI16x8ExtractLane: {
1889 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1890 __ copy_s_h(i.OutputRegister(), i.InputSimd128Register(0),
1891 i.InputInt8(1));
1892 break;
1893 }
1894 case kMipsI16x8ReplaceLane: {
1895 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1896 Simd128Register src = i.InputSimd128Register(0);
1897 Simd128Register dst = i.OutputSimd128Register();
1898 if (!src.is(dst)) {
1899 __ move_v(dst, src);
1900 }
1901 __ insert_h(dst, i.InputInt8(1), i.InputRegister(2));
1902 break;
1903 }
1904 case kMipsI16x8Neg: {
1905 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1906 __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
1907 __ subv_h(i.OutputSimd128Register(), kSimd128RegZero,
1908 i.InputSimd128Register(0));
1909 break;
1910 }
1911 case kMipsI16x8Shl: {
1912 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1913 __ slli_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
1914 i.InputInt4(1));
1915 break;
1916 }
1917 case kMipsI16x8ShrS: {
1918 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1919 __ srai_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
1920 i.InputInt4(1));
1921 break;
1922 }
1923 case kMipsI16x8ShrU: {
1924 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1925 __ srli_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
1926 i.InputInt4(1));
1927 break;
1928 }
1929 case kMipsI16x8Add: {
1930 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1931 __ addv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
1932 i.InputSimd128Register(1));
1933 break;
1934 }
1935 case kMipsI16x8AddSaturateS: {
1936 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1937 __ adds_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
1938 i.InputSimd128Register(1));
1939 break;
1940 }
1941 case kMipsI16x8Sub: {
1942 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1943 __ subv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
1944 i.InputSimd128Register(1));
1945 break;
1946 }
1947 case kMipsI16x8SubSaturateS: {
1948 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
1949 __ subs_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
1950 i.InputSimd128Register(1));
1951 break;
1952 }
1852 } 1953 }
1853 return kSuccess; 1954 return kSuccess;
1854 } // NOLINT(readability/fn_size) 1955 } // NOLINT(readability/fn_size)
1855 1956
1856 1957
1857 #define UNSUPPORTED_COND(opcode, condition) \ 1958 #define UNSUPPORTED_COND(opcode, condition) \
1858 OFStream out(stdout); \ 1959 OFStream out(stdout); \
1859 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \ 1960 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \
1860 UNIMPLEMENTED(); 1961 UNIMPLEMENTED();
1861 1962
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
2638 padding_size -= v8::internal::Assembler::kInstrSize; 2739 padding_size -= v8::internal::Assembler::kInstrSize;
2639 } 2740 }
2640 } 2741 }
2641 } 2742 }
2642 2743
2643 #undef __ 2744 #undef __
2644 2745
2645 } // namespace compiler 2746 } // namespace compiler
2646 } // namespace internal 2747 } // namespace internal
2647 } // namespace v8 2748 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/mips/instruction-codes-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698