|
1 | 1 | package io.computenode.cyfra.core.expression |
2 | 2 |
|
| 3 | +import izumi.reflect.Tag |
| 4 | + |
3 | 5 | given Value[Float16] with |
4 | 6 | protected def extractUnsafe(ir: ExpressionBlock[Float16]): Float16 = new Float16Impl(ir) |
| 7 | + def tag: Tag[Float16] = Tag[Float16] |
5 | 8 |
|
6 | 9 | given Value[Float32] with |
7 | 10 | protected def extractUnsafe(ir: ExpressionBlock[Float32]): Float32 = new Float32Impl(ir) |
| 11 | + def tag: Tag[Float32] = Tag[Float32] |
8 | 12 |
|
9 | 13 | given Value[Int16] with |
10 | 14 | protected def extractUnsafe(ir: ExpressionBlock[Int16]): Int16 = new Int16Impl(ir) |
| 15 | + def tag: Tag[Int16] = Tag[Int16] |
11 | 16 |
|
12 | 17 | given Value[Int32] with |
13 | 18 | protected def extractUnsafe(ir: ExpressionBlock[Int32]): Int32 = new Int32Impl(ir) |
| 19 | + def tag: Tag[Int32] = Tag[Int32] |
14 | 20 |
|
15 | 21 | given Value[UInt16] with |
16 | 22 | protected def extractUnsafe(ir: ExpressionBlock[UInt16]): UInt16 = new UInt16Impl(ir) |
| 23 | + def tag: Tag[UInt16] = Tag[UInt16] |
17 | 24 |
|
18 | 25 | given Value[UInt32] with |
19 | 26 | protected def extractUnsafe(ir: ExpressionBlock[UInt32]): UInt32 = new UInt32Impl(ir) |
| 27 | + def tag: Tag[UInt32] = Tag[UInt32] |
20 | 28 |
|
21 | 29 | given Value[Bool] with |
22 | 30 | protected def extractUnsafe(ir: ExpressionBlock[Bool]): Bool = new BoolImpl(ir) |
| 31 | + def tag: Tag[Bool] = Tag[Bool] |
23 | 32 |
|
24 | 33 | val unitZero = Expression.Constant[Unit](()) |
25 | 34 | given Value[Unit] with |
26 | 35 | protected def extractUnsafe(ir: ExpressionBlock[Unit]): Unit = () |
| 36 | + def tag: Tag[Unit] = Tag[Unit] |
27 | 37 |
|
28 | 38 | given Value[Any] with |
29 | 39 | protected def extractUnsafe(ir: ExpressionBlock[Any]): Any = ir.result.asInstanceOf[Expression.Constant[Any]].value |
| 40 | + def tag: Tag[Any] = Tag[Any] |
30 | 41 |
|
31 | 42 | given [T <: Scalar: Value]: Value[Vec2[T]] with |
32 | 43 | protected def extractUnsafe(ir: ExpressionBlock[Vec2[T]]): Vec2[T] = new Vec2Impl[T](ir) |
| 44 | + given Tag[T] = summon[Value[T]].tag |
| 45 | + def tag: Tag[Vec2[T]] = Tag[Vec2[T]] |
33 | 46 |
|
34 | 47 | given [T <: Scalar: Value]: Value[Vec3[T]] with |
35 | 48 | protected def extractUnsafe(ir: ExpressionBlock[Vec3[T]]): Vec3[T] = new Vec3Impl[T](ir) |
| 49 | + given Tag[T] = summon[Value[T]].tag |
| 50 | + def tag: Tag[Vec3[T]] = Tag[Vec3[T]] |
36 | 51 |
|
37 | 52 | given [T <: Scalar: Value]: Value[Vec4[T]] with |
38 | 53 | protected def extractUnsafe(ir: ExpressionBlock[Vec4[T]]): Vec4[T] = new Vec4Impl[T](ir) |
| 54 | + given Tag[T] = summon[Value[T]].tag |
| 55 | + def tag: Tag[Vec4[T]] = Tag[Vec4[T]] |
39 | 56 |
|
40 | 57 | given [T <: Scalar: Value]: Value[Mat2x2[T]] with |
41 | 58 | protected def extractUnsafe(ir: ExpressionBlock[Mat2x2[T]]): Mat2x2[T] = new Mat2x2Impl[T](ir) |
| 59 | + given Tag[T] = summon[Value[T]].tag |
| 60 | + def tag: Tag[Mat2x2[T]] = Tag[Mat2x2[T]] |
42 | 61 |
|
43 | 62 | given [T <: Scalar: Value]: Value[Mat2x3[T]] with |
44 | 63 | protected def extractUnsafe(ir: ExpressionBlock[Mat2x3[T]]): Mat2x3[T] = new Mat2x3Impl[T](ir) |
| 64 | + given Tag[T] = summon[Value[T]].tag |
| 65 | + def tag: Tag[Mat2x3[T]] = Tag[Mat2x3[T]] |
45 | 66 |
|
46 | 67 | given [T <: Scalar: Value]: Value[Mat2x4[T]] with |
47 | 68 | protected def extractUnsafe(ir: ExpressionBlock[Mat2x4[T]]): Mat2x4[T] = new Mat2x4Impl[T](ir) |
| 69 | + given Tag[T] = summon[Value[T]].tag |
| 70 | + def tag: Tag[Mat2x4[T]] = Tag[Mat2x4[T]] |
48 | 71 |
|
49 | 72 | given [T <: Scalar: Value]: Value[Mat3x2[T]] with |
50 | 73 | protected def extractUnsafe(ir: ExpressionBlock[Mat3x2[T]]): Mat3x2[T] = new Mat3x2Impl[T](ir) |
| 74 | + given Tag[T] = summon[Value[T]].tag |
| 75 | + def tag: Tag[Mat3x2[T]] = Tag[Mat3x2[T]] |
51 | 76 |
|
52 | 77 | given [T <: Scalar: Value]: Value[Mat3x3[T]] with |
53 | 78 | protected def extractUnsafe(ir: ExpressionBlock[Mat3x3[T]]): Mat3x3[T] = new Mat3x3Impl[T](ir) |
| 79 | + given Tag[T] = summon[Value[T]].tag |
| 80 | + def tag: Tag[Mat3x3[T]] = Tag[Mat3x3[T]] |
54 | 81 |
|
55 | 82 | given [T <: Scalar: Value]: Value[Mat3x4[T]] with |
56 | 83 | protected def extractUnsafe(ir: ExpressionBlock[Mat3x4[T]]): Mat3x4[T] = new Mat3x4Impl[T](ir) |
| 84 | + given Tag[T] = summon[Value[T]].tag |
| 85 | + def tag: Tag[Mat3x4[T]] = Tag[Mat3x4[T]] |
57 | 86 |
|
58 | 87 | given [T <: Scalar: Value]: Value[Mat4x2[T]] with |
59 | 88 | protected def extractUnsafe(ir: ExpressionBlock[Mat4x2[T]]): Mat4x2[T] = new Mat4x2Impl[T](ir) |
| 89 | + given Tag[T] = summon[Value[T]].tag |
| 90 | + def tag: Tag[Mat4x2[T]] = Tag[Mat4x2[T]] |
60 | 91 |
|
61 | 92 | given [T <: Scalar: Value]: Value[Mat4x3[T]] with |
62 | 93 | protected def extractUnsafe(ir: ExpressionBlock[Mat4x3[T]]): Mat4x3[T] = new Mat4x3Impl[T](ir) |
| 94 | + given Tag[T] = summon[Value[T]].tag |
| 95 | + def tag: Tag[Mat4x3[T]] = Tag[Mat4x3[T]] |
63 | 96 |
|
64 | 97 | given [T <: Scalar: Value]: Value[Mat4x4[T]] with |
65 | 98 | protected def extractUnsafe(ir: ExpressionBlock[Mat4x4[T]]): Mat4x4[T] = new Mat4x4Impl[T](ir) |
| 99 | + given Tag[T] = summon[Value[T]].tag |
| 100 | + def tag: Tag[Mat4x4[T]] = Tag[Mat4x4[T]] |
0 commit comments