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 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1925 case kAtomicCompareExchangeUint8: | 1925 case kAtomicCompareExchangeUint8: |
1926 case kAtomicCompareExchangeInt16: | 1926 case kAtomicCompareExchangeInt16: |
1927 case kAtomicCompareExchangeUint16: | 1927 case kAtomicCompareExchangeUint16: |
1928 case kAtomicCompareExchangeWord32: | 1928 case kAtomicCompareExchangeWord32: |
1929 UNREACHABLE(); | 1929 UNREACHABLE(); |
1930 break; | 1930 break; |
1931 case kMips64AssertEqual: | 1931 case kMips64AssertEqual: |
1932 __ Assert(eq, static_cast<BailoutReason>(i.InputOperand(2).immediate()), | 1932 __ Assert(eq, static_cast<BailoutReason>(i.InputOperand(2).immediate()), |
1933 i.InputRegister(0), Operand(i.InputRegister(1))); | 1933 i.InputRegister(0), Operand(i.InputRegister(1))); |
1934 break; | 1934 break; |
| 1935 case kMips64Float32x4Abs: { |
| 1936 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1937 __ bclri_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31); |
| 1938 break; |
| 1939 } |
| 1940 case kMips64Float32x4Neg: { |
| 1941 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1942 __ bnegi_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31); |
| 1943 break; |
| 1944 } |
| 1945 case kMips64Float32x4RecipApprox: { |
| 1946 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1947 __ frcp_w(i.OutputSimd128Register(), i.InputSimd128Register(0)); |
| 1948 break; |
| 1949 } |
| 1950 case kMips64Float32x4RecipRefine: { |
| 1951 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1952 Simd128Register dst = i.OutputSimd128Register(); |
| 1953 // Emulate with 2.0f - a * b |
| 1954 __ ldi_w(kSimd128ScratchReg, 2); |
| 1955 __ ffint_u_w(kSimd128ScratchReg, kSimd128ScratchReg); |
| 1956 __ fmul_w(dst, i.InputSimd128Register(0), i.InputSimd128Register(1)); |
| 1957 __ fsub_w(dst, kSimd128ScratchReg, dst); |
| 1958 break; |
| 1959 } |
| 1960 case kMips64Float32x4RecipSqrtApprox: { |
| 1961 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1962 __ frsqrt_w(i.OutputSimd128Register(), i.InputSimd128Register(0)); |
| 1963 break; |
| 1964 } |
| 1965 case kMips64Float32x4RecipSqrtRefine: { |
| 1966 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1967 Simd128Register dst = i.OutputSimd128Register(); |
| 1968 // Emulate with (3.0f - a * b) * 0.5f; |
| 1969 __ ldi_w(kSimd128ScratchReg, 3); |
| 1970 __ ffint_u_w(kSimd128ScratchReg, kSimd128ScratchReg); |
| 1971 __ fmul_w(dst, i.InputSimd128Register(0), i.InputSimd128Register(1)); |
| 1972 __ fsub_w(dst, kSimd128ScratchReg, dst); |
| 1973 __ ldi_w(kSimd128ScratchReg, 0x3f); |
| 1974 __ slli_w(kSimd128ScratchReg, kSimd128ScratchReg, 24); |
| 1975 __ fmul_w(dst, dst, kSimd128ScratchReg); |
| 1976 break; |
| 1977 } |
| 1978 case kMips64Float32x4Add: { |
| 1979 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1980 __ fadd_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1981 i.InputSimd128Register(1)); |
| 1982 break; |
| 1983 } |
| 1984 case kMips64Float32x4Sub: { |
| 1985 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1986 __ fsub_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1987 i.InputSimd128Register(1)); |
| 1988 break; |
| 1989 } |
| 1990 case kMips64Float32x4Mul: { |
| 1991 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1992 __ fmul_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1993 i.InputSimd128Register(1)); |
| 1994 break; |
| 1995 } |
| 1996 case kMips64Float32x4Max: { |
| 1997 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 1998 __ fmax_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1999 i.InputSimd128Register(1)); |
| 2000 break; |
| 2001 } |
| 2002 case kMips64Float32x4Min: { |
| 2003 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2004 __ fmin_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2005 i.InputSimd128Register(1)); |
| 2006 break; |
| 2007 } |
| 2008 case kMips64Float32xEqual: { |
| 2009 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2010 __ fceq_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2011 i.InputSimd128Register(1)); |
| 2012 break; |
| 2013 } |
| 2014 case kMips64Float32x4NotEqual: { |
| 2015 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2016 __ fcne_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2017 i.InputSimd128Register(1)); |
| 2018 break; |
| 2019 } |
| 2020 case kMips64Float32xLessThan: { |
| 2021 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2022 __ fclt_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2023 i.InputSimd128Register(1)); |
| 2024 break; |
| 2025 } |
| 2026 case kMips64Float32xLessThanOrEqual: { |
| 2027 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2028 __ fcle_w(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 2029 i.InputSimd128Register(1)); |
| 2030 break; |
| 2031 } |
| 2032 case kMips64Int32x4FromFloat32x4: { |
| 2033 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2034 __ ftrunc_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0)); |
| 2035 break; |
| 2036 } |
| 2037 case kMips64Uint32x4FromFloat32x4: { |
| 2038 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); |
| 2039 __ ftrunc_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0)); |
| 2040 break; |
| 2041 } |
1935 } | 2042 } |
1936 return kSuccess; | 2043 return kSuccess; |
1937 } // NOLINT(readability/fn_size) | 2044 } // NOLINT(readability/fn_size) |
1938 | 2045 |
1939 | 2046 |
1940 #define UNSUPPORTED_COND(opcode, condition) \ | 2047 #define UNSUPPORTED_COND(opcode, condition) \ |
1941 OFStream out(stdout); \ | 2048 OFStream out(stdout); \ |
1942 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \ | 2049 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \ |
1943 UNIMPLEMENTED(); | 2050 UNIMPLEMENTED(); |
1944 | 2051 |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2691 padding_size -= v8::internal::Assembler::kInstrSize; | 2798 padding_size -= v8::internal::Assembler::kInstrSize; |
2692 } | 2799 } |
2693 } | 2800 } |
2694 } | 2801 } |
2695 | 2802 |
2696 #undef __ | 2803 #undef __ |
2697 | 2804 |
2698 } // namespace compiler | 2805 } // namespace compiler |
2699 } // namespace internal | 2806 } // namespace internal |
2700 } // namespace v8 | 2807 } // namespace v8 |
OLD | NEW |