@@ -15,7 +15,6 @@ static void xor_xc_2(unsigned long bytes, unsigned long * __restrict p1,
1515 const unsigned long * __restrict p2 )
1616{
1717 asm volatile (
18- " larl 1,2f\n"
1918 " aghi %0,-1\n"
2019 " jm 3f\n"
2120 " srlg 0,%0,8\n"
@@ -25,22 +24,21 @@ static void xor_xc_2(unsigned long bytes, unsigned long * __restrict p1,
2524 " la %1,256(%1)\n"
2625 " la %2,256(%2)\n"
2726 " brctg 0,0b\n"
28- "1: ex %0,0(1) \n"
27+ "1: exrl %0,2f \n"
2928 " j 3f\n"
3029 "2: xc 0(1,%1),0(%2)\n"
3130 "3:\n"
3231 : : "d" (bytes ), "a" (p1 ), "a" (p2 )
33- : "0" , "1" , " cc" , "memory" );
32+ : "0" , "cc" , "memory" );
3433}
3534
3635static void xor_xc_3 (unsigned long bytes , unsigned long * __restrict p1 ,
3736 const unsigned long * __restrict p2 ,
3837 const unsigned long * __restrict p3 )
3938{
4039 asm volatile (
41- " larl 1,2f\n"
4240 " aghi %0,-1\n"
43- " jm 3f \n"
41+ " jm 4f \n"
4442 " srlg 0,%0,8\n"
4543 " ltgr 0,0\n"
4644 " jz 1f\n"
@@ -50,14 +48,14 @@ static void xor_xc_3(unsigned long bytes, unsigned long * __restrict p1,
5048 " la %2,256(%2)\n"
5149 " la %3,256(%3)\n"
5250 " brctg 0,0b\n"
53- "1: ex %0,0(1) \n"
54- " ex %0,6(1) \n"
55- " j 3f \n"
51+ "1: exrl %0,2f \n"
52+ " exrl %0,3f \n"
53+ " j 4f \n"
5654 "2: xc 0(1,%1),0(%2)\n"
57- " xc 0(1,%1),0(%3)\n"
58- "3 :\n"
55+ "3: xc 0(1,%1),0(%3)\n"
56+ "4 :\n"
5957 : "+d" (bytes ), "+a" (p1 ), "+a" (p2 ), "+a" (p3 )
60- : : "0" , "1" , " cc" , "memory" );
58+ : : "0" , "cc" , "memory" );
6159}
6260
6361static void xor_xc_4 (unsigned long bytes , unsigned long * __restrict p1 ,
@@ -66,9 +64,8 @@ static void xor_xc_4(unsigned long bytes, unsigned long * __restrict p1,
6664 const unsigned long * __restrict p4 )
6765{
6866 asm volatile (
69- " larl 1,2f\n"
7067 " aghi %0,-1\n"
71- " jm 3f \n"
68+ " jm 5f \n"
7269 " srlg 0,%0,8\n"
7370 " ltgr 0,0\n"
7471 " jz 1f\n"
@@ -80,16 +77,16 @@ static void xor_xc_4(unsigned long bytes, unsigned long * __restrict p1,
8077 " la %3,256(%3)\n"
8178 " la %4,256(%4)\n"
8279 " brctg 0,0b\n"
83- "1: ex %0,0(1) \n"
84- " ex %0,6(1) \n"
85- " ex %0,12(1) \n"
86- " j 3f \n"
80+ "1: exrl %0,2f \n"
81+ " exrl %0,3f \n"
82+ " exrl %0,4f \n"
83+ " j 5f \n"
8784 "2: xc 0(1,%1),0(%2)\n"
88- " xc 0(1,%1),0(%3)\n"
89- " xc 0(1,%1),0(%4)\n"
90- "3 :\n"
85+ "3: xc 0(1,%1),0(%3)\n"
86+ "4: xc 0(1,%1),0(%4)\n"
87+ "5 :\n"
9188 : "+d" (bytes ), "+a" (p1 ), "+a" (p2 ), "+a" (p3 ), "+a" (p4 )
92- : : "0" , "1" , " cc" , "memory" );
89+ : : "0" , "cc" , "memory" );
9390}
9491
9592static void xor_xc_5 (unsigned long bytes , unsigned long * __restrict p1 ,
@@ -101,7 +98,7 @@ static void xor_xc_5(unsigned long bytes, unsigned long * __restrict p1,
10198 asm volatile (
10299 " larl 1,2f\n"
103100 " aghi %0,-1\n"
104- " jm 3f \n"
101+ " jm 6f \n"
105102 " srlg 0,%0,8\n"
106103 " ltgr 0,0\n"
107104 " jz 1f\n"
@@ -115,19 +112,19 @@ static void xor_xc_5(unsigned long bytes, unsigned long * __restrict p1,
115112 " la %4,256(%4)\n"
116113 " la %5,256(%5)\n"
117114 " brctg 0,0b\n"
118- "1: ex %0,0(1) \n"
119- " ex %0,6(1) \n"
120- " ex %0,12(1) \n"
121- " ex %0,18(1) \n"
122- " j 3f \n"
115+ "1: exrl %0,2f \n"
116+ " exrl %0,3f \n"
117+ " exrl %0,4f \n"
118+ " exrl %0,5f \n"
119+ " j 6f \n"
123120 "2: xc 0(1,%1),0(%2)\n"
124- " xc 0(1,%1),0(%3)\n"
125- " xc 0(1,%1),0(%4)\n"
126- " xc 0(1,%1),0(%5)\n"
127- "3 :\n"
121+ "3: xc 0(1,%1),0(%3)\n"
122+ "4: xc 0(1,%1),0(%4)\n"
123+ "5: xc 0(1,%1),0(%5)\n"
124+ "6 :\n"
128125 : "+d" (bytes ), "+a" (p1 ), "+a" (p2 ), "+a" (p3 ), "+a" (p4 ),
129126 "+a" (p5 )
130- : : "0" , "1" , " cc" , "memory" );
127+ : : "0" , "cc" , "memory" );
131128}
132129
133130struct xor_block_template xor_block_xc = {
0 commit comments