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

Side by Side Diff: src/s390/simulator-s390.cc

Issue 2649113007: s390: TF Codegen Optimization (Closed)
Patch Set: remove 2 unnecessary unreachables Created 3 years, 10 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 | « src/s390/macro-assembler-s390.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdarg.h> 5 #include <stdarg.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <cmath> 7 #include <cmath>
8 8
9 #if V8_TARGET_ARCH_S390 9 #if V8_TARGET_ARCH_S390
10 10
(...skipping 10099 matching lines...) Expand 10 before | Expand all | Expand 10 after
10110 return 0; 10110 return 0;
10111 } 10111 }
10112 10112
10113 EVALUATE(SLGFR) { 10113 EVALUATE(SLGFR) {
10114 UNIMPLEMENTED(); 10114 UNIMPLEMENTED();
10115 USE(instr); 10115 USE(instr);
10116 return 0; 10116 return 0;
10117 } 10117 }
10118 10118
10119 EVALUATE(MSGFR) { 10119 EVALUATE(MSGFR) {
10120 UNIMPLEMENTED(); 10120 DCHECK_OPCODE(MSGFR);
10121 USE(instr); 10121 DECODE_RRE_INSTRUCTION(r1, r2);
10122 return 0; 10122 int64_t r1_val = get_register(r1);
10123 int64_t r2_val = static_cast<int64_t>(get_low_register<int32_t>(r2));
10124 int64_t product = r1_val * r2_val;
10125 set_register(r1, product);
10126 return length;
10123 } 10127 }
10124 10128
10125 EVALUATE(DSGFR) { 10129 EVALUATE(DSGFR) {
10126 UNIMPLEMENTED(); 10130 DCHECK_OPCODE(DSGFR);
10127 USE(instr); 10131 DECODE_RRE_INSTRUCTION(r1, r2);
10128 return 0; 10132 DCHECK(r1 % 2 == 0);
10133 int64_t r1_val = get_register(r1 + 1);
10134 int64_t r2_val = static_cast<int64_t>(get_low_register<int32_t>(r2));
10135 int64_t quotient = r1_val / r2_val;
10136 int64_t remainder = r1_val % r2_val;
10137 set_register(r1, remainder);
10138 set_register(r1 + 1, quotient);
10139 return length;
10129 } 10140 }
10130 10141
10131 EVALUATE(KMAC) { 10142 EVALUATE(KMAC) {
10132 UNIMPLEMENTED(); 10143 UNIMPLEMENTED();
10133 USE(instr); 10144 USE(instr);
10134 return 0; 10145 return 0;
10135 } 10146 }
10136 10147
10137 EVALUATE(LRVR) { 10148 EVALUATE(LRVR) {
10138 DCHECK_OPCODE(LRVR); 10149 DCHECK_OPCODE(LRVR);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
10194 return 0; 10205 return 0;
10195 } 10206 }
10196 10207
10197 EVALUATE(KMC) { 10208 EVALUATE(KMC) {
10198 UNIMPLEMENTED(); 10209 UNIMPLEMENTED();
10199 USE(instr); 10210 USE(instr);
10200 return 0; 10211 return 0;
10201 } 10212 }
10202 10213
10203 EVALUATE(CGFR) { 10214 EVALUATE(CGFR) {
10204 UNIMPLEMENTED(); 10215 DCHECK_OPCODE(CGFR);
10205 USE(instr); 10216 DECODE_RRE_INSTRUCTION(r1, r2);
10206 return 0; 10217 // Compare (64)
10218 int64_t r1_val = get_register(r1);
10219 int64_t r2_val = static_cast<int64_t>(get_low_register<int32_t>(r2));
10220 SetS390ConditionCode<int64_t>(r1_val, r2_val);
10221 return length;
10207 } 10222 }
10208 10223
10209 EVALUATE(KIMD) { 10224 EVALUATE(KIMD) {
10210 UNIMPLEMENTED(); 10225 UNIMPLEMENTED();
10211 USE(instr); 10226 USE(instr);
10212 return 0; 10227 return 0;
10213 } 10228 }
10214 10229
10215 EVALUATE(KLMD) { 10230 EVALUATE(KLMD) {
10216 UNIMPLEMENTED(); 10231 UNIMPLEMENTED();
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
11024 return 0; 11039 return 0;
11025 } 11040 }
11026 11041
11027 EVALUATE(SLGF) { 11042 EVALUATE(SLGF) {
11028 UNIMPLEMENTED(); 11043 UNIMPLEMENTED();
11029 USE(instr); 11044 USE(instr);
11030 return 0; 11045 return 0;
11031 } 11046 }
11032 11047
11033 EVALUATE(MSGF) { 11048 EVALUATE(MSGF) {
11034 UNIMPLEMENTED(); 11049 DCHECK_OPCODE(MSGF);
11035 USE(instr); 11050 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
11036 return 0; 11051 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
11052 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
11053 intptr_t d2_val = d2;
11054 int64_t mem_val =
11055 static_cast<int64_t>(ReadW(b2_val + d2_val + x2_val, instr));
11056 int64_t r1_val = get_register(r1);
11057 int64_t product = r1_val * mem_val;
11058 set_register(r1, product);
11059 return length;
11037 } 11060 }
11038 11061
11039 EVALUATE(DSGF) { 11062 EVALUATE(DSGF) {
11040 UNIMPLEMENTED(); 11063 DCHECK_OPCODE(DSGF);
11041 USE(instr); 11064 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
11042 return 0; 11065 DCHECK(r1 % 2 == 0);
11066 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
11067 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
11068 intptr_t d2_val = d2;
11069 int64_t mem_val =
11070 static_cast<int64_t>(ReadW(b2_val + d2_val + x2_val, instr));
11071 int64_t r1_val = get_register(r1 + 1);
11072 int64_t quotient = r1_val / mem_val;
11073 int64_t remainder = r1_val % mem_val;
11074 set_register(r1, remainder);
11075 set_register(r1 + 1, quotient);
11076 return length;
11043 } 11077 }
11044 11078
11045 EVALUATE(LRVG) { 11079 EVALUATE(LRVG) {
11046 DCHECK_OPCODE(LRVG); 11080 DCHECK_OPCODE(LRVG);
11047 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); 11081 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
11048 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); 11082 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
11049 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); 11083 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
11050 intptr_t mem_addr = b2_val + x2_val + d2; 11084 intptr_t mem_addr = b2_val + x2_val + d2;
11051 int64_t mem_val = ReadW64(mem_addr, instr); 11085 int64_t mem_val = ReadW64(mem_addr, instr);
11052 set_register(r1, ByteReverse(mem_val)); 11086 set_register(r1, ByteReverse(mem_val));
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
11591 static_cast<uint64_t>(r1_val) * static_cast<uint64_t>(mem_val); 11625 static_cast<uint64_t>(r1_val) * static_cast<uint64_t>(mem_val);
11592 uint32_t high_bits = product >> 32; 11626 uint32_t high_bits = product >> 32;
11593 r1_val = high_bits; 11627 r1_val = high_bits;
11594 uint32_t low_bits = product & 0x00000000FFFFFFFF; 11628 uint32_t low_bits = product & 0x00000000FFFFFFFF;
11595 set_low_register(r1, high_bits); 11629 set_low_register(r1, high_bits);
11596 set_low_register(r1 + 1, low_bits); 11630 set_low_register(r1 + 1, low_bits);
11597 return length; 11631 return length;
11598 } 11632 }
11599 11633
11600 EVALUATE(DL) { 11634 EVALUATE(DL) {
11601 UNIMPLEMENTED(); 11635 DCHECK_OPCODE(ML);
11602 USE(instr); 11636 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
11603 return 0; 11637 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
11638 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
11639 DCHECK(r1 % 2 == 0);
11640 uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr);
11641 uint32_t r1_val = get_low_register<uint32_t>(r1 + 1);
11642 uint64_t quotient =
11643 static_cast<uint64_t>(r1_val) / static_cast<uint64_t>(mem_val);
11644 uint64_t remainder =
11645 static_cast<uint64_t>(r1_val) % static_cast<uint64_t>(mem_val);
11646 set_low_register(r1, remainder);
11647 set_low_register(r1 + 1, quotient);
11648 return length;
11604 } 11649 }
11605 11650
11606 EVALUATE(ALC) { 11651 EVALUATE(ALC) {
11607 UNIMPLEMENTED(); 11652 UNIMPLEMENTED();
11608 USE(instr); 11653 USE(instr);
11609 return 0; 11654 return 0;
11610 } 11655 }
11611 11656
11612 EVALUATE(SLB) { 11657 EVALUATE(SLB) {
11613 UNIMPLEMENTED(); 11658 UNIMPLEMENTED();
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
12762 return 0; 12807 return 0;
12763 } 12808 }
12764 12809
12765 #undef EVALUATE 12810 #undef EVALUATE
12766 12811
12767 } // namespace internal 12812 } // namespace internal
12768 } // namespace v8 12813 } // namespace v8
12769 12814
12770 #endif // USE_SIMULATOR 12815 #endif // USE_SIMULATOR
12771 #endif // V8_TARGET_ARCH_S390 12816 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/s390/macro-assembler-s390.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698