Skip to content

Implement arithmetic reduction opcodes on IBM Z platform#8094

Open
ehsankianifar wants to merge 1 commit intoeclipse-omr:masterfrom
ehsankianifar:Z_ImplementVectorArithmeticReductionOpcodes
Open

Implement arithmetic reduction opcodes on IBM Z platform#8094
ehsankianifar wants to merge 1 commit intoeclipse-omr:masterfrom
ehsankianifar:Z_ImplementVectorArithmeticReductionOpcodes

Conversation

@ehsankianifar
Copy link
Contributor

Arithmetic reduction opcodes perform lane-wise arithmetic operations (ADD, MUL, MIN, MAX) across all lanes of a vector to produce a single reduced value. The implementation executes the reduction operation on the vector, sign extends the final result, and returns it in a GPR or FPR.
The operation may optionally be performed under a mask. When a mask is present, only the masked lanes participate in the reduction. Unmasked lanes are replaced with an identity value so they do not affect the result (e.g., 0 for addition, 1 for multiplication, and appropriate identity values for MIN and MAX).

@ehsankianifar
Copy link
Contributor Author

@r30shah @hzongaro @gita-omr Please review this PR and merge if it looks good to you. Thanks.

@hzongaro hzongaro self-assigned this Jan 21, 2026
@hzongaro hzongaro requested review from hzongaro and removed request for vijaysun-omr January 26, 2026 14:14
}

// Because the operation is performed using scalar FP instructions, the VRF register must overlap with an FPR in the
// 0–15 range.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special characters in this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I removed the non ascii char.

@ehsankianifar ehsankianifar force-pushed the Z_ImplementVectorArithmeticReductionOpcodes branch from 4c7ce4e to 90fc93e Compare February 6, 2026 18:21
TR::Register *targetReg, TR::Register *scratchReg, TR_IdentityValues identityValue, uint8_t elementSizeMask)
{
uint16_t immediateValue = 0;
uint8_t shiftAmunt = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: shiftAmunt should be shiftAmount

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed the typo.

Arithmetic reduction opcodes perform lane-wise arithmetic operations
(ADD, MUL, MIN, MAX) across all lanes of a vector to produce a single
reduced value. The implementation executes the reduction operation on
the vector, sign extends the final result, and returns it in a GPR or
FPR.
The operation may optionally be performed under a mask. When a mask is
present, only the masked lanes participate in the reduction. Unmasked
lanes are replaced with an identity value so they do not affect the
result (e.g., 0 for addition, 1 for multiplication, and appropriate
identity values for MIN and MAX).

signed-off-by: Ehsan Kiani Far <ehsan.kianifar@gmail.com>
@ehsankianifar ehsankianifar force-pushed the Z_ImplementVectorArithmeticReductionOpcodes branch from 90fc93e to 7c72397 Compare February 9, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants