sha/asm/sha512p8-ppc.pl: optimize epilogue.
authorAndy Polyakov <appro@openssl.org>
Thu, 15 Nov 2018 14:47:46 +0000 (15:47 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 16 Nov 2018 08:23:50 +0000 (09:23 +0100)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7643)

crypto/sha/asm/sha512p8-ppc.pl

index d7ad17b29f38d8a75cd687417a2985987ebb6f3a..0d4fdd292c07a555ba7894fbedfab50b168130a8 100755 (executable)
@@ -286,24 +286,17 @@ $code.=<<___              if ($SZ==8);
        stvx_u          $G,$x30,$ctx
 ___
 $code.=<<___;
-       li              r10,`$LOCALS+15`
+       addi            $offload,$sp,`$LOCALS+15`
        mtlr            $lrsave
-       li              r11,`$LOCALS+31`
        mtspr           256,$vrsave
-       lvx             v24,r10,$sp             # ABI says so
-       addi            r10,r10,32
-       lvx             v25,r11,$sp
-       addi            r11,r11,32
-       lvx             v26,r10,$sp
-       addi            r10,r10,32
-       lvx             v27,r11,$sp
-       addi            r11,r11,32
-       lvx             v28,r10,$sp
-       addi            r10,r10,32
-       lvx             v29,r11,$sp
-       addi            r11,r11,32
-       lvx             v30,r10,$sp
-       lvx             v31,r11,$sp
+       lvx             v24,$x00,$offload       # ABI says so
+       lvx             v25,$x10,$offload
+       lvx             v26,$x20,$offload
+       lvx             v27,$x30,$offload
+       lvx             v28,$x40,$offload
+       lvx             v29,$x50,$offload
+       lvx             v30,$x60,$offload
+       lvx             v31,$x70,$offload
        $POP            r26,`$FRAME-6*$SIZE_T`($sp)
        $POP            r27,`$FRAME-5*$SIZE_T`($sp)
        $POP            r28,`$FRAME-4*$SIZE_T`($sp)