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

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

Issue 2937653002: [ia32][wasm] Add I8x16/I16x8 Splat/ExtractLane/ReplaceLane (Closed)
Patch Set: Rebase 2 Created 3 years, 5 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 | « no previous file | src/compiler/ia32/instruction-codes-ia32.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 6
7 #include "src/compilation-info.h" 7 #include "src/compilation-info.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 } 1900 }
1901 case kIA32I32x4ExtractLane: { 1901 case kIA32I32x4ExtractLane: {
1902 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1)); 1902 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1));
1903 break; 1903 break;
1904 } 1904 }
1905 case kSSEI32x4ReplaceLane: { 1905 case kSSEI32x4ReplaceLane: {
1906 CpuFeatureScope sse_scope(masm(), SSE4_1); 1906 CpuFeatureScope sse_scope(masm(), SSE4_1);
1907 __ pinsrd(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1)); 1907 __ pinsrd(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
1908 break; 1908 break;
1909 } 1909 }
1910 case kSSEI32x4Add: {
1911 __ paddd(i.OutputSimd128Register(), i.InputOperand(1));
1912 break;
1913 }
1914 case kSSEI32x4Sub: {
1915 __ psubd(i.OutputSimd128Register(), i.InputOperand(1));
1916 break;
1917 }
1918 case kAVXI32x4ReplaceLane: { 1910 case kAVXI32x4ReplaceLane: {
1919 CpuFeatureScope avx_scope(masm(), AVX); 1911 CpuFeatureScope avx_scope(masm(), AVX);
1920 __ vpinsrd(i.OutputSimd128Register(), i.InputSimd128Register(0), 1912 __ vpinsrd(i.OutputSimd128Register(), i.InputSimd128Register(0),
1921 i.InputOperand(2), i.InputInt8(1)); 1913 i.InputOperand(2), i.InputInt8(1));
1922 break; 1914 break;
1923 } 1915 }
1916 case kSSEI32x4Add: {
1917 __ paddd(i.OutputSimd128Register(), i.InputOperand(1));
1918 break;
1919 }
1924 case kAVXI32x4Add: { 1920 case kAVXI32x4Add: {
1925 CpuFeatureScope avx_scope(masm(), AVX); 1921 CpuFeatureScope avx_scope(masm(), AVX);
1926 __ vpaddd(i.OutputSimd128Register(), i.InputSimd128Register(0), 1922 __ vpaddd(i.OutputSimd128Register(), i.InputSimd128Register(0),
1927 i.InputOperand(1)); 1923 i.InputOperand(1));
1928 break; 1924 break;
1929 } 1925 }
1926 case kSSEI32x4Sub: {
1927 __ psubd(i.OutputSimd128Register(), i.InputOperand(1));
1928 break;
1929 }
1930 case kAVXI32x4Sub: { 1930 case kAVXI32x4Sub: {
1931 CpuFeatureScope avx_scope(masm(), AVX); 1931 CpuFeatureScope avx_scope(masm(), AVX);
1932 __ vpsubd(i.OutputSimd128Register(), i.InputSimd128Register(0), 1932 __ vpsubd(i.OutputSimd128Register(), i.InputSimd128Register(0),
1933 i.InputOperand(1)); 1933 i.InputOperand(1));
1934 break; 1934 break;
1935 } 1935 }
1936 case kIA32I16x8Splat: {
1937 XMMRegister dst = i.OutputSimd128Register();
1938 __ Movd(dst, i.InputOperand(0));
1939 __ Pshuflw(dst, dst, 0x0);
1940 __ Pshufd(dst, dst, 0x0);
1941 break;
1942 }
1943 case kIA32I16x8ExtractLane: {
1944 Register dst = i.OutputRegister();
1945 __ Pextrw(dst, i.InputSimd128Register(0), i.InputInt8(1));
1946 __ movsx_w(dst, dst);
1947 break;
1948 }
1949 case kSSEI16x8ReplaceLane: {
1950 __ pinsrw(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
1951 break;
1952 }
1953 case kAVXI16x8ReplaceLane: {
1954 CpuFeatureScope avx_scope(masm(), AVX);
1955 __ vpinsrw(i.OutputSimd128Register(), i.InputSimd128Register(0),
1956 i.InputOperand(2), i.InputInt8(1));
1957 break;
1958 }
1959 case kIA32I8x16Splat: {
1960 XMMRegister dst = i.OutputSimd128Register();
1961 __ Movd(dst, i.InputOperand(0));
1962 __ Pxor(kScratchDoubleReg, kScratchDoubleReg);
1963 __ Pshufb(dst, kScratchDoubleReg);
1964 break;
1965 }
1966 case kIA32I8x16ExtractLane: {
1967 Register dst = i.OutputRegister();
1968 __ Pextrb(dst, i.InputSimd128Register(0), i.InputInt8(1));
1969 __ movsx_b(dst, dst);
1970 break;
1971 }
1972 case kSSEI8x16ReplaceLane: {
1973 CpuFeatureScope sse_scope(masm(), SSE4_1);
1974 __ pinsrb(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
1975 break;
1976 }
1977 case kAVXI8x16ReplaceLane: {
1978 CpuFeatureScope avx_scope(masm(), AVX);
1979 __ vpinsrb(i.OutputSimd128Register(), i.InputSimd128Register(0),
1980 i.InputOperand(2), i.InputInt8(1));
1981 break;
1982 }
1936 case kCheckedLoadInt8: 1983 case kCheckedLoadInt8:
1937 ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_b); 1984 ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_b);
1938 break; 1985 break;
1939 case kCheckedLoadUint8: 1986 case kCheckedLoadUint8:
1940 ASSEMBLE_CHECKED_LOAD_INTEGER(movzx_b); 1987 ASSEMBLE_CHECKED_LOAD_INTEGER(movzx_b);
1941 break; 1988 break;
1942 case kCheckedLoadInt16: 1989 case kCheckedLoadInt16:
1943 ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_w); 1990 ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_w);
1944 break; 1991 break;
1945 case kCheckedLoadUint16: 1992 case kCheckedLoadUint16:
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
2773 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2820 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2774 __ Nop(padding_size); 2821 __ Nop(padding_size);
2775 } 2822 }
2776 } 2823 }
2777 2824
2778 #undef __ 2825 #undef __
2779 2826
2780 } // namespace compiler 2827 } // namespace compiler
2781 } // namespace internal 2828 } // namespace internal
2782 } // namespace v8 2829 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/ia32/instruction-codes-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698