Commit 3f3142ad authored by bill_ofarrell's avatar bill_ofarrell Committed by Michael Munday

cmd/asm: add s390x VMSLG instruction variants

VMSLG has three variants on z14 and later machines. These variants are used in "limbified" squaring:
VMSLEG: Even Shift Indication -- the even-indexed intermediate result is doubled
VMSLOG: Odd Shift Indication -- the odd-indexed intermediate result is doubled
VMSLEOG: Even and Odd Shift Indication -- both intermediate results are doubled
Limbified squaring is very useful for high performance cryptographic algorithms, such as
elliptic curve. This change allows these instructions to be used in Go assembly.

Change-Id: Iaad577b07320205539f99b3cb37a2a984882721b
Reviewed-on: https://go-review.googlesource.com/c/145180Reviewed-by: default avatarMichael Munday <mike.munday@ibm.com>
parent 5c359736
...@@ -369,6 +369,9 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16- ...@@ -369,6 +369,9 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16-
VSTEH $7, V31, (R2) // e7f020007809 VSTEH $7, V31, (R2) // e7f020007809
VSTEB $15, V29, 4094(R12) // e7d0cffef808 VSTEB $15, V29, 4094(R12) // e7d0cffef808
VMSLG V21, V22, V23, V24 // e78563007fb8 VMSLG V21, V22, V23, V24 // e78563007fb8
VMSLEG V21, V22, V23, V24 // e78563807fb8
VMSLOG V21, V22, V23, V24 // e78563407fb8
VMSLEOG V21, V22, V23, V24 // e78563c07fb8
RET RET
RET foo(SB) RET foo(SB)
......
...@@ -945,6 +945,9 @@ const ( ...@@ -945,6 +945,9 @@ const (
AVUPLHW AVUPLHW
AVUPLF AVUPLF
AVMSLG AVMSLG
AVMSLEG
AVMSLOG
AVMSLEOG
// binary // binary
ABYTE ABYTE
......
...@@ -678,6 +678,9 @@ var Anames = []string{ ...@@ -678,6 +678,9 @@ var Anames = []string{
"VUPLHW", "VUPLHW",
"VUPLF", "VUPLF",
"VMSLG", "VMSLG",
"VMSLEG",
"VMSLOG",
"VMSLEOG",
"BYTE", "BYTE",
"WORD", "WORD",
"DWORD", "DWORD",
......
...@@ -1379,6 +1379,9 @@ func buildop(ctxt *obj.Link) { ...@@ -1379,6 +1379,9 @@ func buildop(ctxt *obj.Link) {
opset(AVSBCBIQ, r) opset(AVSBCBIQ, r)
opset(AVSBIQ, r) opset(AVSBIQ, r)
opset(AVMSLG, r) opset(AVMSLG, r)
opset(AVMSLEG, r)
opset(AVMSLOG, r)
opset(AVMSLEOG, r)
case AVSEL: case AVSEL:
opset(AVFMADB, r) opset(AVFMADB, r)
opset(AWFMADB, r) opset(AWFMADB, r)
......
...@@ -45,7 +45,7 @@ func vop(as obj.As) (opcode, es, cs uint32) { ...@@ -45,7 +45,7 @@ func vop(as obj.As) (opcode, es, cs uint32) {
return op_VAC, 0, 0 return op_VAC, 0, 0
case AVACQ: case AVACQ:
return op_VAC, 4, 0 return op_VAC, 4, 0
case AVMSLG: case AVMSLG, AVMSLEG, AVMSLOG, AVMSLEOG:
return op_VMSL, 3, 0 return op_VMSL, 3, 0
case AVACCC: case AVACCC:
return op_VACCC, 0, 0 return op_VACCC, 0, 0
...@@ -1058,6 +1058,12 @@ func singleElementMask(as obj.As) uint32 { ...@@ -1058,6 +1058,12 @@ func singleElementMask(as obj.As) uint32 {
AWFTCIDB, AWFTCIDB,
AWFIDB: AWFIDB:
return 8 return 8
case AVMSLEG:
return 8
case AVMSLOG:
return 4
case AVMSLEOG:
return 12
} }
return 0 return 0
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment