Skip to content

Z: Fix feature detection for mask results by checking source type - #8076

Merged
hzongaro merged 1 commit into
eclipse-omr:masterfrom
ehsankianifar:Z_UseCorrectTypeForSupportChecks
Dec 14, 2025
Merged

Z: Fix feature detection for mask results by checking source type#8076
hzongaro merged 1 commit into
eclipse-omr:masterfrom
ehsankianifar:Z_UseCorrectTypeForSupportChecks

Conversation

@ehsankianifar

Copy link
Copy Markdown
Contributor

Mask types in vector operations were changed to use int32 and int64 instead of float and double. This caused feature checks to fail when the result was a mask and the CPU lacked floating‑point vector support. @Spencer-Comin discovered this issue during IBM Z test runs.
The solution is to check the source vector type when the result is a mask, ensuring feature requirements reflect operand semantics rather than mask representation. This restores correct gating for operations like vector compares that produce masks but depend on FP support in their inputs.
Tests were updated to cover CPUs with and without FP vector support, confirming previously failing cases now pass. Non‑mask operations and integer-only vectors remain unaffected.
@r30shah @gita-omr @hzongaro Please review this PR. This bug is causing failures in upstream tests on Z13.

@ehsankianifar

Copy link
Copy Markdown
Contributor Author

I started a jenkin build/test and will run it on a z13 grinder.

@r30shah r30shah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think changed are good. Nice catch @Spencer-Comin / @ehsankianifar.

Some nitpicks.

Comment thread compiler/z/codegen/OMRCodeGenerator.cpp Outdated
case TR::vcmpge:
// Since these opcodes produce a mask as the result type, we need to verify the source type and ensure that
// the CPU supports the requested feature.
return cpu->supportsFeature(OMR_FEATURE_S390_VECTOR_FACILITY_ENHANCEMENT_1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you change the order, I think it reads better. If the opcode is not float or VFE1 is not supported (In case it is float).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread compiler/z/codegen/OMRCodeGenerator.cpp Outdated
case TR::vcmple:
case TR::vcmpgt:
case TR::vcmpge:
// Since these opcodes produce a mask as the result type, we need to verify the source type and ensure that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you wrap the comment / shorten it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Mask types were changed to use int32 and int64 instead of float and
double, which caused capability checks to fail when the result was a
mask and the CPU lacked floating‑point vector support on IBM Z
platform.
The logic now uses the source vector type when the result is a mask,
ensuring feature requirements are correctly determined based on operand
semantics. This prevents false negatives and restores accurate feature
gating without affecting non‑mask operations.

signed-off-by: Ehsan Kiani Far <ehsan.kianifar@gmail.com>
@ehsankianifar
ehsankianifar force-pushed the Z_UseCorrectTypeForSupportChecks branch from 3f2c26f to 2d4293b Compare December 12, 2025 13:52

@r30shah r30shah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, @hzongaro Can I request your review / merge on this PR ?

@hzongaro hzongaro self-assigned this Dec 12, 2025
@hzongaro
hzongaro self-requested a review December 12, 2025 20:00

@hzongaro hzongaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Thanks!

@hzongaro

Copy link
Copy Markdown
Contributor

Jenkins build zos,zlinux

@hzongaro
hzongaro merged commit d4bd070 into eclipse-omr:master Dec 14, 2025
4 checks passed
@ehsankianifar
ehsankianifar deleted the Z_UseCorrectTypeForSupportChecks branch August 17, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants