DSPRelated.com
Forums

AW: 16 bit operations in SHARC

Started by Andor Bariska April 26, 2000
Ganesan, you could load the 16bit operands into any 32bit registers and
thenshift them like this:

r0=dm(16bit_operand_value); /* load 16bit value into r0 */
r0=ashift r0 by 16; /* shift 16bit value 16bits to the left */
.... /* do the arithmetic here */
r0=ashift r0 by -16; /* shift 16bit value back */
dm(16bit_operand_value)=r0; /* store 16bit value */ You can then set saturation and test for overflow as if you were working
with a 16bit CPU. You must remember, however, when using immediate
values, that they also have to be shifted by 16 bits.

Regards,
Andor
WEISS ENGINEERING LTD. - Professional Digital Audio Products
Florastrasse 42 8610 Uster Switzerland
phone: +41 1 940 20 06, fax: +41 1 940 22 14
mailto: web: http://www.weiss.ch
You *can* afford the best
-----Ursprgliche Nachricht-----
Von: Ganesan Ramachandran [mailto:]
Gesendet am: Mittwoch, 26. April 2000 07:10
An:
Betreff: [adsp] 16 bit operations in SHARC Hi,
I need to simulate 16 bit fixed point operations in SHARC 21061. The
VDSP4.0 C cross compiler doesn't differentiate between short, int and
long keywords. the numeric format of SHARC specifies 16 bit floating
point operations only. is there any shortcut/method to simulate 16 bit
fixed point operations in SHARC 21061? (like setting up some flags or
constraining to some specific registers etc.)
thanks in advance.
regards,
---------------------
R.Ganesan,
Engineer-VLSI/System Design,
Wipro Global RD,
#88,5th floor,
SB Towers,
Mahatma Gandhi Road,
Bangalore-560001
Tel:91-80-5588422 Extn:517
Fax:91-80-5589818
mailto:
http://www.wipro.com
--------------------
Personal mail : --------------------
#305,6th main,4th cross,
Vivek nagar,
Bangalore-560047
Tel: (PP) 91-80-5713327
--------------------
Don't take life too seriously
Nobody goes notout anyway!!!

"The whole problem with the world is that
fools and fanatics are always so certain of themselves,
but wiser people so full of doubts."

- Bertrand Russell

------------------- To Join: Send an email to

To Post: Send an email to

To Leave: Send an email to

Archives: http://www.egroups.com/group/adsp

Other Groups: http://www.dsprelated.com