Page 1 of 1

Help about gte_sqr12()

Posted: August 25th, 2021, 6:57 am
by masmorra
Hello guys, can you help me with some gte stuff?

So it's about the gte_sqr12 instruction, when I load my vector input, I only can use number until 8<<12 (32768) because the register utilized by gte_sqr12() is only 16bits. I'm doing something wrong or It was doing exactly what is supposed to do?

Code: Select all

VECTOR myinput{8<<12,3<<12,4<<12};
//load my vector to IR1,IR2,IR3           16bit Accumulator (Vector)
gte_ldlvl(&myinput);
gte_sqr12();
VECTOR out;
//store to out vector from MAC1,MAC2,MAC3        32bit Maths Accumulators (Vector)
gte_stlvnl(&out);
//out.vx prints 262144 = (8*8)<<12
//if the x from the vector is 9, the return is 200704, like (-7 * -7) << 12

If I use thegte_sqr0() the output begins to differ when the numbers are bigger, because I need to shit << 12 the results