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

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

Issue 1545013002: Add assembler test. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 4 years, 11 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/mips64/simulator-mips64.h ('k') | test/cctest/test-assembler-mips.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 <limits.h> 5 #include <limits.h>
6 #include <stdarg.h> 6 #include <stdarg.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <cmath> 8 #include <cmath>
9 9
10 #if V8_TARGET_ARCH_MIPS64 10 #if V8_TARGET_ARCH_MIPS64
(...skipping 3476 matching lines...) Expand 10 before | Expand all | Expand 10 after
3487 static_cast<const uint32_t>(rs_u())); 3487 static_cast<const uint32_t>(rs_u()));
3488 } 3488 }
3489 SetResult(rd_reg(), alu_out); 3489 SetResult(rd_reg(), alu_out);
3490 break; 3490 break;
3491 case SRAV: 3491 case SRAV:
3492 SetResult(rd_reg(), (int32_t)rt() >> rs()); 3492 SetResult(rd_reg(), (int32_t)rt() >> rs());
3493 break; 3493 break;
3494 case DSRAV: 3494 case DSRAV:
3495 SetResult(rd_reg(), rt() >> rs()); 3495 SetResult(rd_reg(), rt() >> rs());
3496 break; 3496 break;
3497 case LSA: {
3498 DCHECK(kArchVariant == kMips64r6);
3499 int8_t sa = lsa_sa() + 1;
3500 int32_t _rt = static_cast<int32_t>(rt());
3501 int32_t _rs = static_cast<int32_t>(rs());
3502 int32_t res = _rs << sa;
3503 res += _rt;
3504 SetResult(rd_reg(), static_cast<int64_t>(res));
3505 break;
3506 }
3507 case DLSA:
3508 DCHECK(kArchVariant == kMips64r6);
3509 SetResult(rd_reg(), (rs() << (lsa_sa() + 1)) + rt());
3510 break;
3497 case MFHI: // MFHI == CLZ on R6. 3511 case MFHI: // MFHI == CLZ on R6.
3498 if (kArchVariant != kMips64r6) { 3512 if (kArchVariant != kMips64r6) {
3499 DCHECK(sa() == 0); 3513 DCHECK(sa() == 0);
3500 alu_out = get_register(HI); 3514 alu_out = get_register(HI);
3501 } else { 3515 } else {
3502 // MIPS spec: If no bits were set in GPR rs(), the result written to 3516 // MIPS spec: If no bits were set in GPR rs(), the result written to
3503 // GPR rd() is 32. 3517 // GPR rd() is 32.
3504 DCHECK(sa() == 1); 3518 DCHECK(sa() == 1);
3505 alu_out = base::bits::CountLeadingZeros32(static_cast<int32_t>(rs_u())); 3519 alu_out = base::bits::CountLeadingZeros32(static_cast<int32_t>(rs_u()));
3506 } 3520 }
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
4740 } 4754 }
4741 4755
4742 4756
4743 #undef UNSUPPORTED 4757 #undef UNSUPPORTED
4744 } // namespace internal 4758 } // namespace internal
4745 } // namespace v8 4759 } // namespace v8
4746 4760
4747 #endif // USE_SIMULATOR 4761 #endif // USE_SIMULATOR
4748 4762
4749 #endif // V8_TARGET_ARCH_MIPS64 4763 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/simulator-mips64.h ('k') | test/cctest/test-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698