xor.S 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. /*
  2. * arch/sparc64/lib/xor.S
  3. *
  4. * High speed xor_block operation for RAID4/5 utilizing the
  5. * UltraSparc Visual Instruction Set and Niagara store-init/twin-load.
  6. *
  7. * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz)
  8. * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
  9. */
  10. #include <linux/linkage.h>
  11. #include <asm/visasm.h>
  12. #include <asm/asi.h>
  13. #include <asm/dcu.h>
  14. #include <asm/spitfire.h>
  15. /*
  16. * Requirements:
  17. * !(((long)dest | (long)sourceN) & (64 - 1)) &&
  18. * !(len & 127) && len >= 256
  19. */
  20. .text
  21. /* VIS versions. */
  22. ENTRY(xor_vis_2)
  23. rd %fprs, %o5
  24. andcc %o5, FPRS_FEF|FPRS_DU, %g0
  25. be,pt %icc, 0f
  26. sethi %hi(VISenter), %g1
  27. jmpl %g1 + %lo(VISenter), %g7
  28. add %g7, 8, %g7
  29. 0: wr %g0, FPRS_FEF, %fprs
  30. rd %asi, %g1
  31. wr %g0, ASI_BLK_P, %asi
  32. membar #LoadStore|#StoreLoad|#StoreStore
  33. sub %o0, 128, %o0
  34. ldda [%o1] %asi, %f0
  35. ldda [%o2] %asi, %f16
  36. 2: ldda [%o1 + 64] %asi, %f32
  37. fxor %f0, %f16, %f16
  38. fxor %f2, %f18, %f18
  39. fxor %f4, %f20, %f20
  40. fxor %f6, %f22, %f22
  41. fxor %f8, %f24, %f24
  42. fxor %f10, %f26, %f26
  43. fxor %f12, %f28, %f28
  44. fxor %f14, %f30, %f30
  45. stda %f16, [%o1] %asi
  46. ldda [%o2 + 64] %asi, %f48
  47. ldda [%o1 + 128] %asi, %f0
  48. fxor %f32, %f48, %f48
  49. fxor %f34, %f50, %f50
  50. add %o1, 128, %o1
  51. fxor %f36, %f52, %f52
  52. add %o2, 128, %o2
  53. fxor %f38, %f54, %f54
  54. subcc %o0, 128, %o0
  55. fxor %f40, %f56, %f56
  56. fxor %f42, %f58, %f58
  57. fxor %f44, %f60, %f60
  58. fxor %f46, %f62, %f62
  59. stda %f48, [%o1 - 64] %asi
  60. bne,pt %xcc, 2b
  61. ldda [%o2] %asi, %f16
  62. ldda [%o1 + 64] %asi, %f32
  63. fxor %f0, %f16, %f16
  64. fxor %f2, %f18, %f18
  65. fxor %f4, %f20, %f20
  66. fxor %f6, %f22, %f22
  67. fxor %f8, %f24, %f24
  68. fxor %f10, %f26, %f26
  69. fxor %f12, %f28, %f28
  70. fxor %f14, %f30, %f30
  71. stda %f16, [%o1] %asi
  72. ldda [%o2 + 64] %asi, %f48
  73. membar #Sync
  74. fxor %f32, %f48, %f48
  75. fxor %f34, %f50, %f50
  76. fxor %f36, %f52, %f52
  77. fxor %f38, %f54, %f54
  78. fxor %f40, %f56, %f56
  79. fxor %f42, %f58, %f58
  80. fxor %f44, %f60, %f60
  81. fxor %f46, %f62, %f62
  82. stda %f48, [%o1 + 64] %asi
  83. membar #Sync|#StoreStore|#StoreLoad
  84. wr %g1, %g0, %asi
  85. retl
  86. wr %g0, 0, %fprs
  87. ENDPROC(xor_vis_2)
  88. ENTRY(xor_vis_3)
  89. rd %fprs, %o5
  90. andcc %o5, FPRS_FEF|FPRS_DU, %g0
  91. be,pt %icc, 0f
  92. sethi %hi(VISenter), %g1
  93. jmpl %g1 + %lo(VISenter), %g7
  94. add %g7, 8, %g7
  95. 0: wr %g0, FPRS_FEF, %fprs
  96. rd %asi, %g1
  97. wr %g0, ASI_BLK_P, %asi
  98. membar #LoadStore|#StoreLoad|#StoreStore
  99. sub %o0, 64, %o0
  100. ldda [%o1] %asi, %f0
  101. ldda [%o2] %asi, %f16
  102. 3: ldda [%o3] %asi, %f32
  103. fxor %f0, %f16, %f48
  104. fxor %f2, %f18, %f50
  105. add %o1, 64, %o1
  106. fxor %f4, %f20, %f52
  107. fxor %f6, %f22, %f54
  108. add %o2, 64, %o2
  109. fxor %f8, %f24, %f56
  110. fxor %f10, %f26, %f58
  111. fxor %f12, %f28, %f60
  112. fxor %f14, %f30, %f62
  113. ldda [%o1] %asi, %f0
  114. fxor %f48, %f32, %f48
  115. fxor %f50, %f34, %f50
  116. fxor %f52, %f36, %f52
  117. fxor %f54, %f38, %f54
  118. add %o3, 64, %o3
  119. fxor %f56, %f40, %f56
  120. fxor %f58, %f42, %f58
  121. subcc %o0, 64, %o0
  122. fxor %f60, %f44, %f60
  123. fxor %f62, %f46, %f62
  124. stda %f48, [%o1 - 64] %asi
  125. bne,pt %xcc, 3b
  126. ldda [%o2] %asi, %f16
  127. ldda [%o3] %asi, %f32
  128. fxor %f0, %f16, %f48
  129. fxor %f2, %f18, %f50
  130. fxor %f4, %f20, %f52
  131. fxor %f6, %f22, %f54
  132. fxor %f8, %f24, %f56
  133. fxor %f10, %f26, %f58
  134. fxor %f12, %f28, %f60
  135. fxor %f14, %f30, %f62
  136. membar #Sync
  137. fxor %f48, %f32, %f48
  138. fxor %f50, %f34, %f50
  139. fxor %f52, %f36, %f52
  140. fxor %f54, %f38, %f54
  141. fxor %f56, %f40, %f56
  142. fxor %f58, %f42, %f58
  143. fxor %f60, %f44, %f60
  144. fxor %f62, %f46, %f62
  145. stda %f48, [%o1] %asi
  146. membar #Sync|#StoreStore|#StoreLoad
  147. wr %g1, %g0, %asi
  148. retl
  149. wr %g0, 0, %fprs
  150. ENDPROC(xor_vis_3)
  151. ENTRY(xor_vis_4)
  152. rd %fprs, %o5
  153. andcc %o5, FPRS_FEF|FPRS_DU, %g0
  154. be,pt %icc, 0f
  155. sethi %hi(VISenter), %g1
  156. jmpl %g1 + %lo(VISenter), %g7
  157. add %g7, 8, %g7
  158. 0: wr %g0, FPRS_FEF, %fprs
  159. rd %asi, %g1
  160. wr %g0, ASI_BLK_P, %asi
  161. membar #LoadStore|#StoreLoad|#StoreStore
  162. sub %o0, 64, %o0
  163. ldda [%o1] %asi, %f0
  164. ldda [%o2] %asi, %f16
  165. 4: ldda [%o3] %asi, %f32
  166. fxor %f0, %f16, %f16
  167. fxor %f2, %f18, %f18
  168. add %o1, 64, %o1
  169. fxor %f4, %f20, %f20
  170. fxor %f6, %f22, %f22
  171. add %o2, 64, %o2
  172. fxor %f8, %f24, %f24
  173. fxor %f10, %f26, %f26
  174. fxor %f12, %f28, %f28
  175. fxor %f14, %f30, %f30
  176. ldda [%o4] %asi, %f48
  177. fxor %f16, %f32, %f32
  178. fxor %f18, %f34, %f34
  179. fxor %f20, %f36, %f36
  180. fxor %f22, %f38, %f38
  181. add %o3, 64, %o3
  182. fxor %f24, %f40, %f40
  183. fxor %f26, %f42, %f42
  184. fxor %f28, %f44, %f44
  185. fxor %f30, %f46, %f46
  186. ldda [%o1] %asi, %f0
  187. fxor %f32, %f48, %f48
  188. fxor %f34, %f50, %f50
  189. fxor %f36, %f52, %f52
  190. add %o4, 64, %o4
  191. fxor %f38, %f54, %f54
  192. fxor %f40, %f56, %f56
  193. fxor %f42, %f58, %f58
  194. subcc %o0, 64, %o0
  195. fxor %f44, %f60, %f60
  196. fxor %f46, %f62, %f62
  197. stda %f48, [%o1 - 64] %asi
  198. bne,pt %xcc, 4b
  199. ldda [%o2] %asi, %f16
  200. ldda [%o3] %asi, %f32
  201. fxor %f0, %f16, %f16
  202. fxor %f2, %f18, %f18
  203. fxor %f4, %f20, %f20
  204. fxor %f6, %f22, %f22
  205. fxor %f8, %f24, %f24
  206. fxor %f10, %f26, %f26
  207. fxor %f12, %f28, %f28
  208. fxor %f14, %f30, %f30
  209. ldda [%o4] %asi, %f48
  210. fxor %f16, %f32, %f32
  211. fxor %f18, %f34, %f34
  212. fxor %f20, %f36, %f36
  213. fxor %f22, %f38, %f38
  214. fxor %f24, %f40, %f40
  215. fxor %f26, %f42, %f42
  216. fxor %f28, %f44, %f44
  217. fxor %f30, %f46, %f46
  218. membar #Sync
  219. fxor %f32, %f48, %f48
  220. fxor %f34, %f50, %f50
  221. fxor %f36, %f52, %f52
  222. fxor %f38, %f54, %f54
  223. fxor %f40, %f56, %f56
  224. fxor %f42, %f58, %f58
  225. fxor %f44, %f60, %f60
  226. fxor %f46, %f62, %f62
  227. stda %f48, [%o1] %asi
  228. membar #Sync|#StoreStore|#StoreLoad
  229. wr %g1, %g0, %asi
  230. retl
  231. wr %g0, 0, %fprs
  232. ENDPROC(xor_vis_4)
  233. ENTRY(xor_vis_5)
  234. save %sp, -192, %sp
  235. rd %fprs, %o5
  236. andcc %o5, FPRS_FEF|FPRS_DU, %g0
  237. be,pt %icc, 0f
  238. sethi %hi(VISenter), %g1
  239. jmpl %g1 + %lo(VISenter), %g7
  240. add %g7, 8, %g7
  241. 0: wr %g0, FPRS_FEF, %fprs
  242. rd %asi, %g1
  243. wr %g0, ASI_BLK_P, %asi
  244. membar #LoadStore|#StoreLoad|#StoreStore
  245. sub %i0, 64, %i0
  246. ldda [%i1] %asi, %f0
  247. ldda [%i2] %asi, %f16
  248. 5: ldda [%i3] %asi, %f32
  249. fxor %f0, %f16, %f48
  250. fxor %f2, %f18, %f50
  251. add %i1, 64, %i1
  252. fxor %f4, %f20, %f52
  253. fxor %f6, %f22, %f54
  254. add %i2, 64, %i2
  255. fxor %f8, %f24, %f56
  256. fxor %f10, %f26, %f58
  257. fxor %f12, %f28, %f60
  258. fxor %f14, %f30, %f62
  259. ldda [%i4] %asi, %f16
  260. fxor %f48, %f32, %f48
  261. fxor %f50, %f34, %f50
  262. fxor %f52, %f36, %f52
  263. fxor %f54, %f38, %f54
  264. add %i3, 64, %i3
  265. fxor %f56, %f40, %f56
  266. fxor %f58, %f42, %f58
  267. fxor %f60, %f44, %f60
  268. fxor %f62, %f46, %f62
  269. ldda [%i5] %asi, %f32
  270. fxor %f48, %f16, %f48
  271. fxor %f50, %f18, %f50
  272. add %i4, 64, %i4
  273. fxor %f52, %f20, %f52
  274. fxor %f54, %f22, %f54
  275. add %i5, 64, %i5
  276. fxor %f56, %f24, %f56
  277. fxor %f58, %f26, %f58
  278. fxor %f60, %f28, %f60
  279. fxor %f62, %f30, %f62
  280. ldda [%i1] %asi, %f0
  281. fxor %f48, %f32, %f48
  282. fxor %f50, %f34, %f50
  283. fxor %f52, %f36, %f52
  284. fxor %f54, %f38, %f54
  285. fxor %f56, %f40, %f56
  286. fxor %f58, %f42, %f58
  287. subcc %i0, 64, %i0
  288. fxor %f60, %f44, %f60
  289. fxor %f62, %f46, %f62
  290. stda %f48, [%i1 - 64] %asi
  291. bne,pt %xcc, 5b
  292. ldda [%i2] %asi, %f16
  293. ldda [%i3] %asi, %f32
  294. fxor %f0, %f16, %f48
  295. fxor %f2, %f18, %f50
  296. fxor %f4, %f20, %f52
  297. fxor %f6, %f22, %f54
  298. fxor %f8, %f24, %f56
  299. fxor %f10, %f26, %f58
  300. fxor %f12, %f28, %f60
  301. fxor %f14, %f30, %f62
  302. ldda [%i4] %asi, %f16
  303. fxor %f48, %f32, %f48
  304. fxor %f50, %f34, %f50
  305. fxor %f52, %f36, %f52
  306. fxor %f54, %f38, %f54
  307. fxor %f56, %f40, %f56
  308. fxor %f58, %f42, %f58
  309. fxor %f60, %f44, %f60
  310. fxor %f62, %f46, %f62
  311. ldda [%i5] %asi, %f32
  312. fxor %f48, %f16, %f48
  313. fxor %f50, %f18, %f50
  314. fxor %f52, %f20, %f52
  315. fxor %f54, %f22, %f54
  316. fxor %f56, %f24, %f56
  317. fxor %f58, %f26, %f58
  318. fxor %f60, %f28, %f60
  319. fxor %f62, %f30, %f62
  320. membar #Sync
  321. fxor %f48, %f32, %f48
  322. fxor %f50, %f34, %f50
  323. fxor %f52, %f36, %f52
  324. fxor %f54, %f38, %f54
  325. fxor %f56, %f40, %f56
  326. fxor %f58, %f42, %f58
  327. fxor %f60, %f44, %f60
  328. fxor %f62, %f46, %f62
  329. stda %f48, [%i1] %asi
  330. membar #Sync|#StoreStore|#StoreLoad
  331. wr %g1, %g0, %asi
  332. wr %g0, 0, %fprs
  333. ret
  334. restore
  335. ENDPROC(xor_vis_5)
  336. /* Niagara versions. */
  337. ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */
  338. save %sp, -192, %sp
  339. prefetch [%i1], #n_writes
  340. prefetch [%i2], #one_read
  341. rd %asi, %g7
  342. wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
  343. srlx %i0, 6, %g1
  344. mov %i1, %i0
  345. mov %i2, %i1
  346. 1: ldda [%i1 + 0x00] %asi, %i2 /* %i2/%i3 = src + 0x00 */
  347. ldda [%i1 + 0x10] %asi, %i4 /* %i4/%i5 = src + 0x10 */
  348. ldda [%i1 + 0x20] %asi, %g2 /* %g2/%g3 = src + 0x20 */
  349. ldda [%i1 + 0x30] %asi, %l0 /* %l0/%l1 = src + 0x30 */
  350. prefetch [%i1 + 0x40], #one_read
  351. ldda [%i0 + 0x00] %asi, %o0 /* %o0/%o1 = dest + 0x00 */
  352. ldda [%i0 + 0x10] %asi, %o2 /* %o2/%o3 = dest + 0x10 */
  353. ldda [%i0 + 0x20] %asi, %o4 /* %o4/%o5 = dest + 0x20 */
  354. ldda [%i0 + 0x30] %asi, %l2 /* %l2/%l3 = dest + 0x30 */
  355. prefetch [%i0 + 0x40], #n_writes
  356. xor %o0, %i2, %o0
  357. xor %o1, %i3, %o1
  358. stxa %o0, [%i0 + 0x00] %asi
  359. stxa %o1, [%i0 + 0x08] %asi
  360. xor %o2, %i4, %o2
  361. xor %o3, %i5, %o3
  362. stxa %o2, [%i0 + 0x10] %asi
  363. stxa %o3, [%i0 + 0x18] %asi
  364. xor %o4, %g2, %o4
  365. xor %o5, %g3, %o5
  366. stxa %o4, [%i0 + 0x20] %asi
  367. stxa %o5, [%i0 + 0x28] %asi
  368. xor %l2, %l0, %l2
  369. xor %l3, %l1, %l3
  370. stxa %l2, [%i0 + 0x30] %asi
  371. stxa %l3, [%i0 + 0x38] %asi
  372. add %i0, 0x40, %i0
  373. subcc %g1, 1, %g1
  374. bne,pt %xcc, 1b
  375. add %i1, 0x40, %i1
  376. membar #Sync
  377. wr %g7, 0x0, %asi
  378. ret
  379. restore
  380. ENDPROC(xor_niagara_2)
  381. ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */
  382. save %sp, -192, %sp
  383. prefetch [%i1], #n_writes
  384. prefetch [%i2], #one_read
  385. prefetch [%i3], #one_read
  386. rd %asi, %g7
  387. wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
  388. srlx %i0, 6, %g1
  389. mov %i1, %i0
  390. mov %i2, %i1
  391. mov %i3, %l7
  392. 1: ldda [%i1 + 0x00] %asi, %i2 /* %i2/%i3 = src1 + 0x00 */
  393. ldda [%i1 + 0x10] %asi, %i4 /* %i4/%i5 = src1 + 0x10 */
  394. ldda [%l7 + 0x00] %asi, %g2 /* %g2/%g3 = src2 + 0x00 */
  395. ldda [%l7 + 0x10] %asi, %l0 /* %l0/%l1 = src2 + 0x10 */
  396. ldda [%i0 + 0x00] %asi, %o0 /* %o0/%o1 = dest + 0x00 */
  397. ldda [%i0 + 0x10] %asi, %o2 /* %o2/%o3 = dest + 0x10 */
  398. xor %g2, %i2, %g2
  399. xor %g3, %i3, %g3
  400. xor %o0, %g2, %o0
  401. xor %o1, %g3, %o1
  402. stxa %o0, [%i0 + 0x00] %asi
  403. stxa %o1, [%i0 + 0x08] %asi
  404. ldda [%i1 + 0x20] %asi, %i2 /* %i2/%i3 = src1 + 0x20 */
  405. ldda [%l7 + 0x20] %asi, %g2 /* %g2/%g3 = src2 + 0x20 */
  406. ldda [%i0 + 0x20] %asi, %o0 /* %o0/%o1 = dest + 0x20 */
  407. xor %l0, %i4, %l0
  408. xor %l1, %i5, %l1
  409. xor %o2, %l0, %o2
  410. xor %o3, %l1, %o3
  411. stxa %o2, [%i0 + 0x10] %asi
  412. stxa %o3, [%i0 + 0x18] %asi
  413. ldda [%i1 + 0x30] %asi, %i4 /* %i4/%i5 = src1 + 0x30 */
  414. ldda [%l7 + 0x30] %asi, %l0 /* %l0/%l1 = src2 + 0x30 */
  415. ldda [%i0 + 0x30] %asi, %o2 /* %o2/%o3 = dest + 0x30 */
  416. prefetch [%i1 + 0x40], #one_read
  417. prefetch [%l7 + 0x40], #one_read
  418. prefetch [%i0 + 0x40], #n_writes
  419. xor %g2, %i2, %g2
  420. xor %g3, %i3, %g3
  421. xor %o0, %g2, %o0
  422. xor %o1, %g3, %o1
  423. stxa %o0, [%i0 + 0x20] %asi
  424. stxa %o1, [%i0 + 0x28] %asi
  425. xor %l0, %i4, %l0
  426. xor %l1, %i5, %l1
  427. xor %o2, %l0, %o2
  428. xor %o3, %l1, %o3
  429. stxa %o2, [%i0 + 0x30] %asi
  430. stxa %o3, [%i0 + 0x38] %asi
  431. add %i0, 0x40, %i0
  432. add %i1, 0x40, %i1
  433. subcc %g1, 1, %g1
  434. bne,pt %xcc, 1b
  435. add %l7, 0x40, %l7
  436. membar #Sync
  437. wr %g7, 0x0, %asi
  438. ret
  439. restore
  440. ENDPROC(xor_niagara_3)
  441. ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
  442. save %sp, -192, %sp
  443. prefetch [%i1], #n_writes
  444. prefetch [%i2], #one_read
  445. prefetch [%i3], #one_read
  446. prefetch [%i4], #one_read
  447. rd %asi, %g7
  448. wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
  449. srlx %i0, 6, %g1
  450. mov %i1, %i0
  451. mov %i2, %i1
  452. mov %i3, %l7
  453. mov %i4, %l6
  454. 1: ldda [%i1 + 0x00] %asi, %i2 /* %i2/%i3 = src1 + 0x00 */
  455. ldda [%l7 + 0x00] %asi, %i4 /* %i4/%i5 = src2 + 0x00 */
  456. ldda [%l6 + 0x00] %asi, %g2 /* %g2/%g3 = src3 + 0x00 */
  457. ldda [%i0 + 0x00] %asi, %l0 /* %l0/%l1 = dest + 0x00 */
  458. xor %i4, %i2, %i4
  459. xor %i5, %i3, %i5
  460. ldda [%i1 + 0x10] %asi, %i2 /* %i2/%i3 = src1 + 0x10 */
  461. xor %g2, %i4, %g2
  462. xor %g3, %i5, %g3
  463. ldda [%l7 + 0x10] %asi, %i4 /* %i4/%i5 = src2 + 0x10 */
  464. xor %l0, %g2, %l0
  465. xor %l1, %g3, %l1
  466. stxa %l0, [%i0 + 0x00] %asi
  467. stxa %l1, [%i0 + 0x08] %asi
  468. ldda [%l6 + 0x10] %asi, %g2 /* %g2/%g3 = src3 + 0x10 */
  469. ldda [%i0 + 0x10] %asi, %l0 /* %l0/%l1 = dest + 0x10 */
  470. xor %i4, %i2, %i4
  471. xor %i5, %i3, %i5
  472. ldda [%i1 + 0x20] %asi, %i2 /* %i2/%i3 = src1 + 0x20 */
  473. xor %g2, %i4, %g2
  474. xor %g3, %i5, %g3
  475. ldda [%l7 + 0x20] %asi, %i4 /* %i4/%i5 = src2 + 0x20 */
  476. xor %l0, %g2, %l0
  477. xor %l1, %g3, %l1
  478. stxa %l0, [%i0 + 0x10] %asi
  479. stxa %l1, [%i0 + 0x18] %asi
  480. ldda [%l6 + 0x20] %asi, %g2 /* %g2/%g3 = src3 + 0x20 */
  481. ldda [%i0 + 0x20] %asi, %l0 /* %l0/%l1 = dest + 0x20 */
  482. xor %i4, %i2, %i4
  483. xor %i5, %i3, %i5
  484. ldda [%i1 + 0x30] %asi, %i2 /* %i2/%i3 = src1 + 0x30 */
  485. xor %g2, %i4, %g2
  486. xor %g3, %i5, %g3
  487. ldda [%l7 + 0x30] %asi, %i4 /* %i4/%i5 = src2 + 0x30 */
  488. xor %l0, %g2, %l0
  489. xor %l1, %g3, %l1
  490. stxa %l0, [%i0 + 0x20] %asi
  491. stxa %l1, [%i0 + 0x28] %asi
  492. ldda [%l6 + 0x30] %asi, %g2 /* %g2/%g3 = src3 + 0x30 */
  493. ldda [%i0 + 0x30] %asi, %l0 /* %l0/%l1 = dest + 0x30 */
  494. prefetch [%i1 + 0x40], #one_read
  495. prefetch [%l7 + 0x40], #one_read
  496. prefetch [%l6 + 0x40], #one_read
  497. prefetch [%i0 + 0x40], #n_writes
  498. xor %i4, %i2, %i4
  499. xor %i5, %i3, %i5
  500. xor %g2, %i4, %g2
  501. xor %g3, %i5, %g3
  502. xor %l0, %g2, %l0
  503. xor %l1, %g3, %l1
  504. stxa %l0, [%i0 + 0x30] %asi
  505. stxa %l1, [%i0 + 0x38] %asi
  506. add %i0, 0x40, %i0
  507. add %i1, 0x40, %i1
  508. add %l7, 0x40, %l7
  509. subcc %g1, 1, %g1
  510. bne,pt %xcc, 1b
  511. add %l6, 0x40, %l6
  512. membar #Sync
  513. wr %g7, 0x0, %asi
  514. ret
  515. restore
  516. ENDPROC(xor_niagara_4)
  517. ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=src4 */
  518. save %sp, -192, %sp
  519. prefetch [%i1], #n_writes
  520. prefetch [%i2], #one_read
  521. prefetch [%i3], #one_read
  522. prefetch [%i4], #one_read
  523. prefetch [%i5], #one_read
  524. rd %asi, %g7
  525. wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
  526. srlx %i0, 6, %g1
  527. mov %i1, %i0
  528. mov %i2, %i1
  529. mov %i3, %l7
  530. mov %i4, %l6
  531. mov %i5, %l5
  532. 1: ldda [%i1 + 0x00] %asi, %i2 /* %i2/%i3 = src1 + 0x00 */
  533. ldda [%l7 + 0x00] %asi, %i4 /* %i4/%i5 = src2 + 0x00 */
  534. ldda [%l6 + 0x00] %asi, %g2 /* %g2/%g3 = src3 + 0x00 */
  535. ldda [%l5 + 0x00] %asi, %l0 /* %l0/%l1 = src4 + 0x00 */
  536. ldda [%i0 + 0x00] %asi, %l2 /* %l2/%l3 = dest + 0x00 */
  537. xor %i4, %i2, %i4
  538. xor %i5, %i3, %i5
  539. ldda [%i1 + 0x10] %asi, %i2 /* %i2/%i3 = src1 + 0x10 */
  540. xor %g2, %i4, %g2
  541. xor %g3, %i5, %g3
  542. ldda [%l7 + 0x10] %asi, %i4 /* %i4/%i5 = src2 + 0x10 */
  543. xor %l0, %g2, %l0
  544. xor %l1, %g3, %l1
  545. ldda [%l6 + 0x10] %asi, %g2 /* %g2/%g3 = src3 + 0x10 */
  546. xor %l2, %l0, %l2
  547. xor %l3, %l1, %l3
  548. stxa %l2, [%i0 + 0x00] %asi
  549. stxa %l3, [%i0 + 0x08] %asi
  550. ldda [%l5 + 0x10] %asi, %l0 /* %l0/%l1 = src4 + 0x10 */
  551. ldda [%i0 + 0x10] %asi, %l2 /* %l2/%l3 = dest + 0x10 */
  552. xor %i4, %i2, %i4
  553. xor %i5, %i3, %i5
  554. ldda [%i1 + 0x20] %asi, %i2 /* %i2/%i3 = src1 + 0x20 */
  555. xor %g2, %i4, %g2
  556. xor %g3, %i5, %g3
  557. ldda [%l7 + 0x20] %asi, %i4 /* %i4/%i5 = src2 + 0x20 */
  558. xor %l0, %g2, %l0
  559. xor %l1, %g3, %l1
  560. ldda [%l6 + 0x20] %asi, %g2 /* %g2/%g3 = src3 + 0x20 */
  561. xor %l2, %l0, %l2
  562. xor %l3, %l1, %l3
  563. stxa %l2, [%i0 + 0x10] %asi
  564. stxa %l3, [%i0 + 0x18] %asi
  565. ldda [%l5 + 0x20] %asi, %l0 /* %l0/%l1 = src4 + 0x20 */
  566. ldda [%i0 + 0x20] %asi, %l2 /* %l2/%l3 = dest + 0x20 */
  567. xor %i4, %i2, %i4
  568. xor %i5, %i3, %i5
  569. ldda [%i1 + 0x30] %asi, %i2 /* %i2/%i3 = src1 + 0x30 */
  570. xor %g2, %i4, %g2
  571. xor %g3, %i5, %g3
  572. ldda [%l7 + 0x30] %asi, %i4 /* %i4/%i5 = src2 + 0x30 */
  573. xor %l0, %g2, %l0
  574. xor %l1, %g3, %l1
  575. ldda [%l6 + 0x30] %asi, %g2 /* %g2/%g3 = src3 + 0x30 */
  576. xor %l2, %l0, %l2
  577. xor %l3, %l1, %l3
  578. stxa %l2, [%i0 + 0x20] %asi
  579. stxa %l3, [%i0 + 0x28] %asi
  580. ldda [%l5 + 0x30] %asi, %l0 /* %l0/%l1 = src4 + 0x30 */
  581. ldda [%i0 + 0x30] %asi, %l2 /* %l2/%l3 = dest + 0x30 */
  582. prefetch [%i1 + 0x40], #one_read
  583. prefetch [%l7 + 0x40], #one_read
  584. prefetch [%l6 + 0x40], #one_read
  585. prefetch [%l5 + 0x40], #one_read
  586. prefetch [%i0 + 0x40], #n_writes
  587. xor %i4, %i2, %i4
  588. xor %i5, %i3, %i5
  589. xor %g2, %i4, %g2
  590. xor %g3, %i5, %g3
  591. xor %l0, %g2, %l0
  592. xor %l1, %g3, %l1
  593. xor %l2, %l0, %l2
  594. xor %l3, %l1, %l3
  595. stxa %l2, [%i0 + 0x30] %asi
  596. stxa %l3, [%i0 + 0x38] %asi
  597. add %i0, 0x40, %i0
  598. add %i1, 0x40, %i1
  599. add %l7, 0x40, %l7
  600. add %l6, 0x40, %l6
  601. subcc %g1, 1, %g1
  602. bne,pt %xcc, 1b
  603. add %l5, 0x40, %l5
  604. membar #Sync
  605. wr %g7, 0x0, %asi
  606. ret
  607. restore
  608. ENDPROC(xor_niagara_5)