diff options
author | Thiemo Seufer <ths@networkno.de> | 2008-02-18 14:32:49 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-04-28 12:14:23 -0400 |
commit | fb2a27e743cd565c25cd896911e494482a8b7251 (patch) | |
tree | 791190ead6211e829443185fb1d4b4109fbd9a34 /arch/mips/mm/uasm.c | |
parent | 064922a805ec7aadfafdd27aa6b4908d737c3c1d (diff) |
[MIPS] Reimplement clear_page/copy_page
Fold the SB-1 specific implementation of clear_page/copy_page in the
generic version, and rewrite that one in tlbex style. The immediate
benefits:
- It converts the compile-time workaround for SB-1 pass 1 prefetches
to a more efficient run-time check.
- It allows adjustment of loop unfolling, which helps to reduce the
number of redundant cdex cache ops.
- It fixes some esoteric cornercases (the cache line length calculations
can go wrong, and support for 64k pages without prefetch instructions
will overflow the addiu immediate).
- Somewhat better guesses of "good" prefetch values.
Signed-off-by: Thiemo Seufer <ths@networkno.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/uasm.c')
-rw-r--r-- | arch/mips/mm/uasm.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c index 1a6f7704cc89..1655aa69e133 100644 --- a/arch/mips/mm/uasm.c +++ b/arch/mips/mm/uasm.c | |||
@@ -58,13 +58,13 @@ enum opcode { | |||
58 | insn_invalid, | 58 | insn_invalid, |
59 | insn_addu, insn_addiu, insn_and, insn_andi, insn_beq, | 59 | insn_addu, insn_addiu, insn_and, insn_andi, insn_beq, |
60 | insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, | 60 | insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, |
61 | insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0, | 61 | insn_bne, insn_cache, insn_daddu, insn_daddiu, insn_dmfc0, |
62 | insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, | 62 | insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, |
63 | insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld, | 63 | insn_dsrl32, insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, |
64 | insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0, | 64 | insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, |
65 | insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, | 65 | insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, |
66 | insn_sra, insn_srl, insn_subu, insn_sw, insn_tlbp, insn_tlbwi, | 66 | insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw, |
67 | insn_tlbwr, insn_xor, insn_xori | 67 | insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori |
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct insn { | 70 | struct insn { |
@@ -94,6 +94,7 @@ static struct insn insn_table[] __cpuinitdata = { | |||
94 | { insn_bltz, M(bcond_op, 0, bltz_op, 0, 0, 0), RS | BIMM }, | 94 | { insn_bltz, M(bcond_op, 0, bltz_op, 0, 0, 0), RS | BIMM }, |
95 | { insn_bltzl, M(bcond_op, 0, bltzl_op, 0, 0, 0), RS | BIMM }, | 95 | { insn_bltzl, M(bcond_op, 0, bltzl_op, 0, 0, 0), RS | BIMM }, |
96 | { insn_bne, M(bne_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, | 96 | { insn_bne, M(bne_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, |
97 | { insn_cache, M(cache_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | ||
97 | { insn_daddiu, M(daddiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 98 | { insn_daddiu, M(daddiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
98 | { insn_daddu, M(spec_op, 0, 0, 0, 0, daddu_op), RS | RT | RD }, | 99 | { insn_daddu, M(spec_op, 0, 0, 0, 0, daddu_op), RS | RT | RD }, |
99 | { insn_dmfc0, M(cop0_op, dmfc_op, 0, 0, 0, 0), RT | RD | SET}, | 100 | { insn_dmfc0, M(cop0_op, dmfc_op, 0, 0, 0, 0), RT | RD | SET}, |
@@ -116,6 +117,7 @@ static struct insn insn_table[] __cpuinitdata = { | |||
116 | { insn_mfc0, M(cop0_op, mfc_op, 0, 0, 0, 0), RT | RD | SET}, | 117 | { insn_mfc0, M(cop0_op, mfc_op, 0, 0, 0, 0), RT | RD | SET}, |
117 | { insn_mtc0, M(cop0_op, mtc_op, 0, 0, 0, 0), RT | RD | SET}, | 118 | { insn_mtc0, M(cop0_op, mtc_op, 0, 0, 0, 0), RT | RD | SET}, |
118 | { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, | 119 | { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, |
120 | { insn_pref, M(pref_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | ||
119 | { insn_rfe, M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0 }, | 121 | { insn_rfe, M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0 }, |
120 | { insn_sc, M(sc_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 122 | { insn_sc, M(sc_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
121 | { insn_scd, M(scd_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 123 | { insn_scd, M(scd_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
@@ -337,6 +339,7 @@ I_u1s2(_bgezl) | |||
337 | I_u1s2(_bltz) | 339 | I_u1s2(_bltz) |
338 | I_u1s2(_bltzl) | 340 | I_u1s2(_bltzl) |
339 | I_u1u2s3(_bne) | 341 | I_u1u2s3(_bne) |
342 | I_u2s3u1(_cache) | ||
340 | I_u1u2u3(_dmfc0) | 343 | I_u1u2u3(_dmfc0) |
341 | I_u1u2u3(_dmtc0) | 344 | I_u1u2u3(_dmtc0) |
342 | I_u2u1s3(_daddiu) | 345 | I_u2u1s3(_daddiu) |
@@ -359,6 +362,7 @@ I_u2s3u1(_lw) | |||
359 | I_u1u2u3(_mfc0) | 362 | I_u1u2u3(_mfc0) |
360 | I_u1u2u3(_mtc0) | 363 | I_u1u2u3(_mtc0) |
361 | I_u2u1u3(_ori) | 364 | I_u2u1u3(_ori) |
365 | I_u2s3u1(_pref) | ||
362 | I_0(_rfe) | 366 | I_0(_rfe) |
363 | I_u2s3u1(_sc) | 367 | I_u2s3u1(_sc) |
364 | I_u2s3u1(_scd) | 368 | I_u2s3u1(_scd) |
@@ -555,6 +559,14 @@ uasm_il_beqzl(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid) | |||
555 | } | 559 | } |
556 | 560 | ||
557 | void __cpuinit | 561 | void __cpuinit |
562 | uasm_il_bne(u32 **p, struct uasm_reloc **r, unsigned int reg1, | ||
563 | unsigned int reg2, int lid) | ||
564 | { | ||
565 | uasm_r_mips_pc16(r, *p, lid); | ||
566 | uasm_i_bne(p, reg1, reg2, 0); | ||
567 | } | ||
568 | |||
569 | void __cpuinit | ||
558 | uasm_il_bnez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid) | 570 | uasm_il_bnez(u32 **p, struct uasm_reloc **r, unsigned int reg, int lid) |
559 | { | 571 | { |
560 | uasm_r_mips_pc16(r, *p, lid); | 572 | uasm_r_mips_pc16(r, *p, lid); |