This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Perform `and` combination with a shifted mask
ClosedPublic

Authored by SixWeining on Jun 7 2022, 4:44 AM.

Diff Detail

Event Timeline

SixWeining created this revision.Jun 7 2022, 4:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 4:44 AM
SixWeining requested review of this revision.Jun 7 2022, 4:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 4:44 AM
xen0n added a comment.Jun 8 2022, 11:29 PM

It seems only the (x >> shamt) & mask case is handled, but not (x & in_place_mask) >> shamt; is this an intentional simplification? The current behavior is good though.

It seems only the (x >> shamt) & mask case is handled, but not (x & in_place_mask) >> shamt; is this an intentional simplification? The current behavior is good though.

Thanks for reminding me. (x & in_place_mask) >> shamt is not handled in this patch and it indeed can be optimized to bstrpick too. But this is for shl combination but not for and. Please let me handle it in another patch. Thanks again!

SixWeining updated this revision to Diff 435767.Jun 9 2022, 7:11 PM

Remove the patch number in the title.

SixWeining retitled this revision from [LoongArch 6/n] Perform `and` combination with a shifted mask to [LoongArch] Perform `and` combination with a shifted mask.Jun 9 2022, 7:11 PM
xen0n accepted this revision.Jun 9 2022, 7:41 PM

It seems only the (x >> shamt) & mask case is handled, but not (x & in_place_mask) >> shamt; is this an intentional simplification? The current behavior is good though.

Thanks for reminding me. (x & in_place_mask) >> shamt is not handled in this patch and it indeed can be optimized to bstrpick too. But this is for shl combination but not for and. Please let me handle it in another patch. Thanks again!

Okay. Immediates in this case need some deeper inspection for confirming it's a single chunk of 1's among 0's, so it's better to split commits.

Then this looks good to me!

This revision is now accepted and ready to land.Jun 9 2022, 7:41 PM

Use ;; to emphasize non-RUN non-CHECK lines.

adjust the dependency

SixWeining edited the summary of this revision. (Show Details)Jun 13 2022, 6:15 AM
This revision was landed with ongoing or failed builds.Jun 19 2022, 6:58 PM
This revision was automatically updated to reflect the committed changes.