1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
5 // Created by dans on 6/1/20.
8 #ifndef VXSORT_MACHINE_TRAITS_H
9 #define VXSORT_MACHINE_TRAITS_H
22 template <typename T, vector_machine M>
23 struct vxsort_machine_traits {
28 static constexpr bool supports_compress_writes();
30 static TV load_vec(TV* ptr);
31 static void store_vec(TV* ptr, TV v);
32 static void store_compress_vec(TV* ptr, TV v, TMASK mask);
33 static TV partition_vector(TV v, int mask);
34 static TV broadcast(T pivot);
35 static TMASK get_cmpgt_mask(TV a, TV b);
37 static TV shift_right(TV v, int i);
38 static TV shift_left(TV v, int i);
40 static TV add(TV a, TV b);
41 static TV sub(TV a, TV b);
43 static TV pack_ordered(TV a, TV b);
44 static TV pack_unordered(TV a, TV b);
46 static void unpack_ordered_signed(TV p, TV& u1, TV& u2);
47 static void unpack_ordered_unsigned(TV p, TV& u1, TV& u2);
53 #endif // VXSORT_MACHINE_TRAITS_H