Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有 SSE 指令可以替换下面编写的部分或全部算法。
有很长的短值数组(字节或长值是可以接受的)。必须找到大于某个阈值的值。
谢谢你。
是的,您可以执行以下操作(伪代码):
Init threshold vector Found = FALSE For each vector of N elements Load vector (_mm_load_si128) Compare greater than threshold (_mm_cmpgt_XXX) Move comparison vector to mask (_mm_movemask_epi8) If mask != 0 Found = TRUE Break End End