[PATCH] D149071: [X86] LowerRotate: prefer unpack-based algorithm
Ivan Chikish via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 26 06:27:29 PDT 2023
Nekotekina added a comment.
Added some code analyser results.
================
Comment at: llvm/test/CodeGen/X86/min-legal-vector-width.ll:1942
+; CHECK-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
+; CHECK-NEXT: retq
%b8 = sub <16 x i8> <i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8>, %b
----------------
Code analyser:
SKX version (left): https://bit.ly/3NamuO5
VBMI version (left): https://bit.ly/444ZUfB
Common (right): https://bit.ly/3n7q4xQ
Unpack version looks better despite more instructions.
================
Comment at: llvm/test/CodeGen/X86/vector-fshl-rot-128.ll:379
+; AVX2-NEXT: vpsrld $16, %xmm0, %xmm0
+; AVX2-NEXT: vpackusdw %xmm2, %xmm0, %xmm0
; AVX2-NEXT: retq
----------------
Even less instructions than on the left
================
Comment at: llvm/test/CodeGen/X86/vector-fshl-rot-128.ll:1549
+; AVX512VLBW-NEXT: vpsrlw $8, %xmm0, %xmm0
+; AVX512VLBW-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
; AVX512VLBW-NEXT: retq
----------------
Left: https://bit.ly/41G6Mia
Right: https://bit.ly/43Wymcm
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149071/new/
https://reviews.llvm.org/D149071
More information about the llvm-commits
mailing list