-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AIE] Legalize G_AND for <8 x s64> vector. #262
base: aie-public
Are you sure you want to change the base?
Conversation
dbe1bb6
to
be1e22b
Compare
@@ -255,6 +255,13 @@ AIE2PLegalizerInfo::AIE2PLegalizerInfo(const AIE2PSubtarget &ST) | |||
getActionDefinitionsBuilder({G_AND, G_OR}) | |||
.legalFor({S32}) | |||
.legalFor(AIE2PVectorTypes) | |||
.bitcastIf( | |||
[=](const LegalityQuery &Query) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this more generic and also handle 256/1024 bit vectors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
be1e22b
to
e0503f5
Compare
e0503f5
to
d14b1a8
Compare
@@ -305,7 +299,7 @@ AIE2PLegalizerInfo::AIE2PLegalizerInfo(const AIE2PSubtarget &ST) | |||
.legalFor({V16S32, V32S16, V64S8}) | |||
.widenScalarToNextPow2(0) | |||
.clampScalar(0, S32, S32) | |||
// AIE ISA supports only 512-bit vector add/sub/xor | |||
// AIE ISA supports only 512-bit vector add/sub/xor/and/or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why do we need to update the comment with "and/or"?
@@ -1092,6 +1092,15 @@ def : PatInaccessibleMem<(int_aie2_v16bf16_to_v16i32 VEC256:$src, mSs:$shft), | |||
def : PatInaccessibleMem<(int_aie2_clr16f_conf), | |||
(VCLR_vclr_BF)>; | |||
|
|||
// AIE does not have a native xor instruction for vector operands. | |||
// Res = A xor B --> Res = AB' || A'B | |||
foreach Ty = [v64i8, v32i16, v16i32] in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be shared between aie2 and aie2p? I see we have exactly the same implementation for aie2p.
(v32i16 (REG_SEQUENCE VEC512, VEC256:$src2, sub_256_lo))), | ||
sub_256_lo))>; | ||
} | ||
// VBOR / VBAND / XOR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we don't have xor here
// like scalarization. We can use G_CONCAT_VECTORS and unmerge to do this | ||
// more optimally. | ||
.customIf(vectorSmallerThan(0, 512)) | ||
.bitcastIf(typeInSet(0, {AccV4S64, AccV8S64, AccV16S64}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it not for all aie2p accumulator types defined in AIE2PAccumulatorTypes
?
No description provided.