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

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

Issue 2220313002: S390: Decouple Add/Sub/Neg to 32/64 Bit Op (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Neg32 to use lcr Created 4 years, 4 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 5960 matching lines...) Expand 10 before | Expand all | Expand 10 after
5971 int m3 = AS(RRFInstruction)->M3Value(); \ 5971 int m3 = AS(RRFInstruction)->M3Value(); \
5972 int m4 = AS(RRFInstruction)->M4Value(); \ 5972 int m4 = AS(RRFInstruction)->M4Value(); \
5973 int length = 4; 5973 int length = 4;
5974 5974
5975 #define DECODE_RRF_A_INSTRUCTION(r1, r2, r3) \ 5975 #define DECODE_RRF_A_INSTRUCTION(r1, r2, r3) \
5976 int r1 = AS(RRFInstruction)->R1Value(); \ 5976 int r1 = AS(RRFInstruction)->R1Value(); \
5977 int r2 = AS(RRFInstruction)->R2Value(); \ 5977 int r2 = AS(RRFInstruction)->R2Value(); \
5978 int r3 = AS(RRFInstruction)->R3Value(); \ 5978 int r3 = AS(RRFInstruction)->R3Value(); \
5979 int length = 4; 5979 int length = 4;
5980 5980
5981 #define DECODE_RRF_C_INSTRUCTION(r1, r2, m3) \
5982 int r1 = AS(RRFInstruction)->R1Value(); \
5983 int r2 = AS(RRFInstruction)->R2Value(); \
5984 Condition m3 = static_cast<Condition>(AS(RRFInstruction)->M3Value()); \
5985 int length = 4;
5986
5981 #define DECODE_RR_INSTRUCTION(r1, r2) \ 5987 #define DECODE_RR_INSTRUCTION(r1, r2) \
5982 int r1 = AS(RRInstruction)->R1Value(); \ 5988 int r1 = AS(RRInstruction)->R1Value(); \
5983 int r2 = AS(RRInstruction)->R2Value(); \ 5989 int r2 = AS(RRInstruction)->R2Value(); \
5984 int length = 2; 5990 int length = 2;
5985 5991
5986 #define DECODE_RIE_D_INSTRUCTION(r1, r2, i2) \ 5992 #define DECODE_RIE_D_INSTRUCTION(r1, r2, i2) \
5987 int r1 = AS(RIEInstruction)->R1Value(); \ 5993 int r1 = AS(RIEInstruction)->R1Value(); \
5988 int r2 = AS(RIEInstruction)->R2Value(); \ 5994 int r2 = AS(RIEInstruction)->R2Value(); \
5989 int32_t i2 = AS(RIEInstruction)->I6Value(); \ 5995 int32_t i2 = AS(RIEInstruction)->I6Value(); \
5990 int length = 6; 5996 int length = 6;
(...skipping 4469 matching lines...) Expand 10 before | Expand all | Expand 10 after
10460 r1_val_ptr[i] = __builtin_popcount(x); 10466 r1_val_ptr[i] = __builtin_popcount(x);
10461 #else 10467 #else
10462 #error unsupport __builtin_popcount 10468 #error unsupport __builtin_popcount
10463 #endif 10469 #endif
10464 } 10470 }
10465 set_register(r1, static_cast<uint64_t>(r1_val)); 10471 set_register(r1, static_cast<uint64_t>(r1_val));
10466 return length; 10472 return length;
10467 } 10473 }
10468 10474
10469 EVALUATE(LOCGR) { 10475 EVALUATE(LOCGR) {
10470 UNIMPLEMENTED(); 10476 DCHECK_OPCODE(LOCR);
10471 USE(instr); 10477 DECODE_RRF_C_INSTRUCTION(r1, r2, m3);
10472 return 0; 10478 if (TestConditionCode(m3)) {
10479 set_register(r1, get_register(r2));
10480 }
10481 return length;
10473 } 10482 }
10474 10483
10475 EVALUATE(NGRK) { 10484 EVALUATE(NGRK) {
10476 DCHECK_OPCODE(NGRK); 10485 DCHECK_OPCODE(NGRK);
10477 DECODE_RRF_A_INSTRUCTION(r1, r2, r3); 10486 DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
10478 // 64-bit Non-clobbering arithmetics / bitwise ops. 10487 // 64-bit Non-clobbering arithmetics / bitwise ops.
10479 int64_t r2_val = get_register(r2); 10488 int64_t r2_val = get_register(r2);
10480 int64_t r3_val = get_register(r3); 10489 int64_t r3_val = get_register(r3);
10481 uint64_t bitwise_result = 0; 10490 uint64_t bitwise_result = 0;
10482 bitwise_result = r2_val & r3_val; 10491 bitwise_result = r2_val & r3_val;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
10557 uint64_t r2_val = get_register(r2); 10566 uint64_t r2_val = get_register(r2);
10558 uint64_t r3_val = get_register(r3); 10567 uint64_t r3_val = get_register(r3);
10559 bool isOF = CheckOverflowForUIntSub(r2_val, r3_val); 10568 bool isOF = CheckOverflowForUIntSub(r2_val, r3_val);
10560 SetS390ConditionCode<uint64_t>(r2_val - r3_val, 0); 10569 SetS390ConditionCode<uint64_t>(r2_val - r3_val, 0);
10561 SetS390OverflowCode(isOF); 10570 SetS390OverflowCode(isOF);
10562 set_register(r1, r2_val - r3_val); 10571 set_register(r1, r2_val - r3_val);
10563 return length; 10572 return length;
10564 } 10573 }
10565 10574
10566 EVALUATE(LOCR) { 10575 EVALUATE(LOCR) {
10567 UNIMPLEMENTED(); 10576 DCHECK_OPCODE(LOCR);
10568 USE(instr); 10577 DECODE_RRF_C_INSTRUCTION(r1, r2, m3);
10569 return 0; 10578 if (TestConditionCode(m3)) {
10579 set_low_register(r1, get_low_register<int32_t>(r2));
10580 }
10581 return length;
10570 } 10582 }
10571 10583
10572 EVALUATE(NRK) { 10584 EVALUATE(NRK) {
10573 DCHECK_OPCODE(NRK); 10585 DCHECK_OPCODE(NRK);
10574 DECODE_RRF_A_INSTRUCTION(r1, r2, r3); 10586 DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
10575 // 32-bit Non-clobbering arithmetics / bitwise ops 10587 // 32-bit Non-clobbering arithmetics / bitwise ops
10576 int32_t r2_val = get_low_register<int32_t>(r2); 10588 int32_t r2_val = get_low_register<int32_t>(r2);
10577 int32_t r3_val = get_low_register<int32_t>(r3); 10589 int32_t r3_val = get_low_register<int32_t>(r3);
10578 // Assume bitwise operation here 10590 // Assume bitwise operation here
10579 uint32_t bitwise_result = 0; 10591 uint32_t bitwise_result = 0;
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
12559 return 0; 12571 return 0;
12560 } 12572 }
12561 12573
12562 #undef EVALUATE 12574 #undef EVALUATE
12563 12575
12564 } // namespace internal 12576 } // namespace internal
12565 } // namespace v8 12577 } // namespace v8
12566 12578
12567 #endif // USE_SIMULATOR 12579 #endif // USE_SIMULATOR
12568 #endif // V8_TARGET_ARCH_S390 12580 #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