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

Side by Side Diff: src/compiler/mips64/code-generator-mips64.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 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 break; 1021 break;
1022 case kMips64CvtDS: 1022 case kMips64CvtDS:
1023 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0)); 1023 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0));
1024 break; 1024 break;
1025 case kMips64CvtDW: { 1025 case kMips64CvtDW: {
1026 FPURegister scratch = kScratchDoubleReg; 1026 FPURegister scratch = kScratchDoubleReg;
1027 __ mtc1(i.InputRegister(0), scratch); 1027 __ mtc1(i.InputRegister(0), scratch);
1028 __ cvt_d_w(i.OutputDoubleRegister(), scratch); 1028 __ cvt_d_w(i.OutputDoubleRegister(), scratch);
1029 break; 1029 break;
1030 } 1030 }
1031 case kMips64CvtSW: {
1032 FPURegister scratch = kScratchDoubleReg;
1033 __ mtc1(i.InputRegister(0), scratch);
1034 __ cvt_s_w(i.OutputDoubleRegister(), scratch);
1035 break;
1036 }
1031 case kMips64CvtSL: { 1037 case kMips64CvtSL: {
1032 FPURegister scratch = kScratchDoubleReg; 1038 FPURegister scratch = kScratchDoubleReg;
1033 __ dmtc1(i.InputRegister(0), scratch); 1039 __ dmtc1(i.InputRegister(0), scratch);
1034 __ cvt_s_l(i.OutputDoubleRegister(), scratch); 1040 __ cvt_s_l(i.OutputDoubleRegister(), scratch);
1035 break; 1041 break;
1036 } 1042 }
1037 case kMips64CvtDL: { 1043 case kMips64CvtDL: {
1038 FPURegister scratch = kScratchDoubleReg; 1044 FPURegister scratch = kScratchDoubleReg;
1039 __ dmtc1(i.InputRegister(0), scratch); 1045 __ dmtc1(i.InputRegister(0), scratch);
1040 __ cvt_d_l(i.OutputDoubleRegister(), scratch); 1046 __ cvt_d_l(i.OutputDoubleRegister(), scratch);
(...skipping 29 matching lines...) Expand all
1070 __ mfc1(i.OutputRegister(), scratch); 1076 __ mfc1(i.OutputRegister(), scratch);
1071 break; 1077 break;
1072 } 1078 }
1073 case kMips64TruncWD: { 1079 case kMips64TruncWD: {
1074 FPURegister scratch = kScratchDoubleReg; 1080 FPURegister scratch = kScratchDoubleReg;
1075 // Other arches use round to zero here, so we follow. 1081 // Other arches use round to zero here, so we follow.
1076 __ trunc_w_d(scratch, i.InputDoubleRegister(0)); 1082 __ trunc_w_d(scratch, i.InputDoubleRegister(0));
1077 __ mfc1(i.OutputRegister(), scratch); 1083 __ mfc1(i.OutputRegister(), scratch);
1078 break; 1084 break;
1079 } 1085 }
1086 case kMips64FloorWS: {
1087 FPURegister scratch = kScratchDoubleReg;
1088 __ floor_w_s(scratch, i.InputDoubleRegister(0));
1089 __ mfc1(i.OutputRegister(), scratch);
1090 break;
1091 }
1092 case kMips64CeilWS: {
1093 FPURegister scratch = kScratchDoubleReg;
1094 __ ceil_w_s(scratch, i.InputDoubleRegister(0));
1095 __ mfc1(i.OutputRegister(), scratch);
1096 break;
1097 }
1098 case kMips64RoundWS: {
1099 FPURegister scratch = kScratchDoubleReg;
1100 __ round_w_s(scratch, i.InputDoubleRegister(0));
1101 __ mfc1(i.OutputRegister(), scratch);
1102 break;
1103 }
1104 case kMips64TruncWS: {
1105 FPURegister scratch = kScratchDoubleReg;
1106 __ trunc_w_s(scratch, i.InputDoubleRegister(0));
1107 __ mfc1(i.OutputRegister(), scratch);
1108 break;
1109 }
1080 case kMips64TruncLS: { 1110 case kMips64TruncLS: {
1081 FPURegister scratch = kScratchDoubleReg; 1111 FPURegister scratch = kScratchDoubleReg;
1082 // Other arches use round to zero here, so we follow. 1112 // Other arches use round to zero here, so we follow.
1083 __ trunc_l_s(scratch, i.InputDoubleRegister(0)); 1113 __ trunc_l_s(scratch, i.InputDoubleRegister(0));
1084 __ dmfc1(i.OutputRegister(), scratch); 1114 __ dmfc1(i.OutputRegister(), scratch);
1085 break; 1115 break;
1086 } 1116 }
1087 case kMips64TruncLD: { 1117 case kMips64TruncLD: {
1088 FPURegister scratch = kScratchDoubleReg; 1118 FPURegister scratch = kScratchDoubleReg;
1089 Register tmp_fcsr = kScratchReg; 1119 Register tmp_fcsr = kScratchReg;
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 padding_size -= v8::internal::Assembler::kInstrSize; 1880 padding_size -= v8::internal::Assembler::kInstrSize;
1851 } 1881 }
1852 } 1882 }
1853 } 1883 }
1854 1884
1855 #undef __ 1885 #undef __
1856 1886
1857 } // namespace compiler 1887 } // namespace compiler
1858 } // namespace internal 1888 } // namespace internal
1859 } // namespace v8 1889 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698