OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_BASELINE_CLASSES_H_ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_BASELINE_CLASSES_H_ |
8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_BASELINE_CLASSES_H_ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_BASELINE_CLASSES_H_ |
9 | 9 |
10 #include "native_client/src/trusted/validator_arm/inst_classes.h" | 10 #include "native_client/src/trusted/validator_arm/inst_classes.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 | 434 |
435 Unary1RegisterImmediateOpPc() {} | 435 Unary1RegisterImmediateOpPc() {} |
436 virtual SafetyLevel safety(Instruction i) const; | 436 virtual SafetyLevel safety(Instruction i) const; |
437 virtual RegisterList defs(Instruction i) const; | 437 virtual RegisterList defs(Instruction i) const; |
438 virtual RegisterList uses(Instruction i) const; | 438 virtual RegisterList uses(Instruction i) const; |
439 | 439 |
440 private: | 440 private: |
441 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterImmediateOpPc); | 441 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterImmediateOpPc); |
442 }; | 442 }; |
443 | 443 |
| 444 // Models a 1-register unary operation with two immediate 5 values |
| 445 // defining a bit range. |
| 446 // Op<c> Rd, #lsb, #width |
| 447 // +--------+--------------+----------+--------+----------+--------------+ |
| 448 // |31302928|27262524232221|2019181716|15141312|1110 9 8 7| 6 5 4 3 2 1 0| |
| 449 // +--------+--------------+----------+--------+----------+--------------+ |
| 450 // | cond | | msb | Rd | lsb | | |
| 451 // +--------+--------------+----------+--------+----------+--------------+ |
| 452 // Definitions |
| 453 // Rd = The destination register. |
| 454 // lsb = The least significant bit to be modified. |
| 455 // msb = lsb + width - 1 - The most significant bit to be modified |
| 456 // width = msb - lsb + 1 - The number of bits to be modified. |
| 457 // |
| 458 // If Rd is R15 or msbit < lsbit, the instruction is unpredictable. |
| 459 // NaCl disallows writing to PC to cause a jump. |
| 460 // Note: Currently, only implements bfc. |
| 461 class Unary1RegisterBitRangeMsbGeLsb : public ClassDecoder { |
| 462 public: |
| 463 // Interface for components of the instruction. |
| 464 static const Imm5Bits7To11Interface lsb; |
| 465 static const RegBits12To15Interface d; |
| 466 static const Imm5Bits16To20Interface msb; |
| 467 static const ConditionBits28To31Interface cond; |
| 468 |
| 469 // Methods for class. |
| 470 Unary1RegisterBitRangeMsbGeLsb() : ClassDecoder() {} |
| 471 virtual SafetyLevel safety(Instruction i) const; |
| 472 virtual RegisterList defs(Instruction i) const; |
| 473 virtual RegisterList uses(Instruction i) const; |
| 474 |
| 475 private: |
| 476 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterBitRangeMsbGeLsb); |
| 477 }; |
| 478 |
444 // Models a 2-register binary operation with two immediate values | 479 // Models a 2-register binary operation with two immediate values |
445 // defining a bit range. | 480 // defining a bit range. |
446 // Op<c> Rd, Rn, #<lsb>, #width | 481 // Op<c> Rd, Rn, #<lsb>, #width |
447 // +--------+--------------+----------+--------+----------+------+--------+ | 482 // +--------+--------------+----------+--------+----------+------+--------+ |
448 // |31302928|27262524232221|2019181716|15141312|1110 9 8 7| 6 5 4| 3 2 1 0| | 483 // |31302928|27262524232221|2019181716|15141312|1110 9 8 7| 6 5 4| 3 2 1 0| |
449 // +--------+--------------+----------+--------+----------+------+--------+ | 484 // +--------+--------------+----------+--------+----------+------+--------+ |
450 // | cond | | msb | Rd | lsb | | Rn | | 485 // | cond | | msb | Rd | lsb | | Rn | |
451 // +--------+--------------+----------+--------+----------+------+--------+ | 486 // +--------+--------------+----------+--------+----------+------+--------+ |
452 // Definitions: | 487 // Definitions: |
453 // Rd = The destination register. | 488 // Rd = The destination register. |
(...skipping 10 matching lines...) Expand all Loading... |
464 static const RegBits0To3Interface n; | 499 static const RegBits0To3Interface n; |
465 static const Imm5Bits7To11Interface lsb; | 500 static const Imm5Bits7To11Interface lsb; |
466 static const RegBits12To15Interface d; | 501 static const RegBits12To15Interface d; |
467 static const Imm5Bits16To20Interface msb; | 502 static const Imm5Bits16To20Interface msb; |
468 static const ConditionBits28To31Interface cond; | 503 static const ConditionBits28To31Interface cond; |
469 | 504 |
470 // Methods for class. | 505 // Methods for class. |
471 Binary2RegisterBitRangeMsbGeLsb() {} | 506 Binary2RegisterBitRangeMsbGeLsb() {} |
472 virtual SafetyLevel safety(Instruction i) const; | 507 virtual SafetyLevel safety(Instruction i) const; |
473 virtual RegisterList defs(Instruction i) const; | 508 virtual RegisterList defs(Instruction i) const; |
| 509 virtual RegisterList uses(Instruction i) const; |
474 | 510 |
475 private: | 511 private: |
476 NACL_DISALLOW_COPY_AND_ASSIGN(Binary2RegisterBitRangeMsbGeLsb); | 512 NACL_DISALLOW_COPY_AND_ASSIGN(Binary2RegisterBitRangeMsbGeLsb); |
477 }; | 513 }; |
478 | 514 |
479 // Models a 2-register binary operation with two immediate values | 515 // Models a 2-register binary operation with two immediate values |
480 // defining a bit range. | 516 // defining a bit range. |
481 // Op<c> Rd, Rn, #<lsb>, #width | 517 // Op<c> Rd, Rn, #<lsb>, #width |
482 // +--------+--------------+----------+--------+----------+------+--------+ | 518 // +--------+--------------+----------+--------+----------+------+--------+ |
483 // |31302928|27262524232221|2019181716|15141312|1110 9 8 7| 6 5 4| 3 2 1 0| | 519 // |31302928|27262524232221|2019181716|15141312|1110 9 8 7| 6 5 4| 3 2 1 0| |
(...skipping 17 matching lines...) Expand all Loading... |
501 static const RegBits0To3Interface n; | 537 static const RegBits0To3Interface n; |
502 static const Imm5Bits7To11Interface lsb; | 538 static const Imm5Bits7To11Interface lsb; |
503 static const RegBits12To15Interface d; | 539 static const RegBits12To15Interface d; |
504 static const Imm5Bits16To20Interface widthm1; | 540 static const Imm5Bits16To20Interface widthm1; |
505 static const ConditionBits28To31Interface cond; | 541 static const ConditionBits28To31Interface cond; |
506 | 542 |
507 // Methods for class. | 543 // Methods for class. |
508 Binary2RegisterBitRangeNotRnIsPcBitfieldExtract() {} | 544 Binary2RegisterBitRangeNotRnIsPcBitfieldExtract() {} |
509 virtual SafetyLevel safety(Instruction i) const; | 545 virtual SafetyLevel safety(Instruction i) const; |
510 virtual RegisterList defs(Instruction i) const; | 546 virtual RegisterList defs(Instruction i) const; |
| 547 virtual RegisterList uses(Instruction i) const; |
511 | 548 |
512 private: | 549 private: |
513 NACL_DISALLOW_COPY_AND_ASSIGN( | 550 NACL_DISALLOW_COPY_AND_ASSIGN( |
514 Binary2RegisterBitRangeNotRnIsPcBitfieldExtract); | 551 Binary2RegisterBitRangeNotRnIsPcBitfieldExtract); |
515 }; | 552 }; |
516 | 553 |
517 // Models a 2-register binary operation with an immediate value. | 554 // Models a 2-register binary operation with an immediate value. |
518 // Op(S)<c> <Rd>, <Rn>, #<const> | 555 // Op(S)<c> <Rd>, <Rn>, #<const> |
519 // +--------+--------------+--+--------+--------+------------------------+ | 556 // +--------+--------------+--+--------+--------+------------------------+ |
520 // |31302928|27262524232221|20|19181716|15141312|1110 9 8 7 6 5 4 3 2 1 0| | 557 // |31302928|27262524232221|20|19181716|15141312|1110 9 8 7 6 5 4 3 2 1 0| |
(...skipping 3143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3664 InstructionBarrier() {} | 3701 InstructionBarrier() {} |
3665 virtual SafetyLevel safety(Instruction i) const; | 3702 virtual SafetyLevel safety(Instruction i) const; |
3666 | 3703 |
3667 private: | 3704 private: |
3668 NACL_DISALLOW_COPY_AND_ASSIGN(InstructionBarrier); | 3705 NACL_DISALLOW_COPY_AND_ASSIGN(InstructionBarrier); |
3669 }; | 3706 }; |
3670 | 3707 |
3671 } // namespace nacl_arm_dec | 3708 } // namespace nacl_arm_dec |
3672 | 3709 |
3673 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_BASELINE_CLASSES_H_ | 3710 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_BASELINE_CLASSES_H_ |
OLD | NEW |