Skip to content

Cast the parameter type of arm BLOCKCONV_LOAD #14159

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/zend_operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static _locale_t current_locale = NULL;

#define BLOCKCONV_LOAD(input) \
int8x16_t blconv_operand = vld1q_s8((const int8_t*)(input)); \
uint8x16_t blconv_mask = vcltq_s8(vaddq_s8(blconv_operand, blconv_offset), blconv_threshold);
uint8x16_t blconv_mask = vcltq_s8(vreinterpretq_s8_u8(vaddq_u8(vreinterpretq_u8_s8(blconv_operand), vreinterpretq_u8_s8(blconv_offset))), blconv_threshold);
Copy link
Member Author

@SakiTakamachi SakiTakamachi May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(edit)
vreinterpretq_u8_s8 converts int8x16_t to uint8x16_t. vreinterpretq_s8_u8 is the opposite.
(vreinterpretq_{to}_{from})

Since vaddq_s8 overflows, use vaddq_u8 to prevent overflow, so need to convert the argument of vaddq_u8 to unsigned. Then convert retval to signed to pass it to vcltq_s8.


#define BLOCKCONV_FOUND() vmaxvq_u8(blconv_mask)

Expand Down
Loading