OLD | NEW |
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 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 __ max_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0), | 1751 __ max_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
1752 i.InputSimd128Register(1)); | 1752 i.InputSimd128Register(1)); |
1753 break; | 1753 break; |
1754 } | 1754 } |
1755 case kMipsI32x4MinU: { | 1755 case kMipsI32x4MinU: { |
1756 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); | 1756 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
1757 __ min_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0), | 1757 __ min_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
1758 i.InputSimd128Register(1)); | 1758 i.InputSimd128Register(1)); |
1759 break; | 1759 break; |
1760 } | 1760 } |
1761 case kMipsS32x4Select: { | 1761 case kMipsS32x4Select: |
| 1762 case kMipsS16x8Select: |
| 1763 case kMipsS8x16Select: { |
1762 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); | 1764 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
1763 DCHECK(i.OutputSimd128Register().is(i.InputSimd128Register(0))); | 1765 DCHECK(i.OutputSimd128Register().is(i.InputSimd128Register(0))); |
1764 __ bsel_v(i.OutputSimd128Register(), i.InputSimd128Register(2), | 1766 __ bsel_v(i.OutputSimd128Register(), i.InputSimd128Register(2), |
1765 i.InputSimd128Register(1)); | 1767 i.InputSimd128Register(1)); |
1766 break; | 1768 break; |
1767 } | 1769 } |
1768 case kMipsF32x4Abs: { | 1770 case kMipsF32x4Abs: { |
1769 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); | 1771 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
1770 __ bclri_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31); | 1772 __ bclri_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31); |
1771 break; | 1773 break; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1943 __ subv_h(i.OutputSimd128Register(), i.InputSimd128Register(0), | 1945 __ subv_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
1944 i.InputSimd128Register(1)); | 1946 i.InputSimd128Register(1)); |
1945 break; | 1947 break; |
1946 } | 1948 } |
1947 case kMipsI16x8SubSaturateS: { | 1949 case kMipsI16x8SubSaturateS: { |
1948 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); | 1950 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
1949 __ subs_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0), | 1951 __ subs_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
1950 i.InputSimd128Register(1)); | 1952 i.InputSimd128Register(1)); |
1951 break; | 1953 break; |
1952 } | 1954 } |
| 1955 case kMipsI16x8Mul: { |
| 1956 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1957 __ mulv_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1958 i.InputSimd128Register(1)); |
| 1959 break; |
| 1960 } |
| 1961 case kMipsI16x8MaxS: { |
| 1962 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1963 __ max_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1964 i.InputSimd128Register(1)); |
| 1965 break; |
| 1966 } |
| 1967 case kMipsI16x8MinS: { |
| 1968 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1969 __ min_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1970 i.InputSimd128Register(1)); |
| 1971 break; |
| 1972 } |
| 1973 case kMipsI16x8Eq: { |
| 1974 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1975 __ ceq_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1976 i.InputSimd128Register(1)); |
| 1977 break; |
| 1978 } |
| 1979 case kMipsI16x8Ne: { |
| 1980 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1981 Simd128Register dst = i.OutputSimd128Register(); |
| 1982 __ ceq_h(dst, i.InputSimd128Register(0), i.InputSimd128Register(1)); |
| 1983 __ nor_v(dst, dst, dst); |
| 1984 break; |
| 1985 } |
| 1986 case kMipsI16x8LtS: { |
| 1987 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1988 __ clt_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1989 i.InputSimd128Register(1)); |
| 1990 break; |
| 1991 } |
| 1992 case kMipsI16x8LeS: { |
| 1993 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1994 __ cle_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1995 i.InputSimd128Register(1)); |
| 1996 break; |
| 1997 } |
| 1998 case kMipsI16x8AddSaturateU: { |
| 1999 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2000 __ adds_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2001 i.InputSimd128Register(1)); |
| 2002 break; |
| 2003 } |
| 2004 case kMipsI16x8SubSaturateU: { |
| 2005 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2006 __ subs_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2007 i.InputSimd128Register(1)); |
| 2008 break; |
| 2009 } |
| 2010 case kMipsI16x8MaxU: { |
| 2011 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2012 __ max_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2013 i.InputSimd128Register(1)); |
| 2014 break; |
| 2015 } |
| 2016 case kMipsI16x8MinU: { |
| 2017 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2018 __ min_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2019 i.InputSimd128Register(1)); |
| 2020 break; |
| 2021 } |
| 2022 case kMipsI16x8LtU: { |
| 2023 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2024 __ clt_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2025 i.InputSimd128Register(1)); |
| 2026 break; |
| 2027 } |
| 2028 case kMipsI16x8LeU: { |
| 2029 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2030 __ cle_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2031 i.InputSimd128Register(1)); |
| 2032 break; |
| 2033 } |
| 2034 case kMipsI8x16Splat: { |
| 2035 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2036 __ fill_b(i.OutputSimd128Register(), i.InputRegister(0)); |
| 2037 break; |
| 2038 } |
| 2039 case kMipsI8x16ExtractLane: { |
| 2040 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2041 __ copy_s_b(i.OutputRegister(), i.InputSimd128Register(0), |
| 2042 i.InputInt8(1)); |
| 2043 break; |
| 2044 } |
| 2045 case kMipsI8x16ReplaceLane: { |
| 2046 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2047 Simd128Register src = i.InputSimd128Register(0); |
| 2048 Simd128Register dst = i.OutputSimd128Register(); |
| 2049 if (!src.is(dst)) { |
| 2050 __ move_v(dst, src); |
| 2051 } |
| 2052 __ insert_b(dst, i.InputInt8(1), i.InputRegister(2)); |
| 2053 break; |
| 2054 } |
| 2055 case kMipsI8x16Neg: { |
| 2056 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2057 __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero); |
| 2058 __ subv_b(i.OutputSimd128Register(), kSimd128RegZero, |
| 2059 i.InputSimd128Register(0)); |
| 2060 break; |
| 2061 } |
| 2062 case kMipsI8x16Shl: { |
| 2063 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2064 __ slli_b(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2065 i.InputInt3(1)); |
| 2066 break; |
| 2067 } |
| 2068 case kMipsI8x16ShrS: { |
| 2069 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2070 __ srai_b(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2071 i.InputInt3(1)); |
| 2072 break; |
| 2073 } |
1953 } | 2074 } |
1954 return kSuccess; | 2075 return kSuccess; |
1955 } // NOLINT(readability/fn_size) | 2076 } // NOLINT(readability/fn_size) |
1956 | 2077 |
1957 | 2078 |
1958 #define UNSUPPORTED_COND(opcode, condition) \ | 2079 #define UNSUPPORTED_COND(opcode, condition) \ |
1959 OFStream out(stdout); \ | 2080 OFStream out(stdout); \ |
1960 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \ | 2081 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \ |
1961 UNIMPLEMENTED(); | 2082 UNIMPLEMENTED(); |
1962 | 2083 |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2739 padding_size -= v8::internal::Assembler::kInstrSize; | 2860 padding_size -= v8::internal::Assembler::kInstrSize; |
2740 } | 2861 } |
2741 } | 2862 } |
2742 } | 2863 } |
2743 | 2864 |
2744 #undef __ | 2865 #undef __ |
2745 | 2866 |
2746 } // namespace compiler | 2867 } // namespace compiler |
2747 } // namespace internal | 2868 } // namespace internal |
2748 } // namespace v8 | 2869 } // namespace v8 |
OLD | NEW |