[PATCH, spu] fixed bug in subti3

Sa Liu SALIU@de.ibm.com
Wed May 7 09:02:00 GMT 2008


> Why not use the following shorter and faster implementation?

This implementation doesn't give the correct value either. 
For example in the test case I attached:

aa      = 1111111111111110 1111111111111110
bb      = 1111111111111111 1111111111111111
aa-bb   = fffffffffffffffe ffffffffffffffff

But the result is:
d       = 111111101111110f 111111101111110f

I think the problem here is that instruction bg also generates 1 if both 
operands are identical. Instead, 0 implicates borrow. Therefore I used xor 
to invert the borrow value. But maybe there are some faster solutions.

Thanks!
Sa



More information about the Gcc-patches mailing list