bapty@VUSE.VANDERBILT.EDU (Theodore Allan Bapty) (08/24/90)
If you can afford the extra memory space, it is more efficient to use 32 bit ints. You should translate to 32 bits first. To avoid alot of overhead in the translation between sizes, you can use the MOVE2D operation. Under Logical Systems C try this command: Move2D(source_16,dest_32,2,NUM_VALS,2,4); where source_16 is the 16 bit int source, and dest_32 is the 32 bit int destination array. Note that the upper 2 bytes of the destination array are unaffected, so you'll have to clear/sign-extend them if you application requires it. Also note that this requires a T8, since the T414 doesn't have the 2D move operation. I don't have any actual timing figures, but it should be more efficient than a programmed loop for translating arrays of values. The instruction appears to operate at bus rates (2*NUM_VALS) after the (31 cycle) setup time. There are also other variations on the move2d instruction that may fit your application. ted bapty (bapty@vuse.vanderbilt.edu)
rob@dutncp8.tudelft.nl (Rob Kurver) (08/24/90)
In <9008231939.AA08046@ee16.vuse> bapty@VUSE.VANDERBILT.EDU (Theodore Allan Bapty) writes: >Move2D(source_16,dest_32,2,NUM_VALS,2,4); >where source_16 is the 16 bit int source, >and dest_32 is the 32 bit int destination array. >Note that the upper 2 bytes of the destination >array are unaffected, so you'll have to >clear/sign-extend them if you application requires >it. Also note that this >requires a T8, since the T414 doesn't have the >2D move operation. Obviously, clearing can easily be done with a simple memset(). But if you need signed shorts/ints, you have to go in and sign-extend at some time, be it immediately after the Move2D(), or before you actually do something with them (you were going to use them, right?), so why bother with this call? It is not portable (both across hardware and software), so you don't want to do this kind of coding unless it really pays off. >I don't have any actual timing figures, but it should >be more efficient than a programmed loop for >translating arrays of values. The instruction >appears to operate at bus rates (2*NUM_VALS) after the >(31 cycle) setup time. There are also other variations >on the move2d instruction that may fit your application. I'm sure the Move2D operation is very fast. But if you have to go in and sign-extend afterwards, I think you loose. I'd like to see some timing figures... It certainly is an interesting use of the 2D move instruction, though. Just my $.02... -- Rob Kurver rob@dutncp8.tudelft.nl Computational Physics Group rob@pact.nl Faculty of Applied Physics, Delft University of Technology The moving cursor writes, and having written, blinks on.