DSPRelated.com
Forums

Can I use 40-bit float in a C program?

Started by ghostzhou_2000 December 3, 2010
Hello every noe, Can I use 40-bit float in a C program?
I use ADSP21060.
I'm sorry for asking this question twice just now,But have not get any reply.
I think it's beacause I did't join the group on that time.
So, if anybody knows the way, please tell me again.
Your help will be much appreciated.
What compiler are you using? You might be able to declare things as
double and it will be set to 40 bits instead.

On Fri, 3 Dec 2010, ghostzhou_2000 wrote:

>
Hello every noe, Can I use 40-bit float in a C program?
I use ADSP21060.
I'm sorry for asking this question twice just now,But have not get any reply.
I think it's beacause I did't join the group on that time.
So, if anybody knows the way, please tell me again.
Your help will be much appreciated.
Thank you for your reply.

I use Visual DSP++ 3.5.

I tried to use 64-bit double in my program, bu it's low efficiency.

40-bit extended float point can bring me more precision and more efficient.
At 2010-12-04 01:53:32"Mike Rosing" wrote:

>What compiler are you using? You might be able to declare things as
>double and it will be set to 40 bits instead.
>
>On Fri, 3 Dec 2010, ghostzhou_2000 wrote:
>
>>
>Hello every noe, Can I use 40-bit float in a C program?
>I use ADSP21060.
>I'm sorry for asking this question twice just now,But have not get any reply.
>I think it's beacause I did't join the group on that time.
>So, if anybody knows the way, please tell me again.
>Your help will be much appreciated.
Here's what ADI says on the Engineer zone:

VisualDSP++ does not provide support for 40-bit arithmetic in the compiler
and libraries. We agree this should be explained more clearly in the
manual and are planning to address this in the next update.VisualDSP++
does not provide support for 40-bit arithmetic in the compiler and
libraries. We agree this should be explained more clearly in the manual
and are planning to address this in the next update.

So I don't think you can use 40 bit floats in C. You'll have to write the
math sections in assembler.

Here's the web page: http://ez.analog.com/message/7541

Patience, persistence, truth,
Dr. mike

On Sat, 4 Dec 2010,
ghostzhou_2000 wrote:

> Thank you for your reply.

I use Visual DSP++ 3.5.

I tried to use 64-bit double in my program, bu it's low efficiency.

40-bit extended float point can bring me more precision and more efficient.

At 2010-12-04 01:53:32"Mike Rosing" wrote:

>What compiler are you using? You might be able to declare things as
>double and it will be set to 40 bits instead.
>
>On Fri, 3 Dec 2010, ghostzhou_2000 wrote:
>
>>
>Hello every noe, Can I use 40-bit float in a C program?
>I use ADSP21060.
>I'm sorry for asking this question twice just now,But have not get any reply.
>I think it's beacause I did't join the group on that time.
>So, if anybody knows the way, please tell me again.
>Your help will be much appreciated.
Thanks a lot to bobk, mike and fanboy33.
I'm working hard on writing my program in ASM now.
Wish ADI could release a compiler supports 40-bit float someday. ;-)
At 2010-12-05 23:12:29,"Mike Rosing" wrote:
Here's what ADI says on the Engineer zone:

VisualDSP++ does not provide support for 40-bit arithmetic in the compiler
and libraries. We agree this should be explained more clearly in the
manual and are planning to address this in the next update.VisualDSP++
does not provide support for 40-bit arithmetic in the compiler and
libraries. We agree this should be explained more clearly in the manual
and are planning to address this in the next update.

So I don't think you can use 40 bit floats in C. You'll have to write the
math sections in assembler.

Here's the web page:http://ez.analog.com/message/7541

Patience, persistence, truth,
Dr. mike

On Sat, 4 Dec 2010,
ghostzhou_2000 wrote:

> Thank you for your reply.

I use Visual DSP++ 3.5.

I tried to use 64-bit double in my program, bu it's low efficiency.

40-bit extended float point can bring me more precision and more efficient.

At 2010-12-04 01:53:32,"Mike Rosing" wrote:

>What compiler are you using? You might be able to declare things as
>double and it will be set to 40 bits instead.
>
>On Fri, 3 Dec 2010, ghostzhou_2000 wrote:
>
>>
>Hello every noe, Can I use 40-bit float in a C program?
>I use ADSP21060.
>I'm sorry for asking this question twice just now,But have not get any reply.
>I think it's beacause I did't join the group on that time.
>So, if anybody knows the way, please tell me again.
>Your help will be much appreciated.
Please be extra cautious while using 40 bit in your code.
1) Writing the asm calls is very sensitive to syntax.
2) Once you get the code right, please evaluate on hardware. I found lots of 40
bit operations incorrect while I was porting some parts of my code. I had to
validate all the operations using intermediate steps of all the computation.
The above is just my experience with 40 bits arithmetic.

Regards,
Sushil

________________________________
From: ghostzhou_2000
To: Mike Rosing
Cc: A...
Sent: Mon, December 6, 2010 6:49:40 AM
Subject: Re:Re:Re: [adsp] Can I use 40-bit float in a C program?

Thanks a lot to bobk, mike and fanboy33.
I'm working hard on writing my program in ASM now.
Wish ADI could release a compiler supports 40-bit float someday. ;-)
At 2010-12-05 23:12:29,"Mike Rosing" wrote:

>
>Here's what ADI says on the Engineer zone:
>
>VisualDSP++ does not provide support for 40-bit arithmetic in the compiler
>and libraries. We agree this should be explained more clearly in the
>manual and are planning to address this in the next update.VisualDSP++
>does not provide support for 40-bit arithmetic in the compiler and
>libraries. We agree this should be explained more clearly in the manual
>and are planning to address this in the next update.
>
>So I don't think you can use 40 bit floats in C. You'll have to write the
>math sections in assembler.
>
>Here's the web page: http://ez.analog.com/message/7541
>
>Patience, persistence, truth,
>Dr. mike
>
>On Sat, 4 Dec 2010,
>ghostzhou_2000 wrote:
>
>> Thank you for your reply.
>
>I use Visual DSP++ 3.5.
>
>I tried to use 64-bit double in my program, bu it's low efficiency.
>
>40-bit extended float point can bring me more precision and more efficient.
>
>At 2010-12-04 01:53:32,"Mike Rosing" wrote:
>
>>What compiler are you using? You might be able to declare things as
>>double and it will be set to 40 bits instead.
>>
>>On Fri, 3 Dec 2010, ghostzhou_2000 wrote:
>>
>>>
>>Hello every noe, Can I use 40-bit float in a C program?
>>I use ADSP21060.
>>I'm sorry for asking this question twice just now,But have not get any reply.
>>I think it's beacause I did't join the group on that time.
>>So, if anybody knows the way, please tell me again.
>>Your help will be much appreciated.
________________________________
网易163/126邮箱百分百兼容iphone ipad邮件收发