On 24/10/2025 06:15, Avinash Jayakar wrote:
Thanks for the info. I also was able to build and debug it for this target. For the signed mod case, there is an extra requirement for vectorization that is to have vector operation support for ABS_EXPR, which amdgcn does not have.5033 if (!unsigned_p) 5034 { 5035 // check availibility of abs expression for vector 5036 if (!target_has_vecop_for_code (ABS_EXPR, vectype)) 5037 return NULL; (1) Either we could modify the test case to check if target supports vector absolute expression like we did for vect_condition. I am not sure how to do that for now. In target-supports.exp, I do not see any keyword to use in the test to check if target supports vector absolute expression. (2) Or better yet if a target does not support ABS_EXPR we could fallback to implementing the absolute expression using vectorized statements a < 0 ? -a : a; (LT_EXPR, COND_EXPR and NEGATE_EXPR). This would increase the statements, but the cost analysis of vectorized could decide in choosing vector vs scalar implementation. Please do let me know in case you need help in resolving this, I can submit a patch with the required changes for the second case.
I think we should probably have ABS_EXPR. The ISA can do this so I assume the omission was just one of those things, not deliberate.
The fall-back would be nice-to-have too, but if you do that please consider adding some output to the "vect" dump like "operation not supported: ABS_EXPR" because this is how I find out that I missed something!
Thanks Andrew
