Skip to content

Commit 3c65bb5

Browse files
wgomundaym
authored andcommitted
cmd/asm: add s390x VMSLG instruction
This instruction was introduced on the z14 to accelerate "limbified" multiplications for certain cryptographic algorithms. This change allows it to be used in Go assembly. Change-Id: Ic93dae7fec1756f662874c08a5abc435bce9dd9e Reviewed-on: https://go-review.googlesource.com/109695 Run-TryBot: Michael Munday <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent d7f5c03 commit 3c65bb5

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

src/cmd/asm/internal/asm/testdata/s390x.s

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16-
367367
VSTEF $3, V2, (R9) // e7209000300b
368368
VSTEH $7, V31, (R2) // e7f020007809
369369
VSTEB $15, V29, 4094(R12) // e7d0cffef808
370+
VMSLG V21, V22, V23, V24 // e78563007fb8
370371

371372
RET
372373
RET foo(SB)

src/cmd/internal/obj/s390x/a.out.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,7 @@ const (
941941
AVUPLB
942942
AVUPLHW
943943
AVUPLF
944+
AVMSLG
944945

945946
// binary
946947
ABYTE

src/cmd/internal/obj/s390x/anames.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ var Anames = []string{
677677
"VUPLB",
678678
"VUPLHW",
679679
"VUPLF",
680+
"VMSLG",
680681
"BYTE",
681682
"WORD",
682683
"DWORD",

src/cmd/internal/obj/s390x/asmz.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,7 @@ func buildop(ctxt *obj.Link) {
13761376
opset(AVSTRCZFS, r)
13771377
opset(AVSBCBIQ, r)
13781378
opset(AVSBIQ, r)
1379+
opset(AVMSLG, r)
13791380
case AVSEL:
13801381
opset(AVFMADB, r)
13811382
opset(AWFMADB, r)
@@ -2529,6 +2530,7 @@ const (
25292530
op_VUPLH uint32 = 0xE7D5 // VRR-a VECTOR UNPACK LOGICAL HIGH
25302531
op_VUPLL uint32 = 0xE7D4 // VRR-a VECTOR UNPACK LOGICAL LOW
25312532
op_VUPL uint32 = 0xE7D6 // VRR-a VECTOR UNPACK LOW
2533+
op_VMSL uint32 = 0xE7B8 // VRR-d VECTOR MULTIPLY SUM LOGICAL
25322534
)
25332535

25342536
func oclass(a *obj.Addr) int {

src/cmd/internal/obj/s390x/vector.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ func vop(as obj.As) (opcode, es, cs uint32) {
4545
return op_VAC, 0, 0
4646
case AVACQ:
4747
return op_VAC, 4, 0
48+
case AVMSLG:
49+
return op_VMSL, 3, 0
4850
case AVACCC:
4951
return op_VACCC, 0, 0
5052
case AVACCCQ:

0 commit comments

Comments
 (0)