refactor to easily allow algorithms generic over f16/32/64
[vector-math.git] / vector-math-proc-macro / src / lib.rs
index 5c4de02ac0984025a1a530761a25177272cbe1d4..89d2bc43f365c25bcbb4a714e3425a7ca5c84c20 100644 (file)
@@ -269,12 +269,16 @@ impl TraitSets {
                     let sint_ty = TypeKind::SInt.ty(bits, vector_scalar);
                     let type_trait = match type_kind {
                         TypeKind::Bool => quote! { Bool },
-                        TypeKind::UInt => quote! { UInt },
-                        TypeKind::SInt => quote! { SInt },
+                        TypeKind::UInt => {
+                            quote! { UInt<PrimUInt = #prim_ty, SignedType = Self::#sint_ty> }
+                        }
+                        TypeKind::SInt => {
+                            quote! { SInt<PrimSInt = #prim_ty, UnsignedType = Self::#uint_ty> }
+                        }
                         TypeKind::Float => quote! { Float<
                             BitsType = Self::#uint_ty,
                             SignedBitsType = Self::#sint_ty,
-                            FloatEncoding = #prim_ty,
+                            PrimFloat = #prim_ty,
                         > },
                     };
                     self.add_trait(type_kind, bits, vector_scalar, type_trait);