Commit fe253235b2b3c78587c049b8504c2ef2ea7b5ced
1 parent
32407103
Wrap a few often used tests with unlikely(), by Aurelien Jarno.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3242 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
6 deletions
target-mips/translate.c
... | ... | @@ -733,19 +733,19 @@ static inline void generate_exception (DisasContext *ctx, int excp) |
733 | 733 | |
734 | 734 | static inline void check_cp0_enabled(DisasContext *ctx) |
735 | 735 | { |
736 | - if (!(ctx->hflags & MIPS_HFLAG_CP0)) | |
736 | + if (unlikely(!(ctx->hflags & MIPS_HFLAG_CP0))) | |
737 | 737 | generate_exception_err(ctx, EXCP_CpU, 1); |
738 | 738 | } |
739 | 739 | |
740 | 740 | static inline void check_cp1_enabled(DisasContext *ctx) |
741 | 741 | { |
742 | - if (!(ctx->hflags & MIPS_HFLAG_FPU)) | |
742 | + if (unlikely(!(ctx->hflags & MIPS_HFLAG_FPU))) | |
743 | 743 | generate_exception_err(ctx, EXCP_CpU, 1); |
744 | 744 | } |
745 | 745 | |
746 | 746 | static inline void check_cp1_64bitmode(DisasContext *ctx) |
747 | 747 | { |
748 | - if (!(ctx->hflags & MIPS_HFLAG_F64)) | |
748 | + if (unlikely(!(ctx->hflags & MIPS_HFLAG_F64))) | |
749 | 749 | generate_exception(ctx, EXCP_RI); |
750 | 750 | } |
751 | 751 | |
... | ... | @@ -762,7 +762,7 @@ static inline void check_cp1_64bitmode(DisasContext *ctx) |
762 | 762 | */ |
763 | 763 | void check_cp1_registers(DisasContext *ctx, int regs) |
764 | 764 | { |
765 | - if (!(ctx->hflags & MIPS_HFLAG_F64) && (regs & 1)) | |
765 | + if (unlikely(!(ctx->hflags & MIPS_HFLAG_F64) && (regs & 1))) | |
766 | 766 | generate_exception(ctx, EXCP_RI); |
767 | 767 | } |
768 | 768 | |
... | ... | @@ -778,7 +778,7 @@ static inline void check_insn(CPUState *env, DisasContext *ctx, int flags) |
778 | 778 | CPU is not MIPS MT capable. */ |
779 | 779 | static inline void check_mips_mt(CPUState *env, DisasContext *ctx) |
780 | 780 | { |
781 | - if (!(env->CP0_Config3 & (1 << CP0C3_MT))) | |
781 | + if (unlikely(!(env->CP0_Config3 & (1 << CP0C3_MT)))) | |
782 | 782 | generate_exception(ctx, EXCP_RI); |
783 | 783 | } |
784 | 784 | |
... | ... | @@ -786,7 +786,7 @@ static inline void check_mips_mt(CPUState *env, DisasContext *ctx) |
786 | 786 | instructions are not enabled. */ |
787 | 787 | static inline void check_mips_64(DisasContext *ctx) |
788 | 788 | { |
789 | - if (!(ctx->hflags & MIPS_HFLAG_64)) | |
789 | + if (unlikely(!(ctx->hflags & MIPS_HFLAG_64))) | |
790 | 790 | generate_exception(ctx, EXCP_RI); |
791 | 791 | } |
792 | 792 | ... | ... |