3 * Optimized version of the standard copy_page() function
6 * in0: address of target page
7 * in1: address of source page
11 * Copyright (C) 1999, 2001 Hewlett-Packard Co
12 * Stephane Eranian <eranian@hpl.hp.com>
13 * David Mosberger <davidm@hpl.hp.com>
15 * 4/06/01 davidm Tuned to make it perform well both for cached and uncached copies.
17 #include <asm/asmmacro.h>
21 #define EPI p[PIPE_DEPTH-1]
35 #define Nrot ((8*PIPE_DEPTH+7)&~7)
37 GLOBAL_ENTRY(copy_page)
39 .save ar.pfs, saved_pfs
40 alloc saved_pfs=ar.pfs,3,Nrot-3,0,Nrot
42 .rotr t1[PIPE_DEPTH], t2[PIPE_DEPTH], t3[PIPE_DEPTH], t4[PIPE_DEPTH], \
43 t5[PIPE_DEPTH], t6[PIPE_DEPTH], t7[PIPE_DEPTH], t8[PIPE_DEPTH]
50 mov lcount=PAGE_SIZE/64-1
59 mov tgt_last = PAGE_SIZE
66 add tgt_last = tgt_last, in0
69 (p[0]) ld8 t1[0]=[src1],16
70 (EPI) st8 [tgt1]=t1[PIPE_DEPTH-1],16
71 (p[0]) ld8 t2[0]=[src2],16
72 (EPI) st8 [tgt2]=t2[PIPE_DEPTH-1],16
73 cmp.ltu p6,p0 = tgtf, tgt_last
75 (p[0]) ld8 t3[0]=[src1],16
76 (EPI) st8 [tgt1]=t3[PIPE_DEPTH-1],16
77 (p[0]) ld8 t4[0]=[src2],16
78 (EPI) st8 [tgt2]=t4[PIPE_DEPTH-1],16
80 (p[0]) ld8 t5[0]=[src1],16
81 (EPI) st8 [tgt1]=t5[PIPE_DEPTH-1],16
82 (p[0]) ld8 t6[0]=[src2],16
83 (EPI) st8 [tgt2]=t6[PIPE_DEPTH-1],16
85 (p[0]) ld8 t7[0]=[src1],16
86 (EPI) st8 [tgt1]=t7[PIPE_DEPTH-1],16
87 (p[0]) ld8 t8[0]=[src2],16
88 (EPI) st8 [tgt2]=t8[PIPE_DEPTH-1],16
90 (p6) lfetch [srcf], 64
91 (p6) lfetch [tgtf], 64
94 mov pr=saved_pr,0xffffffffffff0000 // restore predicates