Thread View: comp.sys.transputer
2 messages
2 total messages
Started by Theodore Allan Bapty
Thu, 23 Aug 1990 19:39
RE: 16 Bit Ints
Author: Theodore Allan Bapty
Date: Thu, 23 Aug 1990 19:39
Date: Thu, 23 Aug 1990 19:39
31 lines
1400 bytes
1400 bytes
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)
Re: 16 Bit Ints
Author: Rob Kurver
Date: Thu, 23 Aug 1990 23:35
Date: Thu, 23 Aug 1990 23:35
43 lines
2211 bytes
2211 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads