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
2727 }
2828
2929 // in non-64bit mode we only support "small" arithmetic on pointers (just offsets no arithmetic on pointers)
30- #if 0 // TODO: @Przemog1
3130 __ptr operator+(uint32_t i)
3231 {
3332 i *= sizeof (T);
3433 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 ;
3837 return __ptr::create (newAddr);
3938 }
4039 __ptr operator-(uint32_t i)
4140 {
4241 i *= sizeof (T);
4342 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 ;
4746 return __ptr::create (newAddr);
4847 }
49- #endif
5048
5149 template< uint64_t alignment=alignment_of_v<T> >
5250 __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
329329
330330template<typename T NBL_FUNC_REQUIRES (concepts::UnsignedIntegral<T>)
331331[[vk::ext_instruction (spv::OpIAddCarry)]]
332- AddCarryOutput<T> AddCarry (T operand1, T operand2);
332+ AddCarryOutput<T> addCarry (T operand1, T operand2);
333333
334334template<typename T NBL_FUNC_REQUIRES (concepts::UnsignedIntegral<T>)
335335[[vk::ext_instruction (spv::OpISubBorrow)]]
336- SubBorrowOutput<T> SubBorrow (T operand1, T operand2);
336+ SubBorrowOutput<T> subBorrow (T operand1, T operand2);
337337
338338}
339339
You can’t perform that action at this time.
0 commit comments