| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Modified by the Subzero authors. | 5 // Modified by the Subzero authors. |
| 6 // | 6 // |
| 7 //===- subzero/src/assembler_ia32.h - Assembler for x86-32 ----------------===// | 7 //===- subzero/src/assembler_ia32.h - Assembler for x86-32 ----------------===// |
| 8 // | 8 // |
| 9 // The Subzero Code Generator | 9 // The Subzero Code Generator |
| 10 // | 10 // |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "assembler.h" | 29 #include "assembler.h" |
| 30 | 30 |
| 31 namespace Ice { | 31 namespace Ice { |
| 32 | 32 |
| 33 class Assembler; | 33 class Assembler; |
| 34 class ConstantRelocatable; | 34 class ConstantRelocatable; |
| 35 | 35 |
| 36 using RegX8632::GPRRegister; | 36 using RegX8632::GPRRegister; |
| 37 using RegX8632::XmmRegister; | 37 using RegX8632::XmmRegister; |
| 38 using RegX8632::ByteRegister; | 38 using RegX8632::ByteRegister; |
| 39 using RegX8632::X87STRegister; |
| 39 | 40 |
| 40 namespace x86 { | 41 namespace x86 { |
| 41 | 42 |
| 42 const int MAX_NOP_SIZE = 8; | 43 const int MAX_NOP_SIZE = 8; |
| 43 | 44 |
| 44 enum ScaleFactor { TIMES_1 = 0, TIMES_2 = 1, TIMES_4 = 2, TIMES_8 = 3 }; | 45 enum ScaleFactor { TIMES_1 = 0, TIMES_2 = 1, TIMES_4 = 2, TIMES_8 = 3 }; |
| 45 | 46 |
| 46 class DisplacementRelocation : public AssemblerFixup { | 47 class DisplacementRelocation : public AssemblerFixup { |
| 47 public: | 48 public: |
| 48 static DisplacementRelocation *create(Assembler *Asm, FixupKind Kind, | 49 static DisplacementRelocation *create(Assembler *Asm, FixupKind Kind, |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 void movsxw(GPRRegister dst, const Address &src); | 440 void movsxw(GPRRegister dst, const Address &src); |
| 440 void movw(GPRRegister dst, const Address &src); | 441 void movw(GPRRegister dst, const Address &src); |
| 441 void movw(const Address &dst, GPRRegister src); | 442 void movw(const Address &dst, GPRRegister src); |
| 442 | 443 |
| 443 void lea(Type Ty, GPRRegister dst, const Address &src); | 444 void lea(Type Ty, GPRRegister dst, const Address &src); |
| 444 | 445 |
| 445 void cmov(CondX86::BrCond cond, GPRRegister dst, GPRRegister src); | 446 void cmov(CondX86::BrCond cond, GPRRegister dst, GPRRegister src); |
| 446 | 447 |
| 447 void rep_movsb(); | 448 void rep_movsb(); |
| 448 | 449 |
| 449 void movss(XmmRegister dst, const Address &src); | 450 void movss(Type Ty, XmmRegister dst, const Address &src); |
| 450 void movss(const Address &dst, XmmRegister src); | 451 void movss(Type Ty, const Address &dst, XmmRegister src); |
| 451 void movss(XmmRegister dst, XmmRegister src); | 452 void movss(Type Ty, XmmRegister dst, XmmRegister src); |
| 452 | 453 |
| 453 void movd(XmmRegister dst, GPRRegister src); | 454 void movd(XmmRegister dst, GPRRegister src); |
| 454 void movd(XmmRegister dst, const Address &src); | 455 void movd(XmmRegister dst, const Address &src); |
| 455 void movd(GPRRegister dst, XmmRegister src); | 456 void movd(GPRRegister dst, XmmRegister src); |
| 456 void movd(const Address &dst, XmmRegister src); | 457 void movd(const Address &dst, XmmRegister src); |
| 457 | 458 |
| 458 void movq(XmmRegister dst, XmmRegister src); | 459 void movq(XmmRegister dst, XmmRegister src); |
| 459 void movq(const Address &dst, XmmRegister src); | 460 void movq(const Address &dst, XmmRegister src); |
| 460 void movq(XmmRegister dst, const Address &src); | 461 void movq(XmmRegister dst, const Address &src); |
| 461 | 462 |
| 462 void addss(Type Ty, XmmRegister dst, XmmRegister src); | 463 void addss(Type Ty, XmmRegister dst, XmmRegister src); |
| 463 void addss(Type Ty, XmmRegister dst, const Address &src); | 464 void addss(Type Ty, XmmRegister dst, const Address &src); |
| 464 void subss(Type Ty, XmmRegister dst, XmmRegister src); | 465 void subss(Type Ty, XmmRegister dst, XmmRegister src); |
| 465 void subss(Type Ty, XmmRegister dst, const Address &src); | 466 void subss(Type Ty, XmmRegister dst, const Address &src); |
| 466 void mulss(Type Ty, XmmRegister dst, XmmRegister src); | 467 void mulss(Type Ty, XmmRegister dst, XmmRegister src); |
| 467 void mulss(Type Ty, XmmRegister dst, const Address &src); | 468 void mulss(Type Ty, XmmRegister dst, const Address &src); |
| 468 void divss(Type Ty, XmmRegister dst, XmmRegister src); | 469 void divss(Type Ty, XmmRegister dst, XmmRegister src); |
| 469 void divss(Type Ty, XmmRegister dst, const Address &src); | 470 void divss(Type Ty, XmmRegister dst, const Address &src); |
| 470 | 471 |
| 471 void movsd(XmmRegister dst, const Address &src); | |
| 472 void movsd(const Address &dst, XmmRegister src); | |
| 473 void movsd(XmmRegister dst, XmmRegister src); | |
| 474 | |
| 475 void movaps(XmmRegister dst, XmmRegister src); | 472 void movaps(XmmRegister dst, XmmRegister src); |
| 476 | 473 |
| 477 void movups(XmmRegister dst, XmmRegister src); | 474 void movups(XmmRegister dst, XmmRegister src); |
| 478 void movups(XmmRegister dst, const Address &src); | 475 void movups(XmmRegister dst, const Address &src); |
| 479 void movups(const Address &dst, XmmRegister src); | 476 void movups(const Address &dst, XmmRegister src); |
| 480 | 477 |
| 481 void padd(Type Ty, XmmRegister dst, XmmRegister src); | 478 void padd(Type Ty, XmmRegister dst, XmmRegister src); |
| 482 void padd(Type Ty, XmmRegister dst, const Address &src); | 479 void padd(Type Ty, XmmRegister dst, const Address &src); |
| 483 void pand(Type Ty, XmmRegister dst, XmmRegister src); | 480 void pand(Type Ty, XmmRegister dst, XmmRegister src); |
| 484 void pand(Type Ty, XmmRegister dst, const Address &src); | 481 void pand(Type Ty, XmmRegister dst, const Address &src); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 void pcmpgt(Type Ty, XmmRegister dst, const Address &src); | 580 void pcmpgt(Type Ty, XmmRegister dst, const Address &src); |
| 584 | 581 |
| 585 enum RoundingMode { | 582 enum RoundingMode { |
| 586 kRoundToNearest = 0x0, | 583 kRoundToNearest = 0x0, |
| 587 kRoundDown = 0x1, | 584 kRoundDown = 0x1, |
| 588 kRoundUp = 0x2, | 585 kRoundUp = 0x2, |
| 589 kRoundToZero = 0x3 | 586 kRoundToZero = 0x3 |
| 590 }; | 587 }; |
| 591 void roundsd(XmmRegister dst, XmmRegister src, RoundingMode mode); | 588 void roundsd(XmmRegister dst, XmmRegister src, RoundingMode mode); |
| 592 | 589 |
| 593 void flds(const Address &src); | 590 void fld(Type Ty, const Address &src); |
| 594 void fstps(const Address &dst); | 591 void fstp(Type Ty, const Address &dst); |
| 595 | 592 void fstp(X87STRegister st); |
| 596 void fldl(const Address &src); | |
| 597 void fstpl(const Address &dst); | |
| 598 | 593 |
| 599 void fnstcw(const Address &dst); | 594 void fnstcw(const Address &dst); |
| 600 void fldcw(const Address &src); | 595 void fldcw(const Address &src); |
| 601 | 596 |
| 602 void fistpl(const Address &dst); | 597 void fistpl(const Address &dst); |
| 603 void fistps(const Address &dst); | 598 void fistps(const Address &dst); |
| 604 void fildl(const Address &src); | 599 void fildl(const Address &src); |
| 605 void filds(const Address &src); | 600 void filds(const Address &src); |
| 606 | 601 |
| 607 void fincstp(); | 602 void fincstp(); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 inline void AssemblerX86::EmitFixup(AssemblerFixup *fixup) { | 801 inline void AssemblerX86::EmitFixup(AssemblerFixup *fixup) { |
| 807 buffer_.EmitFixup(fixup); | 802 buffer_.EmitFixup(fixup); |
| 808 } | 803 } |
| 809 | 804 |
| 810 inline void AssemblerX86::EmitOperandSizeOverride() { EmitUint8(0x66); } | 805 inline void AssemblerX86::EmitOperandSizeOverride() { EmitUint8(0x66); } |
| 811 | 806 |
| 812 } // end of namespace x86 | 807 } // end of namespace x86 |
| 813 } // end of namespace Ice | 808 } // end of namespace Ice |
| 814 | 809 |
| 815 #endif // SUBZERO_SRC_ASSEMBLER_IA32_H_ | 810 #endif // SUBZERO_SRC_ASSEMBLER_IA32_H_ |
| OLD | NEW |