Revision | 2a080ce26682f35517b0e20f4ad10559e9270b5d (tree) |
---|---|
Time | 2015-10-23 02:51:49 |
Author | Chen Gang <gang.chen.5i5j@gmai...> |
Commiter | Richard Henderson |
target-tilegx: Implement prefetch instructions in pipe y2
Originally, tilegx qemu only implement prefetch instructions in pipe x1,
did not implement them in pipe y2.
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
@@ -2105,38 +2105,44 @@ static TileExcp decode_y2(DisasContext *dc, tilegx_bundle_bits bundle) | ||
2105 | 2105 | unsigned srcbdest = get_SrcBDest_Y2(bundle); |
2106 | 2106 | const char *mnemonic; |
2107 | 2107 | TCGMemOp memop; |
2108 | + bool prefetch_nofault = false; | |
2108 | 2109 | |
2109 | 2110 | switch (OEY2(opc, mode)) { |
2110 | 2111 | case OEY2(LD1S_OPCODE_Y2, MODE_OPCODE_YA2): |
2111 | 2112 | memop = MO_SB; |
2112 | - mnemonic = "ld1s"; | |
2113 | + mnemonic = "ld1s"; /* prefetch_l1_fault */ | |
2113 | 2114 | goto do_load; |
2114 | 2115 | case OEY2(LD1U_OPCODE_Y2, MODE_OPCODE_YA2): |
2115 | 2116 | memop = MO_UB; |
2116 | - mnemonic = "ld1u"; | |
2117 | + mnemonic = "ld1u"; /* prefetch, prefetch_l1 */ | |
2118 | + prefetch_nofault = (srcbdest == TILEGX_R_ZERO); | |
2117 | 2119 | goto do_load; |
2118 | 2120 | case OEY2(LD2S_OPCODE_Y2, MODE_OPCODE_YA2): |
2119 | 2121 | memop = MO_TESW; |
2120 | - mnemonic = "ld2s"; | |
2122 | + mnemonic = "ld2s"; /* prefetch_l2_fault */ | |
2121 | 2123 | goto do_load; |
2122 | 2124 | case OEY2(LD2U_OPCODE_Y2, MODE_OPCODE_YA2): |
2123 | 2125 | memop = MO_TEUW; |
2124 | - mnemonic = "ld2u"; | |
2126 | + mnemonic = "ld2u"; /* prefetch_l2 */ | |
2127 | + prefetch_nofault = (srcbdest == TILEGX_R_ZERO); | |
2125 | 2128 | goto do_load; |
2126 | 2129 | case OEY2(LD4S_OPCODE_Y2, MODE_OPCODE_YB2): |
2127 | 2130 | memop = MO_TESL; |
2128 | - mnemonic = "ld4s"; | |
2131 | + mnemonic = "ld4s"; /* prefetch_l3_fault */ | |
2129 | 2132 | goto do_load; |
2130 | 2133 | case OEY2(LD4U_OPCODE_Y2, MODE_OPCODE_YB2): |
2131 | 2134 | memop = MO_TEUL; |
2132 | - mnemonic = "ld4u"; | |
2135 | + mnemonic = "ld4u"; /* prefetch_l3 */ | |
2136 | + prefetch_nofault = (srcbdest == TILEGX_R_ZERO); | |
2133 | 2137 | goto do_load; |
2134 | 2138 | case OEY2(LD_OPCODE_Y2, MODE_OPCODE_YB2): |
2135 | 2139 | memop = MO_TEQ; |
2136 | 2140 | mnemonic = "ld"; |
2137 | 2141 | do_load: |
2138 | - tcg_gen_qemu_ld_tl(dest_gr(dc, srcbdest), load_gr(dc, srca), | |
2139 | - dc->mmuidx, memop); | |
2142 | + if (!prefetch_nofault) { | |
2143 | + tcg_gen_qemu_ld_tl(dest_gr(dc, srcbdest), load_gr(dc, srca), | |
2144 | + dc->mmuidx, memop); | |
2145 | + } | |
2140 | 2146 | qemu_log_mask(CPU_LOG_TB_IN_ASM, "%s %s, %s", mnemonic, |
2141 | 2147 | reg_names[srcbdest], reg_names[srca]); |
2142 | 2148 | return TILEGX_EXCP_NONE; |