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

Categories

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);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...