From b30900b9aaf4406c1bc3917d9cfe7fcaa966934e Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Thu, 22 Aug 2024 15:32:54 +0800 Subject: [PATCH] Updated Golang s390x asm Reference (markdown) --- Golang-s390x-asm-Reference.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Golang-s390x-asm-Reference.md b/Golang-s390x-asm-Reference.md index 4612a77..fa8abdd 100644 --- a/Golang-s390x-asm-Reference.md +++ b/Golang-s390x-asm-Reference.md @@ -35,11 +35,11 @@ Addressing modes: (以上解释来自Copilot) ## 算术加减、乘法 -- VA - Vector Add. 无符号数加法。 -- VAC - Vector Add With Carry. 带进位无符号数加法;相当于3个数加法。 -- VACC - Vector Add Compute Carry. 无符号数加法,计算进位。只有进位结果。 -- VACCC - Vector Add With Carry Compute Carry. 带进位无符号数加法,计算进位。相当于3个数加法,只有进位结果。 -- VS - Vector Substract. 无符号数减法。 +- VA - Vector Add. 无符号整数加法。 +- VAC - Vector Add With Carry. 带进位无符号整数加法;相当于3个数加法。 +- VACC - Vector Add Compute Carry. 无符号整数加法,计算进位。只有进位结果。 +- VACCC - Vector Add With Carry Compute Carry. 带进位无符号整数加法,计算进位。相当于3个数加法,只有进位结果。 +- VS - Vector Substract. 无符号整数减法。 - VSBCBI - Vector Substract With Borrow Compute Borrow Indication. 带借位计算借位。 - VSBI - Vector Substract With Borrow Indicator. 带借位减法。 - VSCBI - Vector Substract Compute Borrow Indication. 计算借位。 @@ -64,8 +64,21 @@ Addressing modes: 乘法更复杂。 - VML - Vector Multiply Low. -- VMH - Vector Multiply High. -- VMAL - Vector Multiply and Add Low. +- VMH - Vector Multiply High.[Reference](https://www.ibm.com/docs/en/cloud-paks/z-modernization-stack/2023.4?topic=arithmetic-vec-mulh-vector-multiply-high) +- VMLH - Vector Multiply Logical High.[Reference](https://www.ibm.com/docs/en/cloud-paks/z-modernization-stack/2023.4?topic=arithmetic-vec-mulh-vector-multiply-high) +- VMAL - Vector Multiply and Add Low. [Reference](https://www.ibm.com/docs/en/cloud-paks/z-modernization-stack/2023.4?topic=arithmetic-vec-mladd-vector-multiply-add-low) +- VMAH - Vector Multiply and Add High. [Reference](https://www.ibm.com/docs/en/cloud-paks/z-modernization-stack/2023.4?topic=arithmetic-vec-mhadd-vector-multiply-add-high) +- VMALH - Vector Multiply and Add Logical High. [Reference](https://www.ibm.com/docs/en/cloud-paks/z-modernization-stack/2023.4?topic=arithmetic-vec-mhadd-vector-multiply-add-high) + +The main difference between **VMALH** and **VMAH** (same as **VMH** and **VMLH** ) is how they handle the sign of the operands: + +- **VMALH** treats the operands as unsigned integers. This means it performs a logical multiplication and addition, which does not take the sign of the operands into account. + +- **VMAH** treats the operands as signed integers. This means it performs an arithmetic multiplication and addition, which does take the sign of the operands into account. + +In other words, VMALH is used for unsigned integer operations, while VMAH is used for signed integer operations. The choice between the two depends on whether the data you're working with is signed or unsigned. + +