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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1410183004: Add instruction 'adc (register)' to ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | tests_lit/assembler/arm32/add.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===//
2 // 2 //
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 // 6 //
7 // Modified by the Subzero authors. 7 // Modified by the Subzero authors.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 // 10 //
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 return setNeedsTextFixup(); 355 return setNeedsTextFixup();
356 IValueT Rn; 356 IValueT Rn;
357 if (decodeOperand(OpRn, Rn) != DecodedAsRegister) 357 if (decodeOperand(OpRn, Rn) != DecodedAsRegister)
358 return setNeedsTextFixup(); 358 return setNeedsTextFixup();
359 constexpr IValueT Adc = B2 | B0; // 0101 359 constexpr IValueT Adc = B2 | B0; // 0101
360 IValueT Src1Value; 360 IValueT Src1Value;
361 // TODO(kschimpf) Other possible decodings of adc. 361 // TODO(kschimpf) Other possible decodings of adc.
362 switch (decodeOperand(OpSrc1, Src1Value)) { 362 switch (decodeOperand(OpSrc1, Src1Value)) {
363 default: 363 default:
364 return setNeedsTextFixup(); 364 return setNeedsTextFixup();
365 case DecodedAsRegister: {
366 // ADC (register) - ARM section 18.8.2, encoding A1:
367 // adc{s}<c> <Rd>, <Rn>, <Rm>{, <shift>}
368 //
369 // cccc0000101snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn,
370 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags.
371 constexpr IValueT Imm5 = 0;
372 Src1Value = encodeShiftRotateImm5(Src1Value, OperandARM32::kNoShift, Imm5);
373 if (((Rd == RegARM32::Encoded_Reg_pc) && SetFlags))
374 // Conditions of rule violated.
375 return setNeedsTextFixup();
376 emitType01(Cond, kInstTypeDataRegister, Adc, SetFlags, Rn, Rd, Src1Value);
377 return;
378 }
365 case DecodedAsRotatedImm8: { 379 case DecodedAsRotatedImm8: {
366 // ADC (Immediated) = ARM section A8.8.1, encoding A1: 380 // ADC (Immediated) - ARM section A8.8.1, encoding A1:
Jim Stichnoth 2015/10/27 21:35:42 "Immediated" ?
Karl 2015/10/27 22:21:36 Done.
367 // adc{s}<c> <Rd>, <Rn>, #<RotatedImm8> 381 // adc{s}<c> <Rd>, <Rn>, #<RotatedImm8>
368 // 382 //
369 // cccc0010101snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, 383 // cccc0010101snnnnddddiiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn,
370 // s=SetFlags and iiiiiiiiiiii=Src1Value=RotatedImm8. 384 // s=SetFlags and iiiiiiiiiiii=Src1Value=RotatedImm8.
371 if ((Rd == RegARM32::Encoded_Reg_pc && SetFlags)) 385 if ((Rd == RegARM32::Encoded_Reg_pc && SetFlags))
372 // Conditions of rule violated. 386 // Conditions of rule violated.
373 return setNeedsTextFixup(); 387 return setNeedsTextFixup();
374 emitType01(Cond, kInstTypeDataImmediate, Adc, SetFlags, Rn, Rd, Src1Value); 388 emitType01(Cond, kInstTypeDataImmediate, Adc, SetFlags, Rn, Rd, Src1Value);
375 return; 389 return;
376 } 390 }
(...skipping 15 matching lines...) Expand all
392 switch (decodeOperand(OpSrc1, Src1Value)) { 406 switch (decodeOperand(OpSrc1, Src1Value)) {
393 default: 407 default:
394 return setNeedsTextFixup(); 408 return setNeedsTextFixup();
395 case DecodedAsRegister: { 409 case DecodedAsRegister: {
396 // ADD (register) - ARM section A8.8.7, encoding A1: 410 // ADD (register) - ARM section A8.8.7, encoding A1:
397 // add{s}<c> <Rd>, <Rn>, <Rm>{, <shiff>} 411 // add{s}<c> <Rd>, <Rn>, <Rm>{, <shiff>}
398 // ADD (Sp plus register) - ARM section A8.8.11, encoding A1: 412 // ADD (Sp plus register) - ARM section A8.8.11, encoding A1:
399 // add{s}<c> sp, <Rn>, <Rm>{, <shiff>} 413 // add{s}<c> sp, <Rn>, <Rm>{, <shiff>}
400 // 414 //
401 // cccc0000100snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, 415 // cccc0000100snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn,
402 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags 416 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags.
403 Src1Value = encodeShiftRotateImm5(Src1Value, OperandARM32::kNoShift, 0); 417 constexpr IValueT Imm5 = 0;
418 Src1Value = encodeShiftRotateImm5(Src1Value, OperandARM32::kNoShift, Imm5);
404 if (((Rd == RegARM32::Encoded_Reg_pc) && SetFlags)) 419 if (((Rd == RegARM32::Encoded_Reg_pc) && SetFlags))
405 // Conditions of rule violated. 420 // Conditions of rule violated.
406 return setNeedsTextFixup(); 421 return setNeedsTextFixup();
407 emitType01(Cond, kInstTypeDataRegister, Add, SetFlags, Rn, Rd, Src1Value); 422 emitType01(Cond, kInstTypeDataRegister, Add, SetFlags, Rn, Rd, Src1Value);
408 return; 423 return;
409 } 424 }
410 case DecodedAsRotatedImm8: { 425 case DecodedAsRotatedImm8: {
411 // ADD (Immediate) - ARM section A8.8.5, encoding A1: 426 // ADD (Immediate) - ARM section A8.8.5, encoding A1:
412 // add{s}<c> <Rd>, <Rn>, #<RotatedImm8> 427 // add{s}<c> <Rd>, <Rn>, #<RotatedImm8>
413 // ADD (SP plus immediate) - ARM section A8.8.9, encoding A1. 428 // ADD (SP plus immediate) - ARM section A8.8.9, encoding A1.
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 // Conditions of rule violated. 606 // Conditions of rule violated.
592 return setNeedsTextFixup(); 607 return setNeedsTextFixup();
593 emitType01(Cond, kInstTypeDataImmediate, Sub, SetFlags, Rn, Rd, Src1Value); 608 emitType01(Cond, kInstTypeDataImmediate, Sub, SetFlags, Rn, Rd, Src1Value);
594 return; 609 return;
595 } 610 }
596 } 611 }
597 } 612 }
598 613
599 } // end of namespace ARM32 614 } // end of namespace ARM32
600 } // end of namespace Ice 615 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | tests_lit/assembler/arm32/add.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698