From 1cc6215218b0307dd352140bae121d390f02c0d4 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Thu, 22 Aug 2024 09:27:51 +0800 Subject: [PATCH] Updated Golang s390x asm Reference (markdown) --- Golang-s390x-asm-Reference.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Golang-s390x-asm-Reference.md b/Golang-s390x-asm-Reference.md index c664ae0..32dd0ad 100644 --- a/Golang-s390x-asm-Reference.md +++ b/Golang-s390x-asm-Reference.md @@ -1,5 +1,5 @@ # Reference -* https://go.dev/doc/asm +- https://go.dev/doc/asm IBM z/Architecture, a.k.a. s390x[¶](https://go.dev/doc/asm#s390x) The registers R10 and R11 are reserved. The assembler uses them to hold temporary values when assembling some instructions. @@ -18,27 +18,29 @@ Addressing modes: (R5)(R6*1): The location at R5 plus R6. It is a scaled mode as on the x86, but the only scale allowed is 1. -* https://golang.google.cn/cmd/internal/obj/s390x/ +- https://golang.google.cn/cmd/internal/obj/s390x/ # 向量指令 ## Reference -* https://github.com/golang/go/blob/master/src/cmd/internal/obj/s390x/vector.go +- https://github.com/golang/go/blob/master/src/cmd/internal/obj/s390x/vector.go ## Element Size -* B - 16个8位值 (相当于一个128位数) -* H - 8个16位值 -* F - -* G - -* Q - 2个64位值? +- **B** - This stands for Byte and represents multiple 8-bit values in a 128-bit vector. +- **H** - This stands for Halfword and represents multiple 16-bit values in a 128-bit vector. +- **F** - This stands for Fullword and represents multiple 32-bit values in a 128-bit vector. +- **G** - This stands for Doubleword and represents multiple 64-bit values in a 128-bit vector. +- **Q** - This stands for Quadword and represents a single 128-bit value in a 128-bit vector. + +(以上解释来自Copilot) ## 算术加减法 -* VA - Vector Add. 无符号数加法。 -* VAC - Vector Add With Carry. 带进位无符号数加法;相当于3个数加法。 -* VACC - Vector Add Compute Carry. 无符号数加法,计算进位。只有进位结果。 -* VACCC - Vector Add With Carry Compute Carry. 带进位无符号数加法,计算进位。相当于3个数加法,只有进位结果。 +- VA - Vector Add. 无符号数加法。 +- VAC - Vector Add With Carry. 带进位无符号数加法;相当于3个数加法。 +- VACC - Vector Add Compute Carry. 无符号数加法,计算进位。只有进位结果。 +- VACCC - Vector Add With Carry Compute Carry. 带进位无符号数加法,计算进位。相当于3个数加法,只有进位结果。 -所以,两个数相加要同时使用多个指令。示例演示T1||T0, RED2||RED1两个256位数的加法(按64位值?),得到 T2||T1||T0。 +所以,两个数相加要同时使用多个指令。示例演示T1||T0, RED2||RED1两个256位数的加法,得到 T2||T1||T0。 ```asm VACCQ T0, RED1, CAR1 VAQ T0, RED1, T0