aboutsummaryrefslogtreecommitdiff
path: root/src/hash
diff options
context:
space:
mode:
authorIlya Tocar <ilya.tocar@intel.com>2018-03-01 12:52:21 -0600
committerIlya Tocar <ilya.tocar@intel.com>2018-03-01 19:20:53 +0000
commit93665c0d81c4e675e8c9b86b4e43654a9504edbc (patch)
tree7edb9114a139db64879c6e785a3408c896d7bbb5 /src/hash
parent5d11838654464c42de48958ff163360da38ab850 (diff)
downloadgo-93665c0d81c4e675e8c9b86b4e43654a9504edbc.tar.gz
go-93665c0d81c4e675e8c9b86b4e43654a9504edbc.zip
crypto: remove hand encoded amd64 instructions
Replace BYTE.. encodings with asm. This is possible due to asm implementing more instructions and removal of MOV $0, reg -> XOR reg, reg transformation from asm. Change-Id: I011749ab6b3f64403ab6e746f3760c5841548b57 Reviewed-on: https://go-review.googlesource.com/97936 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/hash')
-rw-r--r--src/hash/crc32/crc32_amd64.s12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/hash/crc32/crc32_amd64.s b/src/hash/crc32/crc32_amd64.s
index d49093602e..a944ead9b2 100644
--- a/src/hash/crc32/crc32_amd64.s
+++ b/src/hash/crc32/crc32_amd64.s
@@ -37,8 +37,7 @@ align_2:
BTQ $1, BX
JNC align_4
- // CRC32W (SI), AX
- BYTE $0x66; BYTE $0xf2; BYTE $0x0f; BYTE $0x38; BYTE $0xf1; BYTE $0x06
+ CRC32W (SI), AX
SUBQ $2, CX
ADDQ $2, SI
@@ -47,8 +46,7 @@ align_4:
BTQ $2, BX
JNC aligned
- // CRC32L (SI), AX
- BYTE $0xf2; BYTE $0x0f; BYTE $0x38; BYTE $0xf1; BYTE $0x06
+ CRC32L (SI), AX
SUBQ $4, CX
ADDQ $4, SI
@@ -68,16 +66,14 @@ less_than_8:
BTQ $2, CX
JNC less_than_4
- // CRC32L (SI), AX
- BYTE $0xf2; BYTE $0x0f; BYTE $0x38; BYTE $0xf1; BYTE $0x06
+ CRC32L (SI), AX
ADDQ $4, SI
less_than_4:
BTQ $1, CX
JNC less_than_2
- // CRC32W (SI), AX
- BYTE $0x66; BYTE $0xf2; BYTE $0x0f; BYTE $0x38; BYTE $0xf1; BYTE $0x06
+ CRC32W (SI), AX
ADDQ $2, SI
less_than_2: