Skip to contentSkip to conversation

About integer64

DISCUSSION Abramo Bagnara 3 participants 4 messages May 9, 2002 – May 11, 2002 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 13 lines · Paul Davis
Quoted 3 lines

What I'm misunderstanding? I tend to interpret the former and the latter statements in a contradictory way.

my reading of the "docs" (the Mac OS X driver and utilities) is that RME haven't figured out a way to truncate the 64 bit fixed point representation to a 32 bit integer using the Xilinx FPGA. they have figured out how to render it as a 64 bit integer. so, they do the math using a fixed point representation, then transform to 64 bit integer when storing it in the register. the final part of the transform is done by the host CPU, in our case up in user space since we can't do float math conveniently in the kernel.

Quoted 1 line

does that make it clearer?

Not very much:
a) if 32 bit integer could be enough expressive, what's the problem to truncate it in your driver?
b) if a 32 bit integer is not enough and a float is preferrable:
considered that an ieee754 floating point is in the form (1+man)*2^exp what's the problem in converting it in your driver using ffs and some shift?

With both way I don't see the two point you make:
1) why bother with signed vs unsigned
2) why use 64 bit integer

Of course if a 64 bit integer is the best way to represent/report the value all is fine, but in this case I doubt that you don't have available the 64th bit for the sign.

Signature · 13 lines
Abramo Bagnara                       mailto:[email protected]

Opera Unica                          Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy

ALSA project               http://www.alsa-project.org
It sounds good!

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [email protected]
#2 lore raw
Quoted 3 lines

Not very much:
a) if 32 bit integer could be enough expressive, what's the problem to truncate it in your driver?

if i knew that this was true, i would do so. i don't know that. the rms meters are the *only* registers on the h-dsp that are 64 bit, so i assume there is some reason for this.

Quoted 4 lines

b) if a 32 bit integer is not enough and a float is preferrable:
considered that an ieee754 floating point is in the form (1+man)*2^exp what's the problem in converting it in your driver using ffs and some shift?

if the lkml crew see us using floating point in any form in the kernel, we will attract complaints, even if we use integer operations to do so. i am firmly convinced of this.

Quoted 2 lines

With both way I don't see the two point you make:
1) why bother with signed vs unsigned

for purity abramo! for purity!

Quoted 5 lines

2) why use 64 bit integer

Of course if a 64 bit integer is the best way to represent/report the value all is fine, but in this case I doubt that you don't have available the 64th bit for the sign.

that seems likely to me also. i suspect we have somewhere between 32 and 64 bits of information.

i didn't say that i conclusively needed the sign bit - i was noting that the current API doesn't make unsigned values possible.

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [email protected]

#3 lore raw
Quoted 9 lines · Paul Davis
Quoted 5 lines

b) if a 32 bit integer is not enough and a float is preferrable:
considered that an ieee754 floating point is in the form (1+man)*2^exp what's the problem in converting it in your driver using ffs and some shift?

if the lkml crew see us using floating point in any form in the kernel, we will attract complaints, even if we use integer operations to do so. i am firmly convinced of this.

I don't think so: try to fgrep for float in kernel source, you'll find several place where they're stored (and I suppose for good reason).

Also I've read a recent post from Alan Cox explaining *how* to use floating point in kernel space. This presuppose that it's not a serious sin if it's justified.

Quoted 11 lines
Quoted 5 lines

2) why use 64 bit integer

Of course if a 64 bit integer is the best way to represent/report the value all is fine, but in this case I doubt that you don't have available the 64th bit for the sign.

that seems likely to me also. i suspect we have somewhere between 32 and 64 bits of information.

i didn't say that i conclusively needed the sign bit - i was noting that the current API doesn't make unsigned values possible.

Please specify that then, you know, Jaroslav is faster than the dust to insert new features, if you make him to believe they're needed ;-)

Better to insert them when and *if* they're needed: maintanance is easier in this way.

Signature · 13 lines
Abramo Bagnara                       mailto:[email protected]

Opera Unica                          Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy

ALSA project               http://www.alsa-project.org
It sounds good!

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [email protected]
#4 lore raw
In reply to Paul Davis
Quoted 42 lines · Paul Davis
Quoted 5 lines

Not very much:
a) if 32 bit integer could be enough expressive, what's the problem to truncate it in your driver?

if i knew that this was true, i would do so. i don't know that. the rms meters are the *only* registers on the h-dsp that are 64 bit, so i assume there is some reason for this.

Quoted 6 lines

b) if a 32 bit integer is not enough and a float is preferrable:
considered that an ieee754 floating point is in the form (1+man)*2^exp what's the problem in converting it in your driver using ffs and some shift?

if the lkml crew see us using floating point in any form in the kernel, we will attract complaints, even if we use integer operations to do so. i am firmly convinced of this.

Quoted 4 lines

With both way I don't see the two point you make:
1) why bother with signed vs unsigned

for purity abramo! for purity!

Quoted 7 lines

2) why use 64 bit integer

Of course if a 64 bit integer is the best way to represent/report the value all is fine, but in this case I doubt that you don't have available the 64th bit for the sign.

Quoted 8 lines

that seems likely to me also. i suspect we have somewhere between 32 and 64 bits of information.

i didn't say that i conclusively needed the sign bit - i was noting that the current API doesn't make unsigned values possible.

What is wrong with useing floats in the alsa-lib, and then casting them to uint64 for all calls to the kernel. That way, the kernel only ever sees a uint64, but the application sees a nice float.

Cheers
James

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [email protected]