Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

arm - neon shift instruction, can vector shift by vector?

I want to use neon instruction to speed up my program, I need to use the shift operation, but I only found Vector shift by constant. So is there a Vector shift by vector? for vshr_n_s8 instruction, Can parameter __b be a vector?

int8x8_t vshr_n_s8 (int8x8_t __a, const int __b);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It looks to me like you can use int8x8_t vshl_s8(int8x8_t a, int8x8_t b); with the elements of the vector b positive for a left shift and negative for a right shift. (vneg_s8 could be useful if you have a vector of positive shift counts but want a right shift.) There are also signed/unsigned and saturating/rounding versions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...