在64位单词中执行16位数量的顺序
我需要对少数小无签名整数进行词素比较。如果(例如)8位整数(例如),那么显而易见的方法是字节汇总并在GPR中进行普通整数。如果有2个32位整数,则32位旋转和普通的比较将可以解决问题。如果有4个16位整数怎么办?显然,有了向量注册,很容易将它们改组,但是是否有有效的方法 - 逆转其订单或进行比较而不反转订单的方法仅使用GPR?
I need to do a lexicographic comparison of a small number of small unsigned integers. If there are (for example) 8 8-bit integers, the obvious approach is to byteswap them and do an ordinary integer compare in a GPR. If there are 2 32-bit integers, a 32-bit rotate and an ordinary compare will do the trick. What if there are 4 16-bit integers? Obviously with a vector register it is easy to shuffle them, but is there an efficient approach—either to reversing their order, or to doing the compare without reversing order—using only GPR?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅凭反向,这是我的尝试:
能够使用32位旋转来交换两个相邻单词很方便。
我们有两个平行的依赖关系链,每个链条有两个UOP,然后还有一个将它们合并的UOP。
For the reverse alone, here's my attempt:
It's convenient to be able to use a 32-bit rotate to swap two adjacent words.
We've got two parallel dependency chains of two uops each, followed by one more uop to merge them.