crc32c_asm.S 629 B

1234567891011121314151617181920212223242526272829
  1. #include <linux/linkage.h>
  2. #include <asm/visasm.h>
  3. #include <asm/asi.h>
  4. #define F3F(x,y,z) (((x)<<30)|((y)<<19)|((z)<<5))
  5. #define FPD_ENCODE(x) (((x) >> 5) | ((x) & ~(0x20)))
  6. #define RS1(x) (FPD_ENCODE(x) << 14)
  7. #define RS2(x) (FPD_ENCODE(x) << 0)
  8. #define RD(x) (FPD_ENCODE(x) << 25)
  9. #define CRC32C(a,b,c) \
  10. .word (F3F(2,0x36,0x147)|RS1(a)|RS2(b)|RD(c));
  11. ENTRY(crc32c_sparc64)
  12. /* %o0=crc32p, %o1=data_ptr, %o2=len */
  13. VISEntryHalf
  14. lda [%o0] ASI_PL, %f1
  15. 1: ldd [%o1], %f2
  16. CRC32C(0,2,0)
  17. subcc %o2, 8, %o2
  18. bne,pt %icc, 1b
  19. add %o1, 0x8, %o1
  20. sta %f1, [%o0] ASI_PL
  21. VISExitHalf
  22. 2: retl
  23. nop
  24. ENDPROC(crc32c_sparc64)