salimma / rpms / ceph

Forked from rpms/ceph 2 years ago
Clone
5c46ad7
--- ceph-15.2.2/src/common/crc32c_intel_fast_zero_asm.s.orig	2020-05-26 08:34:32.226201974 -0400
abcc0b7
+++ ceph-15.2.2/src/common/crc32c_intel_fast_zero_asm.s	2020-05-26 17:19:32.497201974 -0400
5c46ad7
@@ -1,5 +1,5 @@
5c46ad7
 ;
5c46ad7
-; Copyright 2012-2013 Intel Corporation All Rights Reserved.
5c46ad7
+; Copyright 2012-2015 Intel Corporation All Rights Reserved.
5c46ad7
 ; All rights reserved.
5c46ad7
 ;
5c46ad7
 ; http://opensource.org/licenses/BSD-3-Clause
5c46ad7
@@ -59,6 +59,19 @@
5c46ad7
 	xor     rbx, rbx                ;; rbx = crc1 = 0;
5c46ad7
 	xor     r10, r10                ;; r10 = crc2 = 0;
5c46ad7
 
5c46ad7
+	cmp	len, %%bSize*3*2
5c46ad7
+	jbe	%%non_prefetch
5c46ad7
+
5c46ad7
+ %assign i 0
5c46ad7
+ %rep %%bSize/8 - 1
5c46ad7
+	crc32   rax, bufptmp  ;; update crc0
5c46ad7
+	crc32   rbx, bufptmp  ;; update crc1
5c46ad7
+	crc32   r10, bufptmp  ;; update crc2
5c46ad7
+	%assign i (i+8)
5c46ad7
+ %endrep
66d0b21
+	jmp %%next %+ %1
5c46ad7
+
5c46ad7
+%%non_prefetch:
5c46ad7
  %assign i 0
5c46ad7
  %rep %%bSize/8 - 1
5c46ad7
 	crc32   rax, bufptmp  ;; update crc0
5c46ad7
@@ -66,6 +79,8 @@
5c46ad7
 	crc32   r10, bufptmp  ;; update crc2
5c46ad7
 	%assign i (i+8)
5c46ad7
  %endrep
5c46ad7
+
5c46ad7
+%%next %+ %1:
5c46ad7
 	crc32   rax, bufptmp  ;; update crc0
5c46ad7
 	crc32   rbx, bufptmp  ;; update crc1
5c46ad7
 ; SKIP  ;crc32  r10, bufptmp  ;; update crc2
5c46ad7
@@ -180,12 +195,15 @@
5c46ad7
 %define crc_init_dw     r8d
5c46ad7
 %endif
5c46ad7
 
5c46ad7
-
5c46ad7
+	endbranch
5c46ad7
 	push    rdi
5c46ad7
 	push    rbx
5c46ad7
 
5c46ad7
 	mov     rax, crc_init           ;; rax = crc_init;
5c46ad7
 
5c46ad7
+	cmp	len, 8
5c46ad7
+	jb	less_than_8
5c46ad7
+
5c46ad7
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c46ad7
 ;; 1) ALIGN: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c46ad7