From: Pan Li <pan2.li@intel.com>
The vwaddu/vwsubu wx combine patterns take the any_extend by
mistake, it is unsigned so we must leverage zero_extend here.
This PATCH would like to fix this which result in sign_extend
code pattern combine to vwaddu/vwsub.wx.
PR target/123317
gcc/ChangeLog:
* config/riscv/autovec-opt.md: Take zero_extend for
both the vwaddu and vwsubu wx pattern.
Signed-off-by: Pan Li <pan2.li@intel.com>
[(set (match_operand:VWEXTI_D 0 "register_operand")
(plus:VWEXTI_D
(vec_duplicate:VWEXTI_D
- (any_extend:<VEL>
+ (zero_extend:<VEL>
(match_operand:<VSUBEL> 2 "register_operand")))
(match_operand:VWEXTI_D 1 "register_operand")))]
"TARGET_VECTOR && TARGET_64BIT && can_create_pseudo_p ()"
(minus:VWEXTI_D
(match_operand:VWEXTI_D 1 "register_operand")
(vec_duplicate:VWEXTI_D
- (any_extend:<VEL>
+ (zero_extend:<VEL>
(match_operand:<VSUBEL> 2 "register_operand")))))]
"TARGET_VECTOR && TARGET_64BIT && can_create_pseudo_p ()"
"#"