diff --git a/sm3/sm3blocks_s390x.s b/sm3/sm3blocks_s390x.s index 358ecf9..b716f6f 100644 --- a/sm3/sm3blocks_s390x.s +++ b/sm3/sm3blocks_s390x.s @@ -44,17 +44,23 @@ TEXT ·transposeMatrix(SB),NOSPLIT,$0 VL (R2), V6 VL 16(R2), V7 + MOVD $mask<>+0x00(SB), R2 + VLM (R2), V8, V11 + + TRANSPOSE_MATRIX(V0, V2, V4, V6, V8, V9, V10, V11, V12, V13, V14, V15) + TRANSPOSE_MATRIX(V1, V3, V5, V7, V8, V9, V10, V11, V12, V13, V14, V15) + MOVD 0(R1), R2 - VST V6, (R2) - VST V7, 16(R2) - MOVD 8(R1), R2 - VST V4, (R2) - VST V5, 16(R2) - MOVD 16(R1), R2 - VST V2, (R2) - VST V3, 16(R2) - MOVD 24(R1), R2 VST V0, (R2) VST V1, 16(R2) + MOVD 8(R1), R2 + VST V2, (R2) + VST V3, 16(R2) + MOVD 16(R1), R2 + VST V4, (R2) + VST V5, 16(R2) + MOVD 24(R1), R2 + VST V6, (R2) + VST V7, 16(R2) RET diff --git a/sm3/sm3blocks_s390x_test.go b/sm3/sm3blocks_s390x_test.go index f785466..94021ef 100644 --- a/sm3/sm3blocks_s390x_test.go +++ b/sm3/sm3blocks_s390x_test.go @@ -24,7 +24,6 @@ func TestTransposeMatrix(t *testing.T) { fmt.Println() for i := 0; i < 4; i++ { for j := 0; j < 8; j++ { - m[i][j] = uint32(i*4 + j) fmt.Printf("%04x ", m[i][j]) } fmt.Println()