File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -27,26 +27,24 @@ struct __ptr
27
27
}
28
28
29
29
// in non-64bit mode we only support "small" arithmetic on pointers (just offsets no arithmetic on pointers)
30
- #if 0 // TODO: @Przemog1
31
30
__ptr operator+(uint32_t i)
32
31
{
33
32
i *= sizeof (T);
34
33
uint32_t2 newAddr = addr;
35
- uint32_t2 diff = spirv::OpIAddCarry (addr[0 ],i);
36
- newAddr[0 ] = diff[ 0 ] ;
37
- newAddr[1 ] += diff[ 1 ] ;
34
+ AddCarryOutput<T> lsbAddRes = spirv::addCarry<uint32_t> (addr[0 ],i);
35
+ newAddr[0 ] = lsbAddRes.result ;
36
+ newAddr[1 ] += lsbAddRes.carry ;
38
37
return __ptr::create (newAddr);
39
38
}
40
39
__ptr operator-(uint32_t i)
41
40
{
42
41
i *= sizeof (T);
43
42
uint32_t2 newAddr = addr;
44
- uint32_t2 diff = spirv::OpISubBorrow (addr[0 ],i);
45
- newAddr[0 ] = diff[ 0 ] ;
46
- newAddr[1 ] -= diff[ 1 ] ;
43
+ AddCarryOutput<T> lsbSubRes = spirv::subBorrow<uint32_t> (addr[0 ],i);
44
+ newAddr[0 ] = lsbSubRes.result ;
45
+ newAddr[1 ] -= lsbSubRes.carry ;
47
46
return __ptr::create (newAddr);
48
47
}
49
- #endif
50
48
51
49
template< uint64_t alignment=alignment_of_v<T> >
52
50
__ref<T,alignment,false > deref ()
Original file line number Diff line number Diff line change @@ -329,11 +329,11 @@ enable_if_t<is_vector_v<BooleanVector>&& is_same_v<typename vector_traits<Boolea
329
329
330
330
template<typename T NBL_FUNC_REQUIRES (concepts::UnsignedIntegral<T>)
331
331
[[vk::ext_instruction (spv::OpIAddCarry)]]
332
- AddCarryOutput<T> AddCarry (T operand1, T operand2);
332
+ AddCarryOutput<T> addCarry (T operand1, T operand2);
333
333
334
334
template<typename T NBL_FUNC_REQUIRES (concepts::UnsignedIntegral<T>)
335
335
[[vk::ext_instruction (spv::OpISubBorrow)]]
336
- SubBorrowOutput<T> SubBorrow (T operand1, T operand2);
336
+ SubBorrowOutput<T> subBorrow (T operand1, T operand2);
337
337
338
338
}
339
339
You can’t perform that action at this time.
0 commit comments