| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 // --------------------------------------------------------------------------- | 828 // --------------------------------------------------------------------------- |
| 829 // Code generation | 829 // Code generation |
| 830 | 830 |
| 831 // Insert the smallest number of nop instructions | 831 // Insert the smallest number of nop instructions |
| 832 // possible to align the pc offset to a multiple | 832 // possible to align the pc offset to a multiple |
| 833 // of m. m must be a power of 2 (>= 4). | 833 // of m. m must be a power of 2 (>= 4). |
| 834 void Align(int m); | 834 void Align(int m); |
| 835 // Aligns code to something that's optimal for a jump target for the platform. | 835 // Aligns code to something that's optimal for a jump target for the platform. |
| 836 void CodeTargetAlign(); | 836 void CodeTargetAlign(); |
| 837 | 837 |
| 838 SBit sbit_from_mode(SBitMode smode) { |
| 839 return smode == SetCC ? SetCCBit : LeaveCCBit; |
| 840 } |
| 841 |
| 838 // Branch instructions | 842 // Branch instructions |
| 839 void b(int branch_offset, Condition cond = al); | 843 void b(int branch_offset, Condition cond = al); |
| 840 void b_thumb(int branch_offset, Condition cond); | 844 void b_thumb(int branch_offset, Condition cond); |
| 841 void bl(int branch_offset, Condition cond = al); | 845 void bl(int branch_offset, Condition cond = al); |
| 842 void blx(int branch_offset); // v5 and above | 846 void blx(int branch_offset); // v5 and above |
| 843 void blx(Register target, Condition cond = al); // v5 and above | 847 void blx(Register target, Condition cond = al); // v5 and above |
| 844 void bx(Register target, Condition cond = al); // v5 and above, plus v4t | 848 void bx(Register target, Condition cond = al); // v5 and above, plus v4t |
| 845 | 849 |
| 846 // Convenience branch instructions using labels | 850 // Convenience branch instructions using labels |
| 847 void b(Label* L, Condition cond = al) { | 851 void b(Label* L, Condition cond = al) { |
| 848 b(branch_offset(L, cond == al), cond); | 852 b(branch_offset(L, cond == al), cond); |
| 849 } | 853 } |
| 850 void b(Condition cond, Label* L) { b(branch_offset(L, cond == al), cond); } | 854 void b(Condition cond, Label* L) { b(branch_offset(L, cond == al), cond); } |
| 851 void bl(Label* L, Condition cond = al) { bl(branch_offset(L, false), cond); } | 855 void bl(Label* L, Condition cond = al) { bl(branch_offset(L, false), cond); } |
| 852 void bl(Condition cond, Label* L) { bl(branch_offset(L, false), cond); } | 856 void bl(Condition cond, Label* L) { bl(branch_offset(L, false), cond); } |
| 853 void blx(Label* L) { blx(branch_offset(L, false)); } // v5 and above | 857 void blx(Label* L) { blx(branch_offset(L, false)); } // v5 and above |
| 854 | 858 |
| 855 // Data-processing instructions | 859 // Data-processing instructions |
| 856 | 860 |
| 857 void and_(Register dst, Register src1, const Operand& src2, | 861 void and_(Register dst, Register src1, const Operand& src2, |
| 858 SBit s = LeaveCC, Condition cond = al); | 862 SBitMode smode = DontCareCC, Condition cond = al); |
| 859 void and_imm_t1(Register dst, Register src1, SBit s, Condition cond, | 863 void and_imm_t1(Register dst, Register src1, SBit s, Condition cond, |
| 860 uint32_t i, uint32_t imm3, uint32_t imm8); | 864 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 861 void and_reg_t2(Register dst, Register src1, const Operand& src2, | 865 void and_reg_t2(Register dst, Register src1, const Operand& src2, |
| 862 SBit s, Condition cond); | 866 SBit s, Condition cond); |
| 863 void and_thumb(Register dst, Register src1, const Operand& src2, | 867 void and_thumb(Register dst, Register src1, const Operand& src2, |
| 864 SBit s, Condition cond); | 868 SBitMode smode, Condition cond); |
| 865 | 869 |
| 866 void eor(Register dst, Register src1, const Operand& src2, | 870 void eor(Register dst, Register src1, const Operand& src2, |
| 867 SBit s = LeaveCC, Condition cond = al); | 871 SBitMode smode = DontCareCC, Condition cond = al); |
| 868 void eor_imm_t1(Register dst, Register src1, SBit s, Condition cond, | 872 void eor_imm_t1(Register dst, Register src1, SBit s, Condition cond, |
| 869 uint32_t i, uint32_t imm3, uint32_t imm8); | 873 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 870 void eor_reg_t2(Register dst, Register src1, const Operand& src2, | 874 void eor_reg_t2(Register dst, Register src1, const Operand& src2, |
| 871 SBit s, Condition cond); | 875 SBit s, Condition cond); |
| 872 void eor_thumb(Register dst, Register src1, const Operand& src2, | 876 void eor_thumb(Register dst, Register src1, const Operand& src2, |
| 873 SBit s, Condition cond); | 877 SBitMode smode, Condition cond); |
| 874 | 878 |
| 875 void sub(Register dst, Register src1, const Operand& src2, | 879 void sub(Register dst, Register src1, const Operand& src2, |
| 876 SBit s = LeaveCC, Condition cond = al); | 880 SBitMode smode = DontCareCC, Condition cond = al); |
| 877 void sub(Register dst, Register src1, Register src2, | 881 void sub(Register dst, Register src1, Register src2, |
| 878 SBit s = LeaveCC, Condition cond = al) { | 882 SBitMode smode = DontCareCC, Condition cond = al) { |
| 879 sub(dst, src1, Operand(src2), s, cond); | 883 sub(dst, src1, Operand(src2), smode, cond); |
| 880 } | 884 } |
| 881 void sub_imm_t3(Register dst, Register src1, SBit s, Condition cond, | 885 void sub_imm_t3(Register dst, Register src1, SBit s, Condition cond, |
| 882 uint32_t i, uint32_t imm3, uint32_t imm8); | 886 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 883 void sub_imm_t4(Register dst, Register src1, const Operand& src2, | 887 void sub_imm_t4(Register dst, Register src1, const Operand& src2, |
| 884 SBit s, Condition cond); | 888 SBit s, Condition cond); |
| 885 void sub_reg_t3(Register dst, Register src1, const Operand& src2, | 889 void sub_reg_t3(Register dst, Register src1, const Operand& src2, |
| 886 SBit s, Condition cond); | 890 SBit s, Condition cond); |
| 887 void sub_thumb(Register dst, Register src1, const Operand& src2, | 891 void sub_thumb(Register dst, Register src1, const Operand& src2, |
| 888 SBit s, Condition cond); | 892 SBitMode smode, Condition cond); |
| 889 | 893 |
| 890 void rsb(Register dst, Register src1, const Operand& src2, | 894 void rsb(Register dst, Register src1, const Operand& src2, |
| 891 SBit s = LeaveCC, Condition cond = al); | 895 SBitMode smode = DontCareCC, Condition cond = al); |
| 892 void rsb_imm_t2(Register dst, Register src1, SBit s, Condition cond, | 896 void rsb_imm_t2(Register dst, Register src1, SBit s, Condition cond, |
| 893 uint32_t i, uint32_t imm3, uint32_t imm8); | 897 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 894 void rsb_reg_t1(Register dst, Register src1, const Operand& src2, | 898 void rsb_reg_t1(Register dst, Register src1, const Operand& src2, |
| 895 SBit s, Condition cond); | 899 SBit s, Condition cond); |
| 896 void rsb_thumb(Register dst, Register src1, const Operand& src2, | 900 void rsb_thumb(Register dst, Register src1, const Operand& src2, |
| 897 SBit s, Condition cond); | 901 SBitMode smode, Condition cond); |
| 898 | 902 |
| 899 void add(Register dst, Register src1, const Operand& src2, | 903 void add(Register dst, Register src1, const Operand& src2, |
| 900 SBit s = LeaveCC, Condition cond = al); | 904 SBitMode smode = DontCareCC, Condition cond = al); |
| 901 void add(Register dst, Register src1, Register src2, | 905 void add(Register dst, Register src1, Register src2, |
| 902 SBit s = LeaveCC, Condition cond = al) { | 906 SBitMode smode = DontCareCC, Condition cond = al) { |
| 903 add(dst, src1, Operand(src2), s, cond); | 907 add(dst, src1, Operand(src2), smode, cond); |
| 904 } | 908 } |
| 905 void add_imm_t3(Register dst, Register src1, SBit s, Condition cond, | 909 void add_imm_t3(Register dst, Register src1, SBit s, Condition cond, |
| 906 uint32_t i, uint32_t imm3, uint32_t imm8); | 910 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 907 void add_imm_t4(Register dst, Register src1, const Operand& src2, | 911 void add_imm_t4(Register dst, Register src1, const Operand& src2, |
| 908 SBit s, Condition cond); | 912 SBit s, Condition cond); |
| 909 void add_reg_t3(Register dst, Register src1, const Operand& src2, | 913 void add_reg_t3(Register dst, Register src1, const Operand& src2, |
| 910 SBit s, Condition cond); | 914 SBit s, Condition cond); |
| 911 void add_thumb(Register dst, Register src1, const Operand& src2, | 915 void add_thumb(Register dst, Register src1, const Operand& src2, |
| 912 SBit s, Condition cond); | 916 SBitMode smode, Condition cond); |
| 913 | 917 |
| 914 void adc(Register dst, Register src1, const Operand& src2, | 918 void adc(Register dst, Register src1, const Operand& src2, |
| 915 SBit s = LeaveCC, Condition cond = al); | 919 SBitMode smode = DontCareCC, Condition cond = al); |
| 916 void adc_imm_t1(Register dst, Register src1, SBit s, Condition cond, | 920 void adc_imm_t1(Register dst, Register src1, SBit s, Condition cond, |
| 917 uint32_t i, uint32_t imm3, uint32_t imm8); | 921 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 918 void adc_reg_t2(Register dst, Register src1, const Operand& src2, | 922 void adc_reg_t2(Register dst, Register src1, const Operand& src2, |
| 919 SBit s, Condition cond); | 923 SBit s, Condition cond); |
| 920 void adc_thumb(Register dst, Register src1, const Operand& src2, | 924 void adc_thumb(Register dst, Register src1, const Operand& src2, |
| 921 SBit s, Condition cond); | 925 SBitMode smode, Condition cond); |
| 922 | 926 |
| 923 void sbc(Register dst, Register src1, const Operand& src2, | 927 void sbc(Register dst, Register src1, const Operand& src2, |
| 924 SBit s = LeaveCC, Condition cond = al); | 928 SBitMode smode = DontCareCC, Condition cond = al); |
| 925 void sbc_imm_t1(Register dst, Register src1, SBit s, Condition cond, | 929 void sbc_imm_t1(Register dst, Register src1, SBit s, Condition cond, |
| 926 uint32_t i, uint32_t imm3, uint32_t imm8); | 930 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 927 void sbc_reg_t2(Register dst, Register src1, const Operand& src2, | 931 void sbc_reg_t2(Register dst, Register src1, const Operand& src2, |
| 928 SBit s, Condition cond); | 932 SBit s, Condition cond); |
| 929 void sbc_thumb(Register dst, Register src1, const Operand& src2, | 933 void sbc_thumb(Register dst, Register src1, const Operand& src2, |
| 930 SBit s, Condition cond); | 934 SBitMode smode, Condition cond); |
| 935 |
| 931 | 936 |
| 932 void rsc(Register dst, Register src1, const Operand& src2, | 937 void rsc(Register dst, Register src1, const Operand& src2, |
| 933 SBit s = LeaveCC, Condition cond = al); | 938 SBitMode smode = DontCareCC, Condition cond = al); |
| 934 | 939 |
| 935 void tst(Register src1, const Operand& src2, Condition cond = al); | 940 void tst(Register src1, const Operand& src2, Condition cond = al); |
| 936 void tst(Register src1, Register src2, Condition cond = al) { | 941 void tst(Register src1, Register src2, Condition cond = al) { |
| 937 tst(src1, Operand(src2), cond); | 942 tst(src1, Operand(src2), cond); |
| 938 } | 943 } |
| 939 void tst_imm_t1(Register src1, Condition cond, | 944 void tst_imm_t1(Register src1, Condition cond, |
| 940 uint32_t i, uint32_t imm3, uint32_t imm8); | 945 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 941 void tst_reg_t2(Register src1, const Operand& src2, Condition cond); | 946 void tst_reg_t2(Register src1, const Operand& src2, Condition cond); |
| 942 void tst_thumb(Register src1, const Operand& src2, Condition cond); | 947 void tst_thumb(Register src1, const Operand& src2, Condition cond); |
| 943 | 948 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 957 void cmp_thumb(Register src1, const Operand& src2, Condition cond); | 962 void cmp_thumb(Register src1, const Operand& src2, Condition cond); |
| 958 void cmp_raw_immediate(Register src1, int raw_immediate, Condition cond = al); | 963 void cmp_raw_immediate(Register src1, int raw_immediate, Condition cond = al); |
| 959 | 964 |
| 960 void cmn(Register src1, const Operand& src2, Condition cond = al); | 965 void cmn(Register src1, const Operand& src2, Condition cond = al); |
| 961 void cmn_imm_t1(Register src1, Condition cond, | 966 void cmn_imm_t1(Register src1, Condition cond, |
| 962 uint32_t i, uint32_t imm3, uint32_t imm8); | 967 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 963 void cmn_reg_t2(Register src1, const Operand& src2, Condition cond); | 968 void cmn_reg_t2(Register src1, const Operand& src2, Condition cond); |
| 964 void cmn_thumb(Register src1, const Operand& src2, Condition cond); | 969 void cmn_thumb(Register src1, const Operand& src2, Condition cond); |
| 965 | 970 |
| 966 void orr(Register dst, Register src1, const Operand& src2, | 971 void orr(Register dst, Register src1, const Operand& src2, |
| 967 SBit s = LeaveCC, Condition cond = al); | 972 SBitMode smode = DontCareCC, Condition cond = al); |
| 968 void orr(Register dst, Register src1, Register src2, | 973 void orr(Register dst, Register src1, Register src2, |
| 969 SBit s = LeaveCC, Condition cond = al) { | 974 SBitMode smode = DontCareCC, Condition cond = al) { |
| 970 orr(dst, src1, Operand(src2), s, cond); | 975 orr(dst, src1, Operand(src2), smode, cond); |
| 971 } | 976 } |
| 977 |
| 972 void orr_imm_t1(Register dst, Register src1, SBit s, Condition cond, | 978 void orr_imm_t1(Register dst, Register src1, SBit s, Condition cond, |
| 973 uint32_t i, uint32_t imm3, uint32_t imm8); | 979 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 974 void orr_reg_t2(Register dst, Register src1, const Operand& src2, | 980 void orr_reg_t2(Register dst, Register src1, const Operand& src2, |
| 975 SBit s, Condition cond); | 981 SBit s, Condition cond); |
| 976 void orr_thumb(Register dst, Register src1, const Operand& src2, | 982 void orr_thumb(Register dst, Register src1, const Operand& src2, |
| 977 SBit s, Condition cond); | 983 SBitMode smode, Condition cond); |
| 978 | 984 |
| 979 void mov(Register dst, const Operand& src, | 985 void mov(Register dst, const Operand& src, |
| 980 SBit s = LeaveCC, Condition cond = al); | 986 SBitMode smode = DontCareCC, Condition cond = al); |
| 981 void mov(Register dst, Register src, SBit s = LeaveCC, Condition cond = al) { | 987 void mov(Register dst, Register src, |
| 982 mov(dst, Operand(src), s, cond); | 988 SBitMode smode = DontCareCC, Condition cond = al) { |
| 989 mov(dst, Operand(src), smode, cond); |
| 983 } | 990 } |
| 984 void mov_imm_t2(Register dst, SBit s, Condition cond, | 991 void mov_imm_t2(Register dst, SBit s, Condition cond, |
| 985 uint32_t i, uint32_t imm3, uint32_t imm8); | 992 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 986 void mov_imm_t3(Register dst, const Operand& src, | 993 void mov_imm_t3(Register dst, const Operand& src, |
| 987 SBit s, Condition cond); | 994 SBit s, Condition cond); |
| 988 void mov_reg_t3(Register dst, const Operand& src, | 995 void mov_reg_t3(Register dst, const Operand& src, |
| 989 SBit s, Condition cond); | 996 SBit s, Condition cond); |
| 990 void mov_thumb(Register dst, const Operand& src, | 997 void mov_thumb(Register dst, const Operand& src, |
| 991 SBit s, Condition cond); | 998 SBitMode smode, Condition cond); |
| 992 | 999 |
| 993 void lsl_imm_t2(Register dst, const Operand& src, SBit s, Condition cond); | 1000 void lsl_imm_t2(Register dst, const Operand& src, SBit s, Condition cond); |
| 994 void lsl_reg_t2(Register dst, const Operand& src, SBit s, Condition cond); | 1001 void lsl_reg_t2(Register dst, const Operand& src, SBit s, Condition cond); |
| 995 void lsl_thumb(Register dst, const Operand& src, SBit s, Condition cond); | 1002 void lsl_thumb(Register dst, const Operand& src, |
| 1003 SBitMode smode, Condition cond); |
| 996 void lsr_imm_t2(Register dst, const Operand& src, SBit s, Condition cond); | 1004 void lsr_imm_t2(Register dst, const Operand& src, SBit s, Condition cond); |
| 997 void lsr_reg_t2(Register dst, const Operand& src, SBit s, Condition cond); | 1005 void lsr_reg_t2(Register dst, const Operand& src, SBit s, Condition cond); |
| 998 void lsr_thumb(Register dst, const Operand& src, SBit s, Condition cond); | 1006 void lsr_thumb(Register dst, const Operand& src, |
| 1007 SBitMode smode, Condition cond); |
| 999 void asr_imm_t2(Register dst, const Operand& src, SBit s, Condition cond); | 1008 void asr_imm_t2(Register dst, const Operand& src, SBit s, Condition cond); |
| 1000 void asr_reg_t2(Register dst, const Operand& src, SBit s, Condition cond); | 1009 void asr_reg_t2(Register dst, const Operand& src, SBit s, Condition cond); |
| 1001 void asr_thumb(Register dst, const Operand& src, SBit s, Condition cond); | 1010 void asr_thumb(Register dst, const Operand& src, |
| 1011 SBitMode smode, Condition cond, bool is_in_it_block); |
| 1002 void ror_imm_t2(Register dst, const Operand& src, SBit s, Condition cond); | 1012 void ror_imm_t2(Register dst, const Operand& src, SBit s, Condition cond); |
| 1003 void ror_reg_t2(Register dst, const Operand& src, SBit s, Condition cond); | 1013 void ror_reg_t2(Register dst, const Operand& src, SBit s, Condition cond); |
| 1004 void ror_thumb(Register dst, const Operand& src, SBit s, Condition cond); | 1014 void ror_thumb(Register dst, const Operand& src, |
| 1015 SBitMode smode, Condition cond); |
| 1005 | 1016 |
| 1006 // ARMv7 instructions for loading a 32 bit immediate in two instructions. | 1017 // ARMv7 instructions for loading a 32 bit immediate in two instructions. |
| 1007 // This may actually emit a different mov instruction, but on an ARMv7 it | 1018 // This may actually emit a different mov instruction, but on an ARMv7 it |
| 1008 // is guaranteed to only emit one instruction. | 1019 // is guaranteed to only emit one instruction. |
| 1009 void movw(Register reg, uint32_t immediate, Condition cond = al); | 1020 void movw(Register reg, uint32_t immediate, Condition cond = al); |
| 1010 // The constant for movt should be in the range 0-0xffff. | 1021 // The constant for movt should be in the range 0-0xffff. |
| 1011 void movt(Register reg, uint32_t immediate, Condition cond = al); | 1022 void movt(Register reg, uint32_t immediate, Condition cond = al); |
| 1012 void movt_thumb(Register reg, uint32_t immediate, Condition cond = al); | 1023 void movt_thumb(Register reg, uint32_t immediate, Condition cond = al); |
| 1013 | |
| 1014 void bic(Register dst, Register src1, const Operand& src2, | 1024 void bic(Register dst, Register src1, const Operand& src2, |
| 1015 SBit s = LeaveCC, Condition cond = al); | 1025 SBitMode smode = DontCareCC, Condition cond = al); |
| 1016 void bic_imm_t1(Register dst, Register src1, SBit s, Condition cond, | 1026 void bic_imm_t1(Register dst, Register src1, SBit s, Condition cond, |
| 1017 uint32_t i, uint32_t imm3, uint32_t imm8); | 1027 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 1018 void bic_reg_t2(Register dst, Register src1, const Operand& src2, | 1028 void bic_reg_t2(Register dst, Register src1, const Operand& src2, |
| 1019 SBit s, Condition cond); | 1029 SBit s, Condition cond); |
| 1020 void bic_thumb(Register dst, Register src1, const Operand& src2, | 1030 void bic_thumb(Register dst, Register src1, const Operand& src2, |
| 1021 SBit s, Condition cond); | 1031 SBitMode smode, Condition cond); |
| 1022 | 1032 |
| 1023 void mvn(Register dst, const Operand& src, | 1033 void mvn(Register dst, const Operand& src, |
| 1024 SBit s = LeaveCC, Condition cond = al); | 1034 SBitMode smode = DontCareCC, Condition cond = al); |
| 1025 void mvn_imm_t1(Register dst, SBit s, Condition cond, | 1035 void mvn_imm_t1(Register dst, SBit s, Condition cond, |
| 1026 uint32_t i, uint32_t imm3, uint32_t imm8); | 1036 uint32_t i, uint32_t imm3, uint32_t imm8); |
| 1027 void mvn_reg_t2(Register dst, const Operand& src, | 1037 void mvn_reg_t2(Register dst, const Operand& src, |
| 1028 SBit s, Condition cond); | 1038 SBit s, Condition cond); |
| 1029 void mvn_thumb(Register dst, const Operand& src, | 1039 void mvn_thumb(Register dst, const Operand& src, |
| 1030 SBit s, Condition cond); | 1040 SBitMode smode, Condition cond); |
| 1031 | 1041 |
| 1032 // Multiply instructions | 1042 // Multiply instructions |
| 1033 | 1043 |
| 1034 void mla(Register dst, Register src1, Register src2, Register srcA, | 1044 void mla(Register dst, Register src1, Register src2, Register srcA, |
| 1035 SBit s = LeaveCC, Condition cond = al); | 1045 SBitMode smode = DontCareCC, Condition cond = al); |
| 1036 void mla_thumb(Register dst, Register src1, Register src2, Register srcA, | 1046 void mla_thumb(Register dst, Register src1, Register src2, Register srcA, |
| 1037 SBit s, Condition cond); | 1047 SBitMode smode, Condition cond); |
| 1038 | 1048 |
| 1039 void mls(Register dst, Register src1, Register src2, Register srcA, | 1049 void mls(Register dst, Register src1, Register src2, Register srcA, |
| 1040 Condition cond = al); | 1050 Condition cond = al); |
| 1041 void mls_thumb(Register dst, Register src1, Register src2, Register srcA, | 1051 void mls_thumb(Register dst, Register src1, Register src2, Register srcA, |
| 1042 Condition cond); | 1052 Condition cond); |
| 1043 | 1053 |
| 1044 void sdiv(Register dst, Register src1, Register src2, | 1054 void sdiv(Register dst, Register src1, Register src2, |
| 1045 Condition cond = al); | 1055 Condition cond = al); |
| 1046 void sdiv_thumb(Register dst, Register src1, Register src2, | 1056 void sdiv_thumb(Register dst, Register src1, Register src2, |
| 1047 Condition cond); | 1057 Condition cond); |
| 1048 | 1058 |
| 1049 void mul(Register dst, Register src1, Register src2, | 1059 void mul(Register dst, Register src1, Register src2, |
| 1050 SBit s = LeaveCC, Condition cond = al); | 1060 SBitMode smode = DontCareCC, Condition cond = al); |
| 1051 void mul_t2(Register dst, Register src1, Register src2, | 1061 void mul_t2(Register dst, Register src1, Register src2, |
| 1052 SBit s, Condition cond); | 1062 SBit s, Condition cond); |
| 1053 void mul_thumb(Register dst, Register src1, Register src2, | 1063 void mul_thumb(Register dst, Register src1, Register src2, |
| 1054 SBit s, Condition cond); | 1064 SBitMode smode, Condition cond); |
| 1055 | 1065 |
| 1056 void smlal(Register dstL, Register dstH, Register src1, Register src2, | 1066 void smlal(Register dstL, Register dstH, Register src1, Register src2, |
| 1057 SBit s = LeaveCC, Condition cond = al); | 1067 SBitMode smode = DontCareCC, Condition cond = al); |
| 1058 void smlal_thumb(Register dstL, Register dstH, Register src1, Register src2, | 1068 void smlal_thumb(Register dstL, Register dstH, Register src1, Register src2, |
| 1059 SBit s, Condition cond); | 1069 SBitMode smode, Condition cond); |
| 1060 | 1070 |
| 1061 void smull(Register dstL, Register dstH, Register src1, Register src2, | 1071 void smull(Register dstL, Register dstH, Register src1, Register src2, |
| 1062 SBit s = LeaveCC, Condition cond = al); | 1072 SBitMode smode = DontCareCC, Condition cond = al); |
| 1063 void smull_thumb(Register dstL, Register dstH, Register src1, Register src2, | 1073 void smull_thumb(Register dstL, Register dstH, Register src1, Register src2, |
| 1064 SBit s, Condition cond); | 1074 SBitMode smode, Condition cond); |
| 1065 | 1075 |
| 1066 void umlal(Register dstL, Register dstH, Register src1, Register src2, | 1076 void umlal(Register dstL, Register dstH, Register src1, Register src2, |
| 1067 SBit s = LeaveCC, Condition cond = al); | 1077 SBitMode smode = DontCareCC, Condition cond = al); |
| 1068 void umlal_thumb(Register dstL, Register dstH, Register src1, Register src2, | 1078 void umlal_thumb(Register dstL, Register dstH, Register src1, Register src2, |
| 1069 SBit s, Condition cond); | 1079 SBitMode smode, Condition cond); |
| 1070 | 1080 |
| 1071 void umull(Register dstL, Register dstH, Register src1, Register src2, | 1081 void umull(Register dstL, Register dstH, Register src1, Register src2, |
| 1072 SBit s = LeaveCC, Condition cond = al); | 1082 SBitMode smode = DontCareCC, Condition cond = al); |
| 1073 void umull_thumb(Register dstL, Register dstH, Register src1, Register src2, | 1083 void umull_thumb(Register dstL, Register dstH, Register src1, Register src2, |
| 1074 SBit s, Condition cond); | 1084 SBitMode smode, Condition cond); |
| 1075 | 1085 |
| 1076 // Miscellaneous arithmetic instructions | 1086 // Miscellaneous arithmetic instructions |
| 1077 | 1087 |
| 1078 void clz(Register dst, Register src, Condition cond = al); // v5 and above | 1088 void clz(Register dst, Register src, Condition cond = al); // v5 and above |
| 1079 | 1089 |
| 1080 // Saturating instructions. v6 and above. | 1090 // Saturating instructions. v6 and above. |
| 1081 | 1091 |
| 1082 // Unsigned saturate. | 1092 // Unsigned saturate. |
| 1083 // | 1093 // |
| 1084 // Saturate an optionally shifted signed value to an unsigned range. | 1094 // Saturate an optionally shifted signed value to an unsigned range. |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 | 1450 |
| 1441 void pop() { | 1451 void pop() { |
| 1442 add(sp, sp, Operand(kPointerSize)); | 1452 add(sp, sp, Operand(kPointerSize)); |
| 1443 } | 1453 } |
| 1444 | 1454 |
| 1445 // Jump unconditionally to given label. | 1455 // Jump unconditionally to given label. |
| 1446 void jmp(Label* L) { b(L, al); } | 1456 void jmp(Label* L) { b(L, al); } |
| 1447 | 1457 |
| 1448 void it_thumb(Condition cond, int num_instr, bool cond2 = false, | 1458 void it_thumb(Condition cond, int num_instr, bool cond2 = false, |
| 1449 bool cond3 = false, bool cond4 = false); | 1459 bool cond3 = false, bool cond4 = false); |
| 1450 inline void emit_it(Condition cond); | 1460 |
| 1461 inline bool emit_it(Condition cond); |
| 1462 inline bool it_block_smode_check(bool is_in_it_block, SBitMode smode); |
| 1463 |
| 1451 void ldr_pc_thumb(Register dst, const Operand& src); | 1464 void ldr_pc_thumb(Register dst, const Operand& src); |
| 1452 | 1465 |
| 1453 static bool use_immediate_embedded_pointer_loads( | 1466 static bool use_immediate_embedded_pointer_loads( |
| 1454 const Assembler* assembler) { | 1467 const Assembler* assembler) { |
| 1455 return CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) && | 1468 return CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) && |
| 1456 (assembler == NULL || !assembler->predictable_code_size()); | 1469 (assembler == NULL || !assembler->predictable_code_size()); |
| 1457 } | 1470 } |
| 1458 | 1471 |
| 1459 // Check the code size generated from label to here. | 1472 // Check the code size generated from label to here. |
| 1460 int SizeOfCodeGeneratedSince(Label* label) { | 1473 int SizeOfCodeGeneratedSince(Label* label) { |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1727 // Code emission | 1740 // Code emission |
| 1728 inline void CheckBuffer(); | 1741 inline void CheckBuffer(); |
| 1729 void GrowBuffer(); | 1742 void GrowBuffer(); |
| 1730 inline void emit(Instr x); | 1743 inline void emit(Instr x); |
| 1731 inline void emit16(Instr16 x, bool check_buffer = true); | 1744 inline void emit16(Instr16 x, bool check_buffer = true); |
| 1732 inline void emit32(Instr x); // proper half-word order for thumb | 1745 inline void emit32(Instr x); // proper half-word order for thumb |
| 1733 | 1746 |
| 1734 // 32-bit immediate values | 1747 // 32-bit immediate values |
| 1735 void move_32_bit_immediate(Condition cond, | 1748 void move_32_bit_immediate(Condition cond, |
| 1736 Register rd, | 1749 Register rd, |
| 1737 SBit s, | |
| 1738 const Operand& x); | 1750 const Operand& x); |
| 1739 void move_32_bit_immediate_thumb(Register rd, | 1751 void move_32_bit_immediate_thumb(Register rd, |
| 1740 SBit s, | 1752 SBitMode smode, |
| 1741 const Operand& x, | 1753 const Operand& x, |
| 1742 Condition cond = al); | 1754 Condition cond = al); |
| 1743 | 1755 |
| 1744 // Instruction generation | 1756 // Instruction generation |
| 1745 void addrmod1(Instr instr, Register rn, Register rd, const Operand& x); | 1757 void addrmod1(Instr instr, SBitMode smode, |
| 1758 Register rn, Register rd, const Operand& x); |
| 1746 void addrmod2(Instr instr, Register rd, const MemOperand& x); | 1759 void addrmod2(Instr instr, Register rd, const MemOperand& x); |
| 1747 void addrmod3(Instr instr, Register rd, const MemOperand& x); | 1760 void addrmod3(Instr instr, Register rd, const MemOperand& x); |
| 1748 void addrmod4(Instr instr, Register rn, RegList rl); | 1761 void addrmod4(Instr instr, Register rn, RegList rl); |
| 1749 void addrmod5(Instr instr, CRegister crd, const MemOperand& x); | 1762 void addrmod5(Instr instr, CRegister crd, const MemOperand& x); |
| 1750 | 1763 |
| 1751 Instr16 thumb16_mode1(ThumbMode1Opcode16 op); // A6.2.1 -> mode1 | 1764 Instr16 thumb16_mode1(ThumbMode1Opcode16 op); // A6.2.1 -> mode1 |
| 1752 Instr16 thumb16_mode2(ThumbMode2Opcode16 op); // A6.2.2 -> mode2 | 1765 Instr16 thumb16_mode2(ThumbMode2Opcode16 op); // A6.2.2 -> mode2 |
| 1753 Instr16 thumb16_mode3(ThumbMode3Opcode16 op); // A6.2.3 -> mode3 | 1766 Instr16 thumb16_mode3(ThumbMode3Opcode16 op); // A6.2.3 -> mode3 |
| 1754 | 1767 |
| 1755 // A6.2.4 -> mode4, opA 0101 -> _1 | 1768 // A6.2.4 -> mode4, opA 0101 -> _1 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 public: | 1896 public: |
| 1884 explicit EnsureSpace(Assembler* assembler) { | 1897 explicit EnsureSpace(Assembler* assembler) { |
| 1885 assembler->CheckBuffer(); | 1898 assembler->CheckBuffer(); |
| 1886 } | 1899 } |
| 1887 }; | 1900 }; |
| 1888 | 1901 |
| 1889 | 1902 |
| 1890 } } // namespace v8::internal | 1903 } } // namespace v8::internal |
| 1891 | 1904 |
| 1892 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1905 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |