Skip to content

Fix ty_half_width in isle prelude#7715

Merged
fitzgen merged 1 commit into
bytecodealliance:mainfrom
scottmcm:fix-half-width
Dec 21, 2023
Merged

Fix ty_half_width in isle prelude#7715
fitzgen merged 1 commit into
bytecodealliance:mainfrom
scottmcm:fix-half-width

Conversation

@scottmcm
Copy link
Copy Markdown
Contributor

I spent way too long trying to figure out how I'd gotten a rule wrong, only to find out that ty_half_width in ISLE was doing something different from Type::half_width in the rest of the codebase.

Thus this PR, which stops it having a custom implementation in ISLE and just calls the normal method. I think anywhere in ISLE rules that wants to exclude the other cases should be using fits_in_64 or similar, not having the ty_half_width extern do something surprising.

The existing uses

(rule 10 (lower (has_type (ty_vec_fits_in_register ty) (iadd x (splat (sextend y @ (value_type sext_ty))))))
(if-let half_ty (ty_half_width ty))
(if-let $true (ty_equal (lane_type half_ty) sext_ty))
(rv_vwadd_wx x y (unmasked) (vstate_mf2 half_ty)))
(rule 10 (lower (has_type (ty_vec_fits_in_register ty) (iadd x (splat (uextend y @ (value_type uext_ty))))))
(if-let half_ty (ty_half_width ty))
(if-let $true (ty_equal (lane_type half_ty) uext_ty))
(rv_vwaddu_wx x y (unmasked) (vstate_mf2 half_ty)))

are under ty_vec_fits_in_register already, so it's fine.

@scottmcm scottmcm requested a review from a team as a code owner December 21, 2023 03:35
@scottmcm scottmcm requested review from fitzgen and removed request for a team December 21, 2023 03:35
@github-actions github-actions Bot added the cranelift Issues related to the Cranelift code generator label Dec 21, 2023
@fitzgen fitzgen added this pull request to the merge queue Dec 21, 2023
Merged via the queue into bytecodealliance:main with commit b583c54 Dec 21, 2023
@scottmcm scottmcm deleted the fix-half-width branch December 21, 2023 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants