Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * arch/sparc64/lib/xor.S
0004  *
0005  * High speed xor_block operation for RAID4/5 utilizing the
0006  * UltraSparc Visual Instruction Set and Niagara store-init/twin-load.
0007  *
0008  * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz)
0009  * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
0010  */
0011 
0012 #include <linux/linkage.h>
0013 #include <asm/visasm.h>
0014 #include <asm/asi.h>
0015 #include <asm/dcu.h>
0016 #include <asm/spitfire.h>
0017 #include <asm/export.h>
0018 
0019 /*
0020  *  Requirements:
0021  *  !(((long)dest | (long)sourceN) & (64 - 1)) &&
0022  *  !(len & 127) && len >= 256
0023  */
0024     .text
0025 
0026     /* VIS versions. */
0027 ENTRY(xor_vis_2)
0028     rd  %fprs, %o5
0029     andcc   %o5, FPRS_FEF|FPRS_DU, %g0
0030     be,pt   %icc, 0f
0031      sethi  %hi(VISenter), %g1
0032     jmpl    %g1 + %lo(VISenter), %g7
0033      add    %g7, 8, %g7
0034 0:  wr  %g0, FPRS_FEF, %fprs
0035     rd  %asi, %g1
0036     wr  %g0, ASI_BLK_P, %asi
0037     membar  #LoadStore|#StoreLoad|#StoreStore
0038     sub %o0, 128, %o0
0039     ldda    [%o1] %asi, %f0
0040     ldda    [%o2] %asi, %f16
0041 
0042 2:  ldda    [%o1 + 64] %asi, %f32
0043     fxor    %f0, %f16, %f16
0044     fxor    %f2, %f18, %f18
0045     fxor    %f4, %f20, %f20
0046     fxor    %f6, %f22, %f22
0047     fxor    %f8, %f24, %f24
0048     fxor    %f10, %f26, %f26
0049     fxor    %f12, %f28, %f28
0050     fxor    %f14, %f30, %f30
0051     stda    %f16, [%o1] %asi
0052     ldda    [%o2 + 64] %asi, %f48
0053     ldda    [%o1 + 128] %asi, %f0
0054     fxor    %f32, %f48, %f48
0055     fxor    %f34, %f50, %f50
0056     add %o1, 128, %o1
0057     fxor    %f36, %f52, %f52
0058     add %o2, 128, %o2
0059     fxor    %f38, %f54, %f54
0060     subcc   %o0, 128, %o0
0061     fxor    %f40, %f56, %f56
0062     fxor    %f42, %f58, %f58
0063     fxor    %f44, %f60, %f60
0064     fxor    %f46, %f62, %f62
0065     stda    %f48, [%o1 - 64] %asi
0066     bne,pt  %xcc, 2b
0067      ldda   [%o2] %asi, %f16
0068 
0069     ldda    [%o1 + 64] %asi, %f32
0070     fxor    %f0, %f16, %f16
0071     fxor    %f2, %f18, %f18
0072     fxor    %f4, %f20, %f20
0073     fxor    %f6, %f22, %f22
0074     fxor    %f8, %f24, %f24
0075     fxor    %f10, %f26, %f26
0076     fxor    %f12, %f28, %f28
0077     fxor    %f14, %f30, %f30
0078     stda    %f16, [%o1] %asi
0079     ldda    [%o2 + 64] %asi, %f48
0080     membar  #Sync
0081     fxor    %f32, %f48, %f48
0082     fxor    %f34, %f50, %f50
0083     fxor    %f36, %f52, %f52
0084     fxor    %f38, %f54, %f54
0085     fxor    %f40, %f56, %f56
0086     fxor    %f42, %f58, %f58
0087     fxor    %f44, %f60, %f60
0088     fxor    %f46, %f62, %f62
0089     stda    %f48, [%o1 + 64] %asi
0090     membar  #Sync|#StoreStore|#StoreLoad
0091     wr  %g1, %g0, %asi
0092     retl
0093       wr    %g0, 0, %fprs
0094 ENDPROC(xor_vis_2)
0095 EXPORT_SYMBOL(xor_vis_2)
0096 
0097 ENTRY(xor_vis_3)
0098     rd  %fprs, %o5
0099     andcc   %o5, FPRS_FEF|FPRS_DU, %g0
0100     be,pt   %icc, 0f
0101      sethi  %hi(VISenter), %g1
0102     jmpl    %g1 + %lo(VISenter), %g7
0103      add    %g7, 8, %g7
0104 0:  wr  %g0, FPRS_FEF, %fprs
0105     rd  %asi, %g1
0106     wr  %g0, ASI_BLK_P, %asi
0107     membar  #LoadStore|#StoreLoad|#StoreStore
0108     sub %o0, 64, %o0
0109     ldda    [%o1] %asi, %f0
0110     ldda    [%o2] %asi, %f16
0111 
0112 3:  ldda    [%o3] %asi, %f32
0113     fxor    %f0, %f16, %f48
0114     fxor    %f2, %f18, %f50
0115     add %o1, 64, %o1
0116     fxor    %f4, %f20, %f52
0117     fxor    %f6, %f22, %f54
0118     add %o2, 64, %o2
0119     fxor    %f8, %f24, %f56
0120     fxor    %f10, %f26, %f58
0121     fxor    %f12, %f28, %f60
0122     fxor    %f14, %f30, %f62
0123     ldda    [%o1] %asi, %f0
0124     fxor    %f48, %f32, %f48
0125     fxor    %f50, %f34, %f50
0126     fxor    %f52, %f36, %f52
0127     fxor    %f54, %f38, %f54
0128     add %o3, 64, %o3
0129     fxor    %f56, %f40, %f56
0130     fxor    %f58, %f42, %f58
0131     subcc   %o0, 64, %o0
0132     fxor    %f60, %f44, %f60
0133     fxor    %f62, %f46, %f62
0134     stda    %f48, [%o1 - 64] %asi
0135     bne,pt  %xcc, 3b
0136      ldda   [%o2] %asi, %f16
0137 
0138     ldda    [%o3] %asi, %f32
0139     fxor    %f0, %f16, %f48
0140     fxor    %f2, %f18, %f50
0141     fxor    %f4, %f20, %f52
0142     fxor    %f6, %f22, %f54
0143     fxor    %f8, %f24, %f56
0144     fxor    %f10, %f26, %f58
0145     fxor    %f12, %f28, %f60
0146     fxor    %f14, %f30, %f62
0147     membar  #Sync
0148     fxor    %f48, %f32, %f48
0149     fxor    %f50, %f34, %f50
0150     fxor    %f52, %f36, %f52
0151     fxor    %f54, %f38, %f54
0152     fxor    %f56, %f40, %f56
0153     fxor    %f58, %f42, %f58
0154     fxor    %f60, %f44, %f60
0155     fxor    %f62, %f46, %f62
0156     stda    %f48, [%o1] %asi
0157     membar  #Sync|#StoreStore|#StoreLoad
0158     wr  %g1, %g0, %asi
0159     retl
0160      wr %g0, 0, %fprs
0161 ENDPROC(xor_vis_3)
0162 EXPORT_SYMBOL(xor_vis_3)
0163 
0164 ENTRY(xor_vis_4)
0165     rd  %fprs, %o5
0166     andcc   %o5, FPRS_FEF|FPRS_DU, %g0
0167     be,pt   %icc, 0f
0168      sethi  %hi(VISenter), %g1
0169     jmpl    %g1 + %lo(VISenter), %g7
0170      add    %g7, 8, %g7
0171 0:  wr  %g0, FPRS_FEF, %fprs
0172     rd  %asi, %g1
0173     wr  %g0, ASI_BLK_P, %asi
0174     membar  #LoadStore|#StoreLoad|#StoreStore
0175     sub %o0, 64, %o0
0176     ldda    [%o1] %asi, %f0
0177     ldda    [%o2] %asi, %f16
0178 
0179 4:  ldda    [%o3] %asi, %f32
0180     fxor    %f0, %f16, %f16
0181     fxor    %f2, %f18, %f18
0182     add %o1, 64, %o1
0183     fxor    %f4, %f20, %f20
0184     fxor    %f6, %f22, %f22
0185     add %o2, 64, %o2
0186     fxor    %f8, %f24, %f24
0187     fxor    %f10, %f26, %f26
0188     fxor    %f12, %f28, %f28
0189     fxor    %f14, %f30, %f30
0190     ldda    [%o4] %asi, %f48
0191     fxor    %f16, %f32, %f32
0192     fxor    %f18, %f34, %f34
0193     fxor    %f20, %f36, %f36
0194     fxor    %f22, %f38, %f38
0195     add %o3, 64, %o3
0196     fxor    %f24, %f40, %f40
0197     fxor    %f26, %f42, %f42
0198     fxor    %f28, %f44, %f44
0199     fxor    %f30, %f46, %f46
0200     ldda    [%o1] %asi, %f0
0201     fxor    %f32, %f48, %f48
0202     fxor    %f34, %f50, %f50
0203     fxor    %f36, %f52, %f52
0204     add %o4, 64, %o4
0205     fxor    %f38, %f54, %f54
0206     fxor    %f40, %f56, %f56
0207     fxor    %f42, %f58, %f58
0208     subcc   %o0, 64, %o0
0209     fxor    %f44, %f60, %f60
0210     fxor    %f46, %f62, %f62
0211     stda    %f48, [%o1 - 64] %asi
0212     bne,pt  %xcc, 4b
0213      ldda   [%o2] %asi, %f16
0214 
0215     ldda    [%o3] %asi, %f32
0216     fxor    %f0, %f16, %f16
0217     fxor    %f2, %f18, %f18
0218     fxor    %f4, %f20, %f20
0219     fxor    %f6, %f22, %f22
0220     fxor    %f8, %f24, %f24
0221     fxor    %f10, %f26, %f26
0222     fxor    %f12, %f28, %f28
0223     fxor    %f14, %f30, %f30
0224     ldda    [%o4] %asi, %f48
0225     fxor    %f16, %f32, %f32
0226     fxor    %f18, %f34, %f34
0227     fxor    %f20, %f36, %f36
0228     fxor    %f22, %f38, %f38
0229     fxor    %f24, %f40, %f40
0230     fxor    %f26, %f42, %f42
0231     fxor    %f28, %f44, %f44
0232     fxor    %f30, %f46, %f46
0233     membar  #Sync
0234     fxor    %f32, %f48, %f48
0235     fxor    %f34, %f50, %f50
0236     fxor    %f36, %f52, %f52
0237     fxor    %f38, %f54, %f54
0238     fxor    %f40, %f56, %f56
0239     fxor    %f42, %f58, %f58
0240     fxor    %f44, %f60, %f60
0241     fxor    %f46, %f62, %f62
0242     stda    %f48, [%o1] %asi
0243     membar  #Sync|#StoreStore|#StoreLoad
0244     wr  %g1, %g0, %asi
0245     retl
0246      wr %g0, 0, %fprs
0247 ENDPROC(xor_vis_4)
0248 EXPORT_SYMBOL(xor_vis_4)
0249 
0250 ENTRY(xor_vis_5)
0251     save    %sp, -192, %sp
0252     rd  %fprs, %o5
0253     andcc   %o5, FPRS_FEF|FPRS_DU, %g0
0254     be,pt   %icc, 0f
0255      sethi  %hi(VISenter), %g1
0256     jmpl    %g1 + %lo(VISenter), %g7
0257      add    %g7, 8, %g7
0258 0:  wr  %g0, FPRS_FEF, %fprs
0259     rd  %asi, %g1
0260     wr  %g0, ASI_BLK_P, %asi
0261     membar  #LoadStore|#StoreLoad|#StoreStore
0262     sub %i0, 64, %i0
0263     ldda    [%i1] %asi, %f0
0264     ldda    [%i2] %asi, %f16
0265 
0266 5:  ldda    [%i3] %asi, %f32
0267     fxor    %f0, %f16, %f48
0268     fxor    %f2, %f18, %f50
0269     add %i1, 64, %i1
0270     fxor    %f4, %f20, %f52
0271     fxor    %f6, %f22, %f54
0272     add %i2, 64, %i2
0273     fxor    %f8, %f24, %f56
0274     fxor    %f10, %f26, %f58
0275     fxor    %f12, %f28, %f60
0276     fxor    %f14, %f30, %f62
0277     ldda    [%i4] %asi, %f16
0278     fxor    %f48, %f32, %f48
0279     fxor    %f50, %f34, %f50
0280     fxor    %f52, %f36, %f52
0281     fxor    %f54, %f38, %f54
0282     add %i3, 64, %i3
0283     fxor    %f56, %f40, %f56
0284     fxor    %f58, %f42, %f58
0285     fxor    %f60, %f44, %f60
0286     fxor    %f62, %f46, %f62
0287     ldda    [%i5] %asi, %f32
0288     fxor    %f48, %f16, %f48
0289     fxor    %f50, %f18, %f50
0290     add %i4, 64, %i4
0291     fxor    %f52, %f20, %f52
0292     fxor    %f54, %f22, %f54
0293     add %i5, 64, %i5
0294     fxor    %f56, %f24, %f56
0295     fxor    %f58, %f26, %f58
0296     fxor    %f60, %f28, %f60
0297     fxor    %f62, %f30, %f62
0298     ldda    [%i1] %asi, %f0
0299     fxor    %f48, %f32, %f48
0300     fxor    %f50, %f34, %f50
0301     fxor    %f52, %f36, %f52
0302     fxor    %f54, %f38, %f54
0303     fxor    %f56, %f40, %f56
0304     fxor    %f58, %f42, %f58
0305     subcc   %i0, 64, %i0
0306     fxor    %f60, %f44, %f60
0307     fxor    %f62, %f46, %f62
0308     stda    %f48, [%i1 - 64] %asi
0309     bne,pt  %xcc, 5b
0310      ldda   [%i2] %asi, %f16
0311 
0312     ldda    [%i3] %asi, %f32
0313     fxor    %f0, %f16, %f48
0314     fxor    %f2, %f18, %f50
0315     fxor    %f4, %f20, %f52
0316     fxor    %f6, %f22, %f54
0317     fxor    %f8, %f24, %f56
0318     fxor    %f10, %f26, %f58
0319     fxor    %f12, %f28, %f60
0320     fxor    %f14, %f30, %f62
0321     ldda    [%i4] %asi, %f16
0322     fxor    %f48, %f32, %f48
0323     fxor    %f50, %f34, %f50
0324     fxor    %f52, %f36, %f52
0325     fxor    %f54, %f38, %f54
0326     fxor    %f56, %f40, %f56
0327     fxor    %f58, %f42, %f58
0328     fxor    %f60, %f44, %f60
0329     fxor    %f62, %f46, %f62
0330     ldda    [%i5] %asi, %f32
0331     fxor    %f48, %f16, %f48
0332     fxor    %f50, %f18, %f50
0333     fxor    %f52, %f20, %f52
0334     fxor    %f54, %f22, %f54
0335     fxor    %f56, %f24, %f56
0336     fxor    %f58, %f26, %f58
0337     fxor    %f60, %f28, %f60
0338     fxor    %f62, %f30, %f62
0339     membar  #Sync
0340     fxor    %f48, %f32, %f48
0341     fxor    %f50, %f34, %f50
0342     fxor    %f52, %f36, %f52
0343     fxor    %f54, %f38, %f54
0344     fxor    %f56, %f40, %f56
0345     fxor    %f58, %f42, %f58
0346     fxor    %f60, %f44, %f60
0347     fxor    %f62, %f46, %f62
0348     stda    %f48, [%i1] %asi
0349     membar  #Sync|#StoreStore|#StoreLoad
0350     wr  %g1, %g0, %asi
0351     wr  %g0, 0, %fprs
0352     ret
0353      restore
0354 ENDPROC(xor_vis_5)
0355 EXPORT_SYMBOL(xor_vis_5)
0356 
0357     /* Niagara versions. */
0358 ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */
0359     save        %sp, -192, %sp
0360     prefetch    [%i1], #n_writes
0361     prefetch    [%i2], #one_read
0362     rd      %asi, %g7
0363     wr      %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
0364     srlx        %i0, 6, %g1
0365     mov     %i1, %i0
0366     mov     %i2, %i1
0367 1:  ldda        [%i1 + 0x00] %asi, %i2  /* %i2/%i3 = src  + 0x00 */
0368     ldda        [%i1 + 0x10] %asi, %i4  /* %i4/%i5 = src  + 0x10 */
0369     ldda        [%i1 + 0x20] %asi, %g2  /* %g2/%g3 = src  + 0x20 */
0370     ldda        [%i1 + 0x30] %asi, %l0  /* %l0/%l1 = src  + 0x30 */
0371     prefetch    [%i1 + 0x40], #one_read
0372     ldda        [%i0 + 0x00] %asi, %o0  /* %o0/%o1 = dest + 0x00 */
0373     ldda        [%i0 + 0x10] %asi, %o2  /* %o2/%o3 = dest + 0x10 */
0374     ldda        [%i0 + 0x20] %asi, %o4  /* %o4/%o5 = dest + 0x20 */
0375     ldda        [%i0 + 0x30] %asi, %l2  /* %l2/%l3 = dest + 0x30 */
0376     prefetch    [%i0 + 0x40], #n_writes
0377     xor     %o0, %i2, %o0
0378     xor     %o1, %i3, %o1
0379     stxa        %o0, [%i0 + 0x00] %asi
0380     stxa        %o1, [%i0 + 0x08] %asi
0381     xor     %o2, %i4, %o2
0382     xor     %o3, %i5, %o3
0383     stxa        %o2, [%i0 + 0x10] %asi
0384     stxa        %o3, [%i0 + 0x18] %asi
0385     xor     %o4, %g2, %o4
0386     xor     %o5, %g3, %o5
0387     stxa        %o4, [%i0 + 0x20] %asi
0388     stxa        %o5, [%i0 + 0x28] %asi
0389     xor     %l2, %l0, %l2
0390     xor     %l3, %l1, %l3
0391     stxa        %l2, [%i0 + 0x30] %asi
0392     stxa        %l3, [%i0 + 0x38] %asi
0393     add     %i0, 0x40, %i0
0394     subcc       %g1, 1, %g1
0395     bne,pt      %xcc, 1b
0396      add        %i1, 0x40, %i1
0397     membar      #Sync
0398     wr      %g7, 0x0, %asi
0399     ret
0400      restore
0401 ENDPROC(xor_niagara_2)
0402 EXPORT_SYMBOL(xor_niagara_2)
0403 
0404 ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */
0405     save        %sp, -192, %sp
0406     prefetch    [%i1], #n_writes
0407     prefetch    [%i2], #one_read
0408     prefetch    [%i3], #one_read
0409     rd      %asi, %g7
0410     wr      %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
0411     srlx        %i0, 6, %g1
0412     mov     %i1, %i0
0413     mov     %i2, %i1
0414     mov     %i3, %l7
0415 1:  ldda        [%i1 + 0x00] %asi, %i2  /* %i2/%i3 = src1 + 0x00 */
0416     ldda        [%i1 + 0x10] %asi, %i4  /* %i4/%i5 = src1 + 0x10 */
0417     ldda        [%l7 + 0x00] %asi, %g2  /* %g2/%g3 = src2 + 0x00 */
0418     ldda        [%l7 + 0x10] %asi, %l0  /* %l0/%l1 = src2 + 0x10 */
0419     ldda        [%i0 + 0x00] %asi, %o0  /* %o0/%o1 = dest + 0x00 */
0420     ldda        [%i0 + 0x10] %asi, %o2  /* %o2/%o3 = dest + 0x10 */
0421     xor     %g2, %i2, %g2
0422     xor     %g3, %i3, %g3
0423     xor     %o0, %g2, %o0
0424     xor     %o1, %g3, %o1
0425     stxa        %o0, [%i0 + 0x00] %asi
0426     stxa        %o1, [%i0 + 0x08] %asi
0427     ldda        [%i1 + 0x20] %asi, %i2  /* %i2/%i3 = src1 + 0x20 */
0428     ldda        [%l7 + 0x20] %asi, %g2  /* %g2/%g3 = src2 + 0x20 */
0429     ldda        [%i0 + 0x20] %asi, %o0  /* %o0/%o1 = dest + 0x20 */
0430     xor     %l0, %i4, %l0
0431     xor     %l1, %i5, %l1
0432     xor     %o2, %l0, %o2
0433     xor     %o3, %l1, %o3
0434     stxa        %o2, [%i0 + 0x10] %asi
0435     stxa        %o3, [%i0 + 0x18] %asi
0436     ldda        [%i1 + 0x30] %asi, %i4  /* %i4/%i5 = src1 + 0x30 */
0437     ldda        [%l7 + 0x30] %asi, %l0  /* %l0/%l1 = src2 + 0x30 */
0438     ldda        [%i0 + 0x30] %asi, %o2  /* %o2/%o3 = dest + 0x30 */
0439     prefetch    [%i1 + 0x40], #one_read
0440     prefetch    [%l7 + 0x40], #one_read
0441     prefetch    [%i0 + 0x40], #n_writes
0442     xor     %g2, %i2, %g2
0443     xor     %g3, %i3, %g3
0444     xor     %o0, %g2, %o0
0445     xor     %o1, %g3, %o1
0446     stxa        %o0, [%i0 + 0x20] %asi
0447     stxa        %o1, [%i0 + 0x28] %asi
0448     xor     %l0, %i4, %l0
0449     xor     %l1, %i5, %l1
0450     xor     %o2, %l0, %o2
0451     xor     %o3, %l1, %o3
0452     stxa        %o2, [%i0 + 0x30] %asi
0453     stxa        %o3, [%i0 + 0x38] %asi
0454     add     %i0, 0x40, %i0
0455     add     %i1, 0x40, %i1
0456     subcc       %g1, 1, %g1
0457     bne,pt      %xcc, 1b
0458      add        %l7, 0x40, %l7
0459     membar      #Sync
0460     wr      %g7, 0x0, %asi
0461     ret
0462      restore
0463 ENDPROC(xor_niagara_3)
0464 EXPORT_SYMBOL(xor_niagara_3)
0465 
0466 ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
0467     save        %sp, -192, %sp
0468     prefetch    [%i1], #n_writes
0469     prefetch    [%i2], #one_read
0470     prefetch    [%i3], #one_read
0471     prefetch    [%i4], #one_read
0472     rd      %asi, %g7
0473     wr      %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
0474     srlx        %i0, 6, %g1
0475     mov     %i1, %i0
0476     mov     %i2, %i1
0477     mov     %i3, %l7
0478     mov     %i4, %l6
0479 1:  ldda        [%i1 + 0x00] %asi, %i2  /* %i2/%i3 = src1 + 0x00 */
0480     ldda        [%l7 + 0x00] %asi, %i4  /* %i4/%i5 = src2 + 0x00 */
0481     ldda        [%l6 + 0x00] %asi, %g2  /* %g2/%g3 = src3 + 0x00 */
0482     ldda        [%i0 + 0x00] %asi, %l0  /* %l0/%l1 = dest + 0x00 */
0483     xor     %i4, %i2, %i4
0484     xor     %i5, %i3, %i5
0485     ldda        [%i1 + 0x10] %asi, %i2  /* %i2/%i3 = src1 + 0x10 */
0486     xor     %g2, %i4, %g2
0487     xor     %g3, %i5, %g3
0488     ldda        [%l7 + 0x10] %asi, %i4  /* %i4/%i5 = src2 + 0x10 */
0489     xor     %l0, %g2, %l0
0490     xor     %l1, %g3, %l1
0491     stxa        %l0, [%i0 + 0x00] %asi
0492     stxa        %l1, [%i0 + 0x08] %asi
0493     ldda        [%l6 + 0x10] %asi, %g2  /* %g2/%g3 = src3 + 0x10 */
0494     ldda        [%i0 + 0x10] %asi, %l0  /* %l0/%l1 = dest + 0x10 */
0495 
0496     xor     %i4, %i2, %i4
0497     xor     %i5, %i3, %i5
0498     ldda        [%i1 + 0x20] %asi, %i2  /* %i2/%i3 = src1 + 0x20 */
0499     xor     %g2, %i4, %g2
0500     xor     %g3, %i5, %g3
0501     ldda        [%l7 + 0x20] %asi, %i4  /* %i4/%i5 = src2 + 0x20 */
0502     xor     %l0, %g2, %l0
0503     xor     %l1, %g3, %l1
0504     stxa        %l0, [%i0 + 0x10] %asi
0505     stxa        %l1, [%i0 + 0x18] %asi
0506     ldda        [%l6 + 0x20] %asi, %g2  /* %g2/%g3 = src3 + 0x20 */
0507     ldda        [%i0 + 0x20] %asi, %l0  /* %l0/%l1 = dest + 0x20 */
0508 
0509     xor     %i4, %i2, %i4
0510     xor     %i5, %i3, %i5
0511     ldda        [%i1 + 0x30] %asi, %i2  /* %i2/%i3 = src1 + 0x30 */
0512     xor     %g2, %i4, %g2
0513     xor     %g3, %i5, %g3
0514     ldda        [%l7 + 0x30] %asi, %i4  /* %i4/%i5 = src2 + 0x30 */
0515     xor     %l0, %g2, %l0
0516     xor     %l1, %g3, %l1
0517     stxa        %l0, [%i0 + 0x20] %asi
0518     stxa        %l1, [%i0 + 0x28] %asi
0519     ldda        [%l6 + 0x30] %asi, %g2  /* %g2/%g3 = src3 + 0x30 */
0520     ldda        [%i0 + 0x30] %asi, %l0  /* %l0/%l1 = dest + 0x30 */
0521 
0522     prefetch    [%i1 + 0x40], #one_read
0523     prefetch    [%l7 + 0x40], #one_read
0524     prefetch    [%l6 + 0x40], #one_read
0525     prefetch    [%i0 + 0x40], #n_writes
0526 
0527     xor     %i4, %i2, %i4
0528     xor     %i5, %i3, %i5
0529     xor     %g2, %i4, %g2
0530     xor     %g3, %i5, %g3
0531     xor     %l0, %g2, %l0
0532     xor     %l1, %g3, %l1
0533     stxa        %l0, [%i0 + 0x30] %asi
0534     stxa        %l1, [%i0 + 0x38] %asi
0535 
0536     add     %i0, 0x40, %i0
0537     add     %i1, 0x40, %i1
0538     add     %l7, 0x40, %l7
0539     subcc       %g1, 1, %g1
0540     bne,pt      %xcc, 1b
0541      add        %l6, 0x40, %l6
0542     membar      #Sync
0543     wr      %g7, 0x0, %asi
0544     ret
0545      restore
0546 ENDPROC(xor_niagara_4)
0547 EXPORT_SYMBOL(xor_niagara_4)
0548 
0549 ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=src4 */
0550     save        %sp, -192, %sp
0551     prefetch    [%i1], #n_writes
0552     prefetch    [%i2], #one_read
0553     prefetch    [%i3], #one_read
0554     prefetch    [%i4], #one_read
0555     prefetch    [%i5], #one_read
0556     rd      %asi, %g7
0557     wr      %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
0558     srlx        %i0, 6, %g1
0559     mov     %i1, %i0
0560     mov     %i2, %i1
0561     mov     %i3, %l7
0562     mov     %i4, %l6
0563     mov     %i5, %l5
0564 1:  ldda        [%i1 + 0x00] %asi, %i2  /* %i2/%i3 = src1 + 0x00 */
0565     ldda        [%l7 + 0x00] %asi, %i4  /* %i4/%i5 = src2 + 0x00 */
0566     ldda        [%l6 + 0x00] %asi, %g2  /* %g2/%g3 = src3 + 0x00 */
0567     ldda        [%l5 + 0x00] %asi, %l0  /* %l0/%l1 = src4 + 0x00 */
0568     ldda        [%i0 + 0x00] %asi, %l2  /* %l2/%l3 = dest + 0x00 */
0569     xor     %i4, %i2, %i4
0570     xor     %i5, %i3, %i5
0571     ldda        [%i1 + 0x10] %asi, %i2  /* %i2/%i3 = src1 + 0x10 */
0572     xor     %g2, %i4, %g2
0573     xor     %g3, %i5, %g3
0574     ldda        [%l7 + 0x10] %asi, %i4  /* %i4/%i5 = src2 + 0x10 */
0575     xor     %l0, %g2, %l0
0576     xor     %l1, %g3, %l1
0577     ldda        [%l6 + 0x10] %asi, %g2  /* %g2/%g3 = src3 + 0x10 */
0578     xor     %l2, %l0, %l2
0579     xor     %l3, %l1, %l3
0580     stxa        %l2, [%i0 + 0x00] %asi
0581     stxa        %l3, [%i0 + 0x08] %asi
0582     ldda        [%l5 + 0x10] %asi, %l0  /* %l0/%l1 = src4 + 0x10 */
0583     ldda        [%i0 + 0x10] %asi, %l2  /* %l2/%l3 = dest + 0x10 */
0584 
0585     xor     %i4, %i2, %i4
0586     xor     %i5, %i3, %i5
0587     ldda        [%i1 + 0x20] %asi, %i2  /* %i2/%i3 = src1 + 0x20 */
0588     xor     %g2, %i4, %g2
0589     xor     %g3, %i5, %g3
0590     ldda        [%l7 + 0x20] %asi, %i4  /* %i4/%i5 = src2 + 0x20 */
0591     xor     %l0, %g2, %l0
0592     xor     %l1, %g3, %l1
0593     ldda        [%l6 + 0x20] %asi, %g2  /* %g2/%g3 = src3 + 0x20 */
0594     xor     %l2, %l0, %l2
0595     xor     %l3, %l1, %l3
0596     stxa        %l2, [%i0 + 0x10] %asi
0597     stxa        %l3, [%i0 + 0x18] %asi
0598     ldda        [%l5 + 0x20] %asi, %l0  /* %l0/%l1 = src4 + 0x20 */
0599     ldda        [%i0 + 0x20] %asi, %l2  /* %l2/%l3 = dest + 0x20 */
0600 
0601     xor     %i4, %i2, %i4
0602     xor     %i5, %i3, %i5
0603     ldda        [%i1 + 0x30] %asi, %i2  /* %i2/%i3 = src1 + 0x30 */
0604     xor     %g2, %i4, %g2
0605     xor     %g3, %i5, %g3
0606     ldda        [%l7 + 0x30] %asi, %i4  /* %i4/%i5 = src2 + 0x30 */
0607     xor     %l0, %g2, %l0
0608     xor     %l1, %g3, %l1
0609     ldda        [%l6 + 0x30] %asi, %g2  /* %g2/%g3 = src3 + 0x30 */
0610     xor     %l2, %l0, %l2
0611     xor     %l3, %l1, %l3
0612     stxa        %l2, [%i0 + 0x20] %asi
0613     stxa        %l3, [%i0 + 0x28] %asi
0614     ldda        [%l5 + 0x30] %asi, %l0  /* %l0/%l1 = src4 + 0x30 */
0615     ldda        [%i0 + 0x30] %asi, %l2  /* %l2/%l3 = dest + 0x30 */
0616 
0617     prefetch    [%i1 + 0x40], #one_read
0618     prefetch    [%l7 + 0x40], #one_read
0619     prefetch    [%l6 + 0x40], #one_read
0620     prefetch    [%l5 + 0x40], #one_read
0621     prefetch    [%i0 + 0x40], #n_writes
0622 
0623     xor     %i4, %i2, %i4
0624     xor     %i5, %i3, %i5
0625     xor     %g2, %i4, %g2
0626     xor     %g3, %i5, %g3
0627     xor     %l0, %g2, %l0
0628     xor     %l1, %g3, %l1
0629     xor     %l2, %l0, %l2
0630     xor     %l3, %l1, %l3
0631     stxa        %l2, [%i0 + 0x30] %asi
0632     stxa        %l3, [%i0 + 0x38] %asi
0633 
0634     add     %i0, 0x40, %i0
0635     add     %i1, 0x40, %i1
0636     add     %l7, 0x40, %l7
0637     add     %l6, 0x40, %l6
0638     subcc       %g1, 1, %g1
0639     bne,pt      %xcc, 1b
0640      add        %l5, 0x40, %l5
0641     membar      #Sync
0642     wr      %g7, 0x0, %asi
0643     ret
0644      restore
0645 ENDPROC(xor_niagara_5)
0646 EXPORT_SYMBOL(xor_niagara_5)