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

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

Issue 1520503002: MIPS: [turbofan] Optimize Float32 to Int32 rep. changes with Float32 round ops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
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/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 #include "src/compiler/code-generator.h" 6 #include "src/compiler/code-generator.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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 case kMipsCvtDS: { 924 case kMipsCvtDS: {
925 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0)); 925 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0));
926 break; 926 break;
927 } 927 }
928 case kMipsCvtDW: { 928 case kMipsCvtDW: {
929 FPURegister scratch = kScratchDoubleReg; 929 FPURegister scratch = kScratchDoubleReg;
930 __ mtc1(i.InputRegister(0), scratch); 930 __ mtc1(i.InputRegister(0), scratch);
931 __ cvt_d_w(i.OutputDoubleRegister(), scratch); 931 __ cvt_d_w(i.OutputDoubleRegister(), scratch);
932 break; 932 break;
933 } 933 }
934 case kMipsCvtSW: {
935 FPURegister scratch = kScratchDoubleReg;
936 __ mtc1(i.InputRegister(0), scratch);
937 __ cvt_s_w(i.OutputDoubleRegister(), scratch);
938 break;
939 }
934 case kMipsCvtDUw: { 940 case kMipsCvtDUw: {
935 FPURegister scratch = kScratchDoubleReg; 941 FPURegister scratch = kScratchDoubleReg;
936 __ Cvt_d_uw(i.OutputDoubleRegister(), i.InputRegister(0), scratch); 942 __ Cvt_d_uw(i.OutputDoubleRegister(), i.InputRegister(0), scratch);
937 break; 943 break;
938 } 944 }
939 case kMipsFloorWD: { 945 case kMipsFloorWD: {
940 FPURegister scratch = kScratchDoubleReg; 946 FPURegister scratch = kScratchDoubleReg;
941 __ floor_w_d(scratch, i.InputDoubleRegister(0)); 947 __ floor_w_d(scratch, i.InputDoubleRegister(0));
942 __ mfc1(i.OutputRegister(), scratch); 948 __ mfc1(i.OutputRegister(), scratch);
943 break; 949 break;
(...skipping 10 matching lines...) Expand all
954 __ mfc1(i.OutputRegister(), scratch); 960 __ mfc1(i.OutputRegister(), scratch);
955 break; 961 break;
956 } 962 }
957 case kMipsTruncWD: { 963 case kMipsTruncWD: {
958 FPURegister scratch = kScratchDoubleReg; 964 FPURegister scratch = kScratchDoubleReg;
959 // Other arches use round to zero here, so we follow. 965 // Other arches use round to zero here, so we follow.
960 __ trunc_w_d(scratch, i.InputDoubleRegister(0)); 966 __ trunc_w_d(scratch, i.InputDoubleRegister(0));
961 __ mfc1(i.OutputRegister(), scratch); 967 __ mfc1(i.OutputRegister(), scratch);
962 break; 968 break;
963 } 969 }
970 case kMipsFloorWS: {
971 FPURegister scratch = kScratchDoubleReg;
972 __ floor_w_s(scratch, i.InputDoubleRegister(0));
973 __ mfc1(i.OutputRegister(), scratch);
974 break;
975 }
976 case kMipsCeilWS: {
977 FPURegister scratch = kScratchDoubleReg;
978 __ ceil_w_s(scratch, i.InputDoubleRegister(0));
979 __ mfc1(i.OutputRegister(), scratch);
980 break;
981 }
982 case kMipsRoundWS: {
983 FPURegister scratch = kScratchDoubleReg;
984 __ round_w_s(scratch, i.InputDoubleRegister(0));
985 __ mfc1(i.OutputRegister(), scratch);
986 break;
987 }
988 case kMipsTruncWS: {
989 FPURegister scratch = kScratchDoubleReg;
990 __ trunc_w_s(scratch, i.InputDoubleRegister(0));
991 __ mfc1(i.OutputRegister(), scratch);
992 break;
993 }
964 case kMipsTruncUwD: { 994 case kMipsTruncUwD: {
965 FPURegister scratch = kScratchDoubleReg; 995 FPURegister scratch = kScratchDoubleReg;
966 // TODO(plind): Fix wrong param order of Trunc_uw_d() macro-asm function. 996 // TODO(plind): Fix wrong param order of Trunc_uw_d() macro-asm function.
967 __ Trunc_uw_d(i.InputDoubleRegister(0), i.OutputRegister(), scratch); 997 __ Trunc_uw_d(i.InputDoubleRegister(0), i.OutputRegister(), scratch);
968 break; 998 break;
969 } 999 }
970 case kMipsFloat64ExtractLowWord32: 1000 case kMipsFloat64ExtractLowWord32:
971 __ FmoveLow(i.OutputRegister(), i.InputDoubleRegister(0)); 1001 __ FmoveLow(i.OutputRegister(), i.InputDoubleRegister(0));
972 break; 1002 break;
973 case kMipsFloat64ExtractHighWord32: 1003 case kMipsFloat64ExtractHighWord32:
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 padding_size -= v8::internal::Assembler::kInstrSize; 1732 padding_size -= v8::internal::Assembler::kInstrSize;
1703 } 1733 }
1704 } 1734 }
1705 } 1735 }
1706 1736
1707 #undef __ 1737 #undef __
1708 1738
1709 } // namespace compiler 1739 } // namespace compiler
1710 } // namespace internal 1740 } // namespace internal
1711 } // namespace v8 1741 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/mips/instruction-codes-mips.h » ('j') | src/compiler/mips/instruction-selector-mips.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698