checksum_32.S 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* checksum.S: Sparc optimized checksum code.
  3. *
  4. * Copyright(C) 1995 Linus Torvalds
  5. * Copyright(C) 1995 Miguel de Icaza
  6. * Copyright(C) 1996 David S. Miller
  7. * Copyright(C) 1997 Jakub Jelinek
  8. *
  9. * derived from:
  10. * Linux/Alpha checksum c-code
  11. * Linux/ix86 inline checksum assembly
  12. * RFC1071 Computing the Internet Checksum (esp. Jacobsons m68k code)
  13. * David Mosberger-Tang for optimized reference c-code
  14. * BSD4.4 portable checksum routine
  15. */
  16. #include <asm/errno.h>
  17. #include <asm/export.h>
  18. #define CSUM_BIGCHUNK(buf, offset, sum, t0, t1, t2, t3, t4, t5) \
  19. ldd [buf + offset + 0x00], t0; \
  20. ldd [buf + offset + 0x08], t2; \
  21. addxcc t0, sum, sum; \
  22. addxcc t1, sum, sum; \
  23. ldd [buf + offset + 0x10], t4; \
  24. addxcc t2, sum, sum; \
  25. addxcc t3, sum, sum; \
  26. ldd [buf + offset + 0x18], t0; \
  27. addxcc t4, sum, sum; \
  28. addxcc t5, sum, sum; \
  29. addxcc t0, sum, sum; \
  30. addxcc t1, sum, sum;
  31. #define CSUM_LASTCHUNK(buf, offset, sum, t0, t1, t2, t3) \
  32. ldd [buf - offset - 0x08], t0; \
  33. ldd [buf - offset - 0x00], t2; \
  34. addxcc t0, sum, sum; \
  35. addxcc t1, sum, sum; \
  36. addxcc t2, sum, sum; \
  37. addxcc t3, sum, sum;
  38. /* Do end cruft out of band to get better cache patterns. */
  39. csum_partial_end_cruft:
  40. be 1f ! caller asks %o1 & 0x8
  41. andcc %o1, 4, %g0 ! nope, check for word remaining
  42. ldd [%o0], %g2 ! load two
  43. addcc %g2, %o2, %o2 ! add first word to sum
  44. addxcc %g3, %o2, %o2 ! add second word as well
  45. add %o0, 8, %o0 ! advance buf ptr
  46. addx %g0, %o2, %o2 ! add in final carry
  47. andcc %o1, 4, %g0 ! check again for word remaining
  48. 1: be 1f ! nope, skip this code
  49. andcc %o1, 3, %o1 ! check for trailing bytes
  50. ld [%o0], %g2 ! load it
  51. addcc %g2, %o2, %o2 ! add to sum
  52. add %o0, 4, %o0 ! advance buf ptr
  53. addx %g0, %o2, %o2 ! add in final carry
  54. andcc %o1, 3, %g0 ! check again for trailing bytes
  55. 1: be 1f ! no trailing bytes, return
  56. addcc %o1, -1, %g0 ! only one byte remains?
  57. bne 2f ! at least two bytes more
  58. subcc %o1, 2, %o1 ! only two bytes more?
  59. b 4f ! only one byte remains
  60. or %g0, %g0, %o4 ! clear fake hword value
  61. 2: lduh [%o0], %o4 ! get hword
  62. be 6f ! jmp if only hword remains
  63. add %o0, 2, %o0 ! advance buf ptr either way
  64. sll %o4, 16, %o4 ! create upper hword
  65. 4: ldub [%o0], %o5 ! get final byte
  66. sll %o5, 8, %o5 ! put into place
  67. or %o5, %o4, %o4 ! coalese with hword (if any)
  68. 6: addcc %o4, %o2, %o2 ! add to sum
  69. 1: retl ! get outta here
  70. addx %g0, %o2, %o0 ! add final carry into retval
  71. /* Also do alignment out of band to get better cache patterns. */
  72. csum_partial_fix_alignment:
  73. cmp %o1, 6
  74. bl cpte - 0x4
  75. andcc %o0, 0x2, %g0
  76. be 1f
  77. andcc %o0, 0x4, %g0
  78. lduh [%o0 + 0x00], %g2
  79. sub %o1, 2, %o1
  80. add %o0, 2, %o0
  81. sll %g2, 16, %g2
  82. addcc %g2, %o2, %o2
  83. srl %o2, 16, %g3
  84. addx %g0, %g3, %g2
  85. sll %o2, 16, %o2
  86. sll %g2, 16, %g3
  87. srl %o2, 16, %o2
  88. andcc %o0, 0x4, %g0
  89. or %g3, %o2, %o2
  90. 1: be cpa
  91. andcc %o1, 0xffffff80, %o3
  92. ld [%o0 + 0x00], %g2
  93. sub %o1, 4, %o1
  94. addcc %g2, %o2, %o2
  95. add %o0, 4, %o0
  96. addx %g0, %o2, %o2
  97. b cpa
  98. andcc %o1, 0xffffff80, %o3
  99. /* The common case is to get called with a nicely aligned
  100. * buffer of size 0x20. Follow the code path for that case.
  101. */
  102. .globl csum_partial
  103. EXPORT_SYMBOL(csum_partial)
  104. csum_partial: /* %o0=buf, %o1=len, %o2=sum */
  105. andcc %o0, 0x7, %g0 ! alignment problems?
  106. bne csum_partial_fix_alignment ! yep, handle it
  107. sethi %hi(cpte - 8), %g7 ! prepare table jmp ptr
  108. andcc %o1, 0xffffff80, %o3 ! num loop iterations
  109. cpa: be 3f ! none to do
  110. andcc %o1, 0x70, %g1 ! clears carry flag too
  111. 5: CSUM_BIGCHUNK(%o0, 0x00, %o2, %o4, %o5, %g2, %g3, %g4, %g5)
  112. CSUM_BIGCHUNK(%o0, 0x20, %o2, %o4, %o5, %g2, %g3, %g4, %g5)
  113. CSUM_BIGCHUNK(%o0, 0x40, %o2, %o4, %o5, %g2, %g3, %g4, %g5)
  114. CSUM_BIGCHUNK(%o0, 0x60, %o2, %o4, %o5, %g2, %g3, %g4, %g5)
  115. addx %g0, %o2, %o2 ! sink in final carry
  116. subcc %o3, 128, %o3 ! detract from loop iters
  117. bne 5b ! more to do
  118. add %o0, 128, %o0 ! advance buf ptr
  119. andcc %o1, 0x70, %g1 ! clears carry flag too
  120. 3: be cpte ! nope
  121. andcc %o1, 0xf, %g0 ! anything left at all?
  122. srl %g1, 1, %o4 ! compute offset
  123. sub %g7, %g1, %g7 ! adjust jmp ptr
  124. sub %g7, %o4, %g7 ! final jmp ptr adjust
  125. jmp %g7 + %lo(cpte - 8) ! enter the table
  126. add %o0, %g1, %o0 ! advance buf ptr
  127. cptbl: CSUM_LASTCHUNK(%o0, 0x68, %o2, %g2, %g3, %g4, %g5)
  128. CSUM_LASTCHUNK(%o0, 0x58, %o2, %g2, %g3, %g4, %g5)
  129. CSUM_LASTCHUNK(%o0, 0x48, %o2, %g2, %g3, %g4, %g5)
  130. CSUM_LASTCHUNK(%o0, 0x38, %o2, %g2, %g3, %g4, %g5)
  131. CSUM_LASTCHUNK(%o0, 0x28, %o2, %g2, %g3, %g4, %g5)
  132. CSUM_LASTCHUNK(%o0, 0x18, %o2, %g2, %g3, %g4, %g5)
  133. CSUM_LASTCHUNK(%o0, 0x08, %o2, %g2, %g3, %g4, %g5)
  134. addx %g0, %o2, %o2 ! fetch final carry
  135. andcc %o1, 0xf, %g0 ! anything left at all?
  136. cpte: bne csum_partial_end_cruft ! yep, handle it
  137. andcc %o1, 8, %g0 ! check how much
  138. cpout: retl ! get outta here
  139. mov %o2, %o0 ! return computed csum
  140. /* Work around cpp -rob */
  141. #define ALLOC #alloc
  142. #define EXECINSTR #execinstr
  143. #define EX(x,y) \
  144. 98: x,y; \
  145. .section __ex_table,ALLOC; \
  146. .align 4; \
  147. .word 98b, cc_fault; \
  148. .text; \
  149. .align 4
  150. /* This aligned version executes typically in 8.5 superscalar cycles, this
  151. * is the best I can do. I say 8.5 because the final add will pair with
  152. * the next ldd in the main unrolled loop. Thus the pipe is always full.
  153. * If you change these macros (including order of instructions),
  154. * please check the fixup code below as well.
  155. */
  156. #define CSUMCOPY_BIGCHUNK_ALIGNED(src, dst, sum, off, t0, t1, t2, t3, t4, t5, t6, t7) \
  157. EX(ldd [src + off + 0x00], t0); \
  158. EX(ldd [src + off + 0x08], t2); \
  159. addxcc t0, sum, sum; \
  160. EX(ldd [src + off + 0x10], t4); \
  161. addxcc t1, sum, sum; \
  162. EX(ldd [src + off + 0x18], t6); \
  163. addxcc t2, sum, sum; \
  164. EX(std t0, [dst + off + 0x00]); \
  165. addxcc t3, sum, sum; \
  166. EX(std t2, [dst + off + 0x08]); \
  167. addxcc t4, sum, sum; \
  168. EX(std t4, [dst + off + 0x10]); \
  169. addxcc t5, sum, sum; \
  170. EX(std t6, [dst + off + 0x18]); \
  171. addxcc t6, sum, sum; \
  172. addxcc t7, sum, sum;
  173. /* 12 superscalar cycles seems to be the limit for this case,
  174. * because of this we thus do all the ldd's together to get
  175. * Viking MXCC into streaming mode. Ho hum...
  176. */
  177. #define CSUMCOPY_BIGCHUNK(src, dst, sum, off, t0, t1, t2, t3, t4, t5, t6, t7) \
  178. EX(ldd [src + off + 0x00], t0); \
  179. EX(ldd [src + off + 0x08], t2); \
  180. EX(ldd [src + off + 0x10], t4); \
  181. EX(ldd [src + off + 0x18], t6); \
  182. EX(st t0, [dst + off + 0x00]); \
  183. addxcc t0, sum, sum; \
  184. EX(st t1, [dst + off + 0x04]); \
  185. addxcc t1, sum, sum; \
  186. EX(st t2, [dst + off + 0x08]); \
  187. addxcc t2, sum, sum; \
  188. EX(st t3, [dst + off + 0x0c]); \
  189. addxcc t3, sum, sum; \
  190. EX(st t4, [dst + off + 0x10]); \
  191. addxcc t4, sum, sum; \
  192. EX(st t5, [dst + off + 0x14]); \
  193. addxcc t5, sum, sum; \
  194. EX(st t6, [dst + off + 0x18]); \
  195. addxcc t6, sum, sum; \
  196. EX(st t7, [dst + off + 0x1c]); \
  197. addxcc t7, sum, sum;
  198. /* Yuck, 6 superscalar cycles... */
  199. #define CSUMCOPY_LASTCHUNK(src, dst, sum, off, t0, t1, t2, t3) \
  200. EX(ldd [src - off - 0x08], t0); \
  201. EX(ldd [src - off - 0x00], t2); \
  202. addxcc t0, sum, sum; \
  203. EX(st t0, [dst - off - 0x08]); \
  204. addxcc t1, sum, sum; \
  205. EX(st t1, [dst - off - 0x04]); \
  206. addxcc t2, sum, sum; \
  207. EX(st t2, [dst - off - 0x00]); \
  208. addxcc t3, sum, sum; \
  209. EX(st t3, [dst - off + 0x04]);
  210. /* Handle the end cruft code out of band for better cache patterns. */
  211. cc_end_cruft:
  212. be 1f
  213. andcc %o3, 4, %g0
  214. EX(ldd [%o0 + 0x00], %g2)
  215. add %o1, 8, %o1
  216. addcc %g2, %g7, %g7
  217. add %o0, 8, %o0
  218. addxcc %g3, %g7, %g7
  219. EX(st %g2, [%o1 - 0x08])
  220. addx %g0, %g7, %g7
  221. andcc %o3, 4, %g0
  222. EX(st %g3, [%o1 - 0x04])
  223. 1: be 1f
  224. andcc %o3, 3, %o3
  225. EX(ld [%o0 + 0x00], %g2)
  226. add %o1, 4, %o1
  227. addcc %g2, %g7, %g7
  228. EX(st %g2, [%o1 - 0x04])
  229. addx %g0, %g7, %g7
  230. andcc %o3, 3, %g0
  231. add %o0, 4, %o0
  232. 1: be 1f
  233. addcc %o3, -1, %g0
  234. bne 2f
  235. subcc %o3, 2, %o3
  236. b 4f
  237. or %g0, %g0, %o4
  238. 2: EX(lduh [%o0 + 0x00], %o4)
  239. add %o0, 2, %o0
  240. EX(sth %o4, [%o1 + 0x00])
  241. be 6f
  242. add %o1, 2, %o1
  243. sll %o4, 16, %o4
  244. 4: EX(ldub [%o0 + 0x00], %o5)
  245. EX(stb %o5, [%o1 + 0x00])
  246. sll %o5, 8, %o5
  247. or %o5, %o4, %o4
  248. 6: addcc %o4, %g7, %g7
  249. 1: retl
  250. addx %g0, %g7, %o0
  251. /* Also, handle the alignment code out of band. */
  252. cc_dword_align:
  253. cmp %g1, 16
  254. bge 1f
  255. srl %g1, 1, %o3
  256. 2: cmp %o3, 0
  257. be,a ccte
  258. andcc %g1, 0xf, %o3
  259. andcc %o3, %o0, %g0 ! Check %o0 only (%o1 has the same last 2 bits)
  260. be,a 2b
  261. srl %o3, 1, %o3
  262. 1: andcc %o0, 0x1, %g0
  263. bne ccslow
  264. andcc %o0, 0x2, %g0
  265. be 1f
  266. andcc %o0, 0x4, %g0
  267. EX(lduh [%o0 + 0x00], %g4)
  268. sub %g1, 2, %g1
  269. EX(sth %g4, [%o1 + 0x00])
  270. add %o0, 2, %o0
  271. sll %g4, 16, %g4
  272. addcc %g4, %g7, %g7
  273. add %o1, 2, %o1
  274. srl %g7, 16, %g3
  275. addx %g0, %g3, %g4
  276. sll %g7, 16, %g7
  277. sll %g4, 16, %g3
  278. srl %g7, 16, %g7
  279. andcc %o0, 0x4, %g0
  280. or %g3, %g7, %g7
  281. 1: be 3f
  282. andcc %g1, 0xffffff80, %g0
  283. EX(ld [%o0 + 0x00], %g4)
  284. sub %g1, 4, %g1
  285. EX(st %g4, [%o1 + 0x00])
  286. add %o0, 4, %o0
  287. addcc %g4, %g7, %g7
  288. add %o1, 4, %o1
  289. addx %g0, %g7, %g7
  290. b 3f
  291. andcc %g1, 0xffffff80, %g0
  292. /* Sun, you just can't beat me, you just can't. Stop trying,
  293. * give up. I'm serious, I am going to kick the living shit
  294. * out of you, game over, lights out.
  295. */
  296. .align 8
  297. .globl __csum_partial_copy_sparc_generic
  298. EXPORT_SYMBOL(__csum_partial_copy_sparc_generic)
  299. __csum_partial_copy_sparc_generic:
  300. /* %o0=src, %o1=dest, %g1=len, %g7=sum */
  301. xor %o0, %o1, %o4 ! get changing bits
  302. andcc %o4, 3, %g0 ! check for mismatched alignment
  303. bne ccslow ! better this than unaligned/fixups
  304. andcc %o0, 7, %g0 ! need to align things?
  305. bne cc_dword_align ! yes, we check for short lengths there
  306. andcc %g1, 0xffffff80, %g0 ! can we use unrolled loop?
  307. 3: be 3f ! nope, less than one loop remains
  308. andcc %o1, 4, %g0 ! dest aligned on 4 or 8 byte boundary?
  309. be ccdbl + 4 ! 8 byte aligned, kick ass
  310. 5: CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x00,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3)
  311. CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x20,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3)
  312. CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x40,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3)
  313. CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x60,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3)
  314. sub %g1, 128, %g1 ! detract from length
  315. addx %g0, %g7, %g7 ! add in last carry bit
  316. andcc %g1, 0xffffff80, %g0 ! more to csum?
  317. add %o0, 128, %o0 ! advance src ptr
  318. bne 5b ! we did not go negative, continue looping
  319. add %o1, 128, %o1 ! advance dest ptr
  320. 3: andcc %g1, 0x70, %o2 ! can use table?
  321. ccmerge:be ccte ! nope, go and check for end cruft
  322. andcc %g1, 0xf, %o3 ! get low bits of length (clears carry btw)
  323. srl %o2, 1, %o4 ! begin negative offset computation
  324. sethi %hi(12f), %o5 ! set up table ptr end
  325. add %o0, %o2, %o0 ! advance src ptr
  326. sub %o5, %o4, %o5 ! continue table calculation
  327. sll %o2, 1, %g2 ! constant multiplies are fun...
  328. sub %o5, %g2, %o5 ! some more adjustments
  329. jmp %o5 + %lo(12f) ! jump into it, duff style, wheee...
  330. add %o1, %o2, %o1 ! advance dest ptr (carry is clear btw)
  331. cctbl: CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x68,%g2,%g3,%g4,%g5)
  332. CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x58,%g2,%g3,%g4,%g5)
  333. CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x48,%g2,%g3,%g4,%g5)
  334. CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x38,%g2,%g3,%g4,%g5)
  335. CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x28,%g2,%g3,%g4,%g5)
  336. CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x18,%g2,%g3,%g4,%g5)
  337. CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x08,%g2,%g3,%g4,%g5)
  338. 12: addx %g0, %g7, %g7
  339. andcc %o3, 0xf, %g0 ! check for low bits set
  340. ccte: bne cc_end_cruft ! something left, handle it out of band
  341. andcc %o3, 8, %g0 ! begin checks for that code
  342. retl ! return
  343. mov %g7, %o0 ! give em the computed checksum
  344. ccdbl: CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x00,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3)
  345. CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x20,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3)
  346. CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x40,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3)
  347. CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x60,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3)
  348. sub %g1, 128, %g1 ! detract from length
  349. addx %g0, %g7, %g7 ! add in last carry bit
  350. andcc %g1, 0xffffff80, %g0 ! more to csum?
  351. add %o0, 128, %o0 ! advance src ptr
  352. bne ccdbl ! we did not go negative, continue looping
  353. add %o1, 128, %o1 ! advance dest ptr
  354. b ccmerge ! finish it off, above
  355. andcc %g1, 0x70, %o2 ! can use table? (clears carry btw)
  356. ccslow: cmp %g1, 0
  357. mov 0, %g5
  358. bleu 4f
  359. andcc %o0, 1, %o5
  360. be,a 1f
  361. srl %g1, 1, %g4
  362. sub %g1, 1, %g1
  363. EX(ldub [%o0], %g5)
  364. add %o0, 1, %o0
  365. EX(stb %g5, [%o1])
  366. srl %g1, 1, %g4
  367. add %o1, 1, %o1
  368. 1: cmp %g4, 0
  369. be,a 3f
  370. andcc %g1, 1, %g0
  371. andcc %o0, 2, %g0
  372. be,a 1f
  373. srl %g4, 1, %g4
  374. EX(lduh [%o0], %o4)
  375. sub %g1, 2, %g1
  376. srl %o4, 8, %g2
  377. sub %g4, 1, %g4
  378. EX(stb %g2, [%o1])
  379. add %o4, %g5, %g5
  380. EX(stb %o4, [%o1 + 1])
  381. add %o0, 2, %o0
  382. srl %g4, 1, %g4
  383. add %o1, 2, %o1
  384. 1: cmp %g4, 0
  385. be,a 2f
  386. andcc %g1, 2, %g0
  387. EX(ld [%o0], %o4)
  388. 5: srl %o4, 24, %g2
  389. srl %o4, 16, %g3
  390. EX(stb %g2, [%o1])
  391. srl %o4, 8, %g2
  392. EX(stb %g3, [%o1 + 1])
  393. add %o0, 4, %o0
  394. EX(stb %g2, [%o1 + 2])
  395. addcc %o4, %g5, %g5
  396. EX(stb %o4, [%o1 + 3])
  397. addx %g5, %g0, %g5 ! I am now to lazy to optimize this (question it
  398. add %o1, 4, %o1 ! is worthy). Maybe some day - with the sll/srl
  399. subcc %g4, 1, %g4 ! tricks
  400. bne,a 5b
  401. EX(ld [%o0], %o4)
  402. sll %g5, 16, %g2
  403. srl %g5, 16, %g5
  404. srl %g2, 16, %g2
  405. andcc %g1, 2, %g0
  406. add %g2, %g5, %g5
  407. 2: be,a 3f
  408. andcc %g1, 1, %g0
  409. EX(lduh [%o0], %o4)
  410. andcc %g1, 1, %g0
  411. srl %o4, 8, %g2
  412. add %o0, 2, %o0
  413. EX(stb %g2, [%o1])
  414. add %g5, %o4, %g5
  415. EX(stb %o4, [%o1 + 1])
  416. add %o1, 2, %o1
  417. 3: be,a 1f
  418. sll %g5, 16, %o4
  419. EX(ldub [%o0], %g2)
  420. sll %g2, 8, %o4
  421. EX(stb %g2, [%o1])
  422. add %g5, %o4, %g5
  423. sll %g5, 16, %o4
  424. 1: addcc %o4, %g5, %g5
  425. srl %g5, 16, %o4
  426. addx %g0, %o4, %g5
  427. orcc %o5, %g0, %g0
  428. be 4f
  429. srl %g5, 8, %o4
  430. and %g5, 0xff, %g2
  431. and %o4, 0xff, %o4
  432. sll %g2, 8, %g2
  433. or %g2, %o4, %g5
  434. 4: addcc %g7, %g5, %g7
  435. retl
  436. addx %g0, %g7, %o0
  437. /* We do these strange calculations for the csum_*_from_user case only, ie.
  438. * we only bother with faults on loads... */
  439. cc_fault:
  440. retl
  441. clr %o0