617 // AES crypto instructions supported only on certain processors
618 static void aes_only() { assert( VM_Version::has_aes(), "This instruction only works on SPARC with AES instructions support"); }
619
620 // SHA crypto instructions supported only on certain processors
621 static void sha1_only() { assert( VM_Version::has_sha1(), "This instruction only works on SPARC with SHA1"); }
622 static void sha256_only() { assert( VM_Version::has_sha256(), "This instruction only works on SPARC with SHA256"); }
623 static void sha512_only() { assert( VM_Version::has_sha512(), "This instruction only works on SPARC with SHA512"); }
624
625 // CRC32C instruction supported only on certain processors
626 static void crc32c_only() { assert( VM_Version::has_crc32c(), "This instruction only works on SPARC with CRC32C"); }
627
628 // instruction only in VIS1
629 static void vis1_only() { assert( VM_Version::has_vis1(), "This instruction only works on SPARC with VIS1"); }
630
631 // instruction only in VIS2
632 static void vis2_only() { assert( VM_Version::has_vis2(), "This instruction only works on SPARC with VIS2"); }
633
634 // instruction only in VIS3
635 static void vis3_only() { assert( VM_Version::has_vis3(), "This instruction only works on SPARC with VIS3"); }
636
637 // instruction only in v9
638 static void v9_only() { } // do nothing
639
640 // instruction deprecated in v9
641 static void v9_dep() { } // do nothing for now
642
643 // v8 has no CC field
644 static void v8_no_cc(CC cc) { if (cc) v9_only(); }
645
646 protected:
647 // Simple delay-slot scheme:
648 // In order to check the programmer, the assembler keeps track of deley slots.
649 // It forbids CTIs in delay slots (conservative, but should be OK).
650 // Also, when putting an instruction into a delay slot, you must say
651 // asm->delayed()->add(...), in order to check that you don't omit
652 // delay-slot instructions.
653 // To implement this, we use a simple FSA
654
655 #ifdef ASSERT
656 #define CHECK_DELAY
657 #endif
658 #ifdef CHECK_DELAY
659 enum Delay_state { no_delay, at_delay_slot, filling_delay_slot } delay_state;
660 #endif
661
662 public:
663 // Tells assembler next instruction must NOT be in delay slot.
664 // Use at start of multinstruction macros.
665 void assert_not_delayed() {
666 // This is a separate overloading to avoid creation of string constants
667 // in non-asserted code--with some compilers this pollutes the object code.
668 #ifdef CHECK_DELAY
|
617 // AES crypto instructions supported only on certain processors
618 static void aes_only() { assert( VM_Version::has_aes(), "This instruction only works on SPARC with AES instructions support"); }
619
620 // SHA crypto instructions supported only on certain processors
621 static void sha1_only() { assert( VM_Version::has_sha1(), "This instruction only works on SPARC with SHA1"); }
622 static void sha256_only() { assert( VM_Version::has_sha256(), "This instruction only works on SPARC with SHA256"); }
623 static void sha512_only() { assert( VM_Version::has_sha512(), "This instruction only works on SPARC with SHA512"); }
624
625 // CRC32C instruction supported only on certain processors
626 static void crc32c_only() { assert( VM_Version::has_crc32c(), "This instruction only works on SPARC with CRC32C"); }
627
628 // instruction only in VIS1
629 static void vis1_only() { assert( VM_Version::has_vis1(), "This instruction only works on SPARC with VIS1"); }
630
631 // instruction only in VIS2
632 static void vis2_only() { assert( VM_Version::has_vis2(), "This instruction only works on SPARC with VIS2"); }
633
634 // instruction only in VIS3
635 static void vis3_only() { assert( VM_Version::has_vis3(), "This instruction only works on SPARC with VIS3"); }
636
637 // instruction deprecated in v9
638 static void v9_dep() { } // do nothing for now
639
640 protected:
641 // Simple delay-slot scheme:
642 // In order to check the programmer, the assembler keeps track of delay slots.
643 // It forbids CTIs in delay slots (conservative, but should be OK).
644 // Also, when putting an instruction into a delay slot, you must say
645 // asm->delayed()->add(...), in order to check that you don't omit
646 // delay-slot instructions.
647 // To implement this, we use a simple FSA
648
649 #ifdef ASSERT
650 #define CHECK_DELAY
651 #endif
652 #ifdef CHECK_DELAY
653 enum Delay_state { no_delay, at_delay_slot, filling_delay_slot } delay_state;
654 #endif
655
656 public:
657 // Tells assembler next instruction must NOT be in delay slot.
658 // Use at start of multinstruction macros.
659 void assert_not_delayed() {
660 // This is a separate overloading to avoid creation of string constants
661 // in non-asserted code--with some compilers this pollutes the object code.
662 #ifdef CHECK_DELAY
|