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

Side by Side Diff: src/arm/assembler-thumb32.cc

Issue 24793002: Thumb2 Backend: Make arithmetic instructions set condition codes by default Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/assembler-thumb.cc ('k') | src/arm/builtins-arm.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 uint8_t imm2 = 0; 327 uint8_t imm2 = 0;
328 if (x.shift_op_ == LSL && is_uint2(x.shift_imm_)) { 328 if (x.shift_op_ == LSL && is_uint2(x.shift_imm_)) {
329 imm2 = x.shift_imm_ & 3; 329 imm2 = x.shift_imm_ & 3;
330 return (x.rn_.code()*BH0 | rd.code()*B12 | imm2*B4 | x.rm_.code()); 330 return (x.rn_.code()*BH0 | rd.code()*B12 | imm2*B4 | x.rm_.code());
331 } 331 }
332 switch (x.shift_op_) { 332 switch (x.shift_op_) {
333 case LSL: lsl_thumb(ip, Operand(x.rm_, LSL, x.shift_imm_), LeaveCC, al); 333 case LSL: lsl_thumb(ip, Operand(x.rm_, LSL, x.shift_imm_), LeaveCC, al);
334 break; 334 break;
335 case LSR: lsr_thumb(ip, Operand(x.rm_, LSR, x.shift_imm_), LeaveCC, al); 335 case LSR: lsr_thumb(ip, Operand(x.rm_, LSR, x.shift_imm_), LeaveCC, al);
336 break; 336 break;
337 case ASR: asr_thumb(ip, Operand(x.rm_, ASR, x.shift_imm_), LeaveCC, al); 337 case ASR: asr_thumb(ip, Operand(x.rm_, ASR, x.shift_imm_),
338 LeaveCC, al, false);
338 break; 339 break;
339 default: return (x.rn_.code()*BH0 | rd.code()*B12 | x.rm_.code()); 340 default: return (x.rn_.code()*BH0 | rd.code()*B12 | x.rm_.code());
340 } 341 }
341 return (x.rn_.code()*BH0 | rd.code()*B12 | ip.code()); 342 return (x.rn_.code()*BH0 | rd.code()*B12 | ip.code());
342 } 343 }
343 344
344 345
345 Instr Assembler::thumb32_4reg(Register dst, Register src1, Register src2, 346 Instr Assembler::thumb32_4reg(Register dst, Register src1, Register src2,
346 Register srcA) { 347 Register srcA) {
347 return (src1.code()*BH0 | srcA.code()*B12 | dst.code()*B8 | src2.code()); 348 return (src1.code()*BH0 | srcA.code()*B12 | dst.code()*B8 | src2.code());
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 Condition cond) { 461 Condition cond) {
461 ASSERT(cond == al); 462 ASSERT(cond == al);
462 emit32(thumb32_mode11(MOV_32_REG3, s) | 463 emit32(thumb32_mode11(MOV_32_REG3, s) |
463 thumb32_3reg_shift_imm8(pc, dst, src)); 464 thumb32_3reg_shift_imm8(pc, dst, src));
464 } 465 }
465 466
466 467
467 // teq imm t1 - mode 1 468 // teq imm t1 - mode 1
468 void Assembler::teq_imm_t1(Register src1, Condition cond, 469 void Assembler::teq_imm_t1(Register src1, Condition cond,
469 uint32_t i, uint32_t imm3, uint32_t imm8) { 470 uint32_t i, uint32_t imm3, uint32_t imm8) {
470 emit32(thumb32_mode1(TEQ_32_IMM, SetCC) | 471 emit32(thumb32_mode1(TEQ_32_IMM, SetCCBit) |
471 thumb32_2reg_thumb_expand_imm(pc, src1, i, imm3, imm8) ); 472 thumb32_2reg_thumb_expand_imm(pc, src1, i, imm3, imm8) );
472 } 473 }
473 474
474 475
475 // teq reg t1 - mode 11 476 // teq reg t1 - mode 11
476 void Assembler::teq_reg_t1(Register src1, const Operand& src2, Condition cond) { 477 void Assembler::teq_reg_t1(Register src1, const Operand& src2, Condition cond) {
477 emit32(thumb32_mode11(TEQ_32_REG, SetCC) | 478 emit32(thumb32_mode11(TEQ_32_REG, SetCCBit) |
478 thumb32_3reg_shift_imm8(src1, pc, src2)); 479 thumb32_3reg_shift_imm8(src1, pc, src2));
479 } 480 }
480 481
481 482
482 // cmp imm t2 - mode 1 483 // cmp imm t2 - mode 1
483 void Assembler::cmp_imm_t2(Register src1, Condition cond, 484 void Assembler::cmp_imm_t2(Register src1, Condition cond,
484 uint32_t i, uint32_t imm3, uint32_t imm8) { 485 uint32_t i, uint32_t imm3, uint32_t imm8) {
485 ASSERT(cond == al); 486 ASSERT(cond == al);
486 emit32(thumb32_mode1(CMP_32_IMM, SetCC) | 487 emit32(thumb32_mode1(CMP_32_IMM, SetCCBit) |
487 thumb32_2reg_thumb_expand_imm(pc, src1, i, imm3, imm8) ); 488 thumb32_2reg_thumb_expand_imm(pc, src1, i, imm3, imm8) );
488 } 489 }
489 490
490 491
491 // cmp reg t3 - mode 11 492 // cmp reg t3 - mode 11
492 void Assembler::cmp_reg_t3(Register src1, const Operand& src2, Condition cond) { 493 void Assembler::cmp_reg_t3(Register src1, const Operand& src2, Condition cond) {
493 ASSERT(cond == al); 494 ASSERT(cond == al);
494 emit32(thumb32_mode11(CMP_32_REG3, SetCC) | 495 emit32(thumb32_mode11(CMP_32_REG3, SetCCBit) |
495 thumb32_3reg_shift_imm8(src1, pc, src2)); 496 thumb32_3reg_shift_imm8(src1, pc, src2));
496 } 497 }
497 498
498 499
499 // lsl imm t2 - mode UNKNOWN 500 // lsl imm t2 - mode UNKNOWN
500 void Assembler::lsl_imm_t2(Register dst, const Operand& src, SBit s, 501 void Assembler::lsl_imm_t2(Register dst, const Operand& src, SBit s,
501 Condition cond) { 502 Condition cond) {
502 ASSERT(cond == al); 503 ASSERT(cond == al);
503 ASSERT(is_uint5(src.shift_imm_)); 504 ASSERT(is_uint5(src.shift_imm_));
504 ASSERT(dst.code() != 13); 505 ASSERT(dst.code() != 13);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 // S Rn imm3 Rd imm2 type Rm // 3reg 683 // S Rn imm3 Rd imm2 type Rm // 3reg
683 emit32(thumb32_mode11(RSB_32_REG, s) | 684 emit32(thumb32_mode11(RSB_32_REG, s) |
684 thumb32_3reg_shift_imm8(src1, dst, src2)); 685 thumb32_3reg_shift_imm8(src1, dst, src2));
685 } 686 }
686 687
687 688
688 // tst imm t1 - mode 1 689 // tst imm t1 - mode 1
689 void Assembler::tst_imm_t1(Register src1, Condition cond, 690 void Assembler::tst_imm_t1(Register src1, Condition cond,
690 uint32_t i, uint32_t imm3, uint32_t imm8) { 691 uint32_t i, uint32_t imm3, uint32_t imm8) {
691 // Rn imm3 imm8 // 1reg 692 // Rn imm3 imm8 // 1reg
692 emit32(thumb32_mode1(TST_32_IMM, SetCC) | 693 emit32(thumb32_mode1(TST_32_IMM, SetCCBit) |
693 thumb32_2reg_thumb_expand_imm(pc, src1, i, imm3, imm8)); 694 thumb32_2reg_thumb_expand_imm(pc, src1, i, imm3, imm8));
694 } 695 }
695 696
696 697
697 // tst reg t2 - mode 11 698 // tst reg t2 - mode 11
698 void Assembler::tst_reg_t2(Register src1, const Operand& src2, Condition cond) { 699 void Assembler::tst_reg_t2(Register src1, const Operand& src2, Condition cond) {
699 // Rn imm3 imm2 type Rm 700 // Rn imm3 imm2 type Rm
700 ASSERT(cond == al); 701 ASSERT(cond == al);
701 emit32(thumb32_mode11(TST_32_REG2, SetCC) | 702 emit32(thumb32_mode11(TST_32_REG2, SetCCBit) |
702 thumb32_3reg_shift_imm8(src1, pc, src2)); 703 thumb32_3reg_shift_imm8(src1, pc, src2));
703 } 704 }
704 705
705 706
706 // cmn imm t1 - mode 1 707 // cmn imm t1 - mode 1
707 void Assembler::cmn_imm_t1(Register src1, Condition cond, 708 void Assembler::cmn_imm_t1(Register src1, Condition cond,
708 uint32_t i, uint32_t imm3, uint32_t imm8) { 709 uint32_t i, uint32_t imm3, uint32_t imm8) {
709 ASSERT(cond == al); 710 ASSERT(cond == al);
710 // SetCC turns on BH4, which is on for cmm immediate T1 711 // SetCC turns on BH4, which is on for cmm immediate T1
711 emit32(thumb32_mode1(CMN_32_IMM, SetCC) | 712 emit32(thumb32_mode1(CMN_32_IMM, SetCCBit) |
712 thumb32_2reg_thumb_expand_imm(pc, src1, i, imm3, imm8)); 713 thumb32_2reg_thumb_expand_imm(pc, src1, i, imm3, imm8));
713 } 714 }
714 715
715 716
716 // cmn reg t2 - mode 11 717 // cmn reg t2 - mode 11
717 void Assembler::cmn_reg_t2(Register src1, const Operand& src2, Condition cond) { 718 void Assembler::cmn_reg_t2(Register src1, const Operand& src2, Condition cond) {
718 // Rn imm3 imm2 type Rm // 2reg 719 // Rn imm3 imm2 type Rm // 2reg
719 ASSERT(cond == al); 720 ASSERT(cond == al);
720 // SetCC turns on BH4, which is on for cmm register T2 721 // SetCC turns on BH4, which is on for cmm register T2
721 emit32(thumb32_mode11(CMN_32_REG2, SetCC) | 722 emit32(thumb32_mode11(CMN_32_REG2, SetCCBit) |
722 thumb32_3reg_shift_imm8(src1, pc, src2)); 723 thumb32_3reg_shift_imm8(src1, pc, src2));
723 } 724 }
724 725
725 726
726 // bic imm t1 - mode 1 727 // bic imm t1 - mode 1
727 void Assembler::bic_imm_t1(Register dst, Register src1, SBit s, Condition cond, 728 void Assembler::bic_imm_t1(Register dst, Register src1, SBit s, Condition cond,
728 uint32_t i, uint32_t imm3, uint32_t imm8) { 729 uint32_t i, uint32_t imm3, uint32_t imm8) {
729 ASSERT(cond == al); 730 ASSERT(cond == al);
730 emit32(thumb32_mode1(BIC_32_IMM, s) | 731 emit32(thumb32_mode1(BIC_32_IMM, s) |
731 thumb32_2reg_thumb_expand_imm(dst, src1, i, imm3, imm8)); 732 thumb32_2reg_thumb_expand_imm(dst, src1, i, imm3, imm8));
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 void Assembler::strd_imm_t1(Register src1, Register src2, 809 void Assembler::strd_imm_t1(Register src1, Register src2,
809 const MemOperand& dst) { 810 const MemOperand& dst) {
810 emit32(thumb32_mode6(STRD_32_IMM2, STRD_32_IMM2_OP2) | 811 emit32(thumb32_mode6(STRD_32_IMM2, STRD_32_IMM2_OP2) |
811 thumb32_3reg_zero_extend_imm8(src1, src2, dst)); 812 thumb32_3reg_zero_extend_imm8(src1, src2, dst));
812 } 813 }
813 814
814 } } // namespace v8::internal 815 } } // namespace v8::internal
815 816
816 #endif // V8_TARGET_ARCH_ARM 817 #endif // V8_TARGET_ARCH_ARM
817 818
OLDNEW
« no previous file with comments | « src/arm/assembler-thumb.cc ('k') | src/arm/builtins-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698