Skip to content

Instantly share code, notes, and snippets.

@minglotus-6
Created August 30, 2022 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minglotus-6/438e49494fe3d26876933141f889c2ac to your computer and use it in GitHub Desktop.
Save minglotus-6/438e49494fe3d26876933141f889c2ac to your computer and use it in GitHub Desktop.
https://gcc.godbolt.org/z/G8439aEGY right
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s2i8i16 = trunc <2 x i16> undef to <2 x i8>
https://gcc.godbolt.org/z/fojdKcb9q right
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s2i8i32 = trunc <2 x i32> undef to <2 x i8>
https://gcc.godbolt.org/z/zh9qTY4W1 right
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s2i8i64 = trunc <2 x i64> undef to <2 x i8>
https://gcc.godbolt.org/z/ocMf435fz right
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s2i16i32 = trunc <2 x i32> undef to <2 x i16>
https://gcc.godbolt.org/z/5zjxaEjKv right
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s2i16i64 = trunc <2 x i64> undef to <2 x i16>
https://gcc.godbolt.org/z/3xa1r1oav right
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s2i32i64 = trunc <2 x i64> undef to <2 x i32>
https://gcc.godbolt.org/z/46nhbcEG4 right i16 - i8 is free
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s4i8i16 = trunc <4 x i16> undef to <4 x i8>
https://gcc.godbolt.org/z/h5bsqj83c right
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s4i8i32 = trunc <4 x i32> undef to <4 x i8>
https://gcc.godbolt.org/z/b36oEr11d 2 + 1 -> is https://gcc.godbolt.org/z/qKeKvE8oq + https://gcc.godbolt.org/z/h5bsqj83c or 2 uzp1 better?
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %s4i8i64 = trunc <4 x i64> undef to <4 x i8>
https://gcc.godbolt.org/z/8ncznGP6a right
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s4i16i32 = trunc <4 x i32> undef to <4 x i16>
https://gcc.godbolt.org/z/WMWz581E6 right (uzp1 i64 -> i32) (xtn i32 - i16)
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s4i16i64 = trunc <4 x i64> undef to <4 x i16>
https://gcc.godbolt.org/z/qKeKvE8oq uzp1 (i64 -> i32)
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s4i32i64 = trunc <4 x i64> undef to <4 x i32>
right
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8i8i16 = trunc <8 x i16> undef to <8 x i8>
uzp1 32 -> 16 xtn 16 -> 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s8i8i32 = trunc <8 x i32> undef to <8 x i8>
+2 uzp1 64 -> 32
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %s8i8i64 = trunc <8 x i64> undef to <8 x i8>
uzp1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8i16i32 = trunc <8 x i32> undef to <8 x i16>
+2 uzp1 64 -> 32
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %s8i16i64 = trunc <8 x i64> undef to <8 x i16>
2 uzp1 64 -> 32
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s8i32i64 = trunc <8 x i64> undef to <8 x i32>
uzp1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s16i8i16 = trunc <16 x i16> undef to <16 x i8>
+2 uzp1
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %s16i8i32 = trunc <16 x i32> undef to <16 x i8>
+4 uzp1
; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %s16i8i64 = trunc <16 x i64> undef to <16 x i8>
4 register, so 2 uzp1
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s16i16i32 = trunc <16 x i32> undef to <16 x i16>
8 register, so +4 uzp1
; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %s16i16i64 = trunc <16 x i64> undef to <16 x i16>
8 register, 4 uzp1
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s16i32i64 = trunc <16 x i64> undef to <16 x i32>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment