Page 3 of 3
Posted: Thu Aug 24, 2006 9:15 pm
by Trond
Guimauve wrote:Fred wrote:Another important point is about other processors. Does them all support this 80 bit format ?
In theory, all modern processors can support 256 bit format. But this format is used for precisions, not for speed.
For bigger format you need to have a Super Computer, the computers used in astronomy or astrophysics for exemple. And you will not use PureBasic to write program for these computers. (Sorry Fred)
All modern processors supports integers in any number of bits, only limited by physical memory. I can make a 6 144 bit number if I care to wait for the computation time.
currency is a good idea !
Currency isn't an 80-bit float, it's a scaled 64-bit integer. (By a factor of 10000.)
Posted: Fri Aug 25, 2006 8:44 am
by Psychophanta
Trond wrote:All modern processors supports integers in any number of bits, only limited by physical memory. I can make a 6 144 bit number if I care to wait for the computation time.
Well, Trond; when say "a processor supports integers in x number of bits" is meant we are talking about the processors internal registers and buses widths, not about what can we do with the processors.
Posted: Fri Aug 25, 2006 1:41 pm
by Trond
Psychophanta wrote:Trond wrote:All modern processors supports integers in any number of bits, only limited by physical memory. I can make a 6 144 bit number if I care to wait for the computation time.
Well, Trond; when say "a processor supports integers in x number of bits" is meant we are talking about the processors internal registers and buses widths, not about what can we do with the processors.
Then what Guimauve said is still wrong. "Normal" computers handle integers up to 32 bits, 64-bit computers handle integers up to 64 bit natively.
Posted: Fri Aug 25, 2006 4:38 pm
by Guimauve
Trond wrote:All modern processors supports integers in any number of bits, only limited by physical memory. I can make a 6 144 bit number if I care to wait for the computation time.
Ok just show me how you can achive this. For 128 Bit Integer and 128 bit Float variables.
Because I'm highly interested.
Regards
Guimauve
Posted: Fri Aug 25, 2006 5:54 pm
by Trond
Only 128-bit integers. Floats are limited to the size of the fpu registers. But I'll show you, just wait a few seconds.
Code: Select all
; Apple.dq
Apple0.l
Apple1.l
Apple2.l
Apple3.l
; Orange.dq
Orange0.l
Orange1.l
Orange2.l
Orange3.l
; Orange = 92233720368547758
!mov [v_Apple0], 2061584302
!mov [v_Apple1], 21474836
!mov [v_Apple2], 0
!mov [v_Apple3], 0
; Orange = 92233720368547750
!mov [v_Orange0], 2061584294
!mov [v_Orange1], 21474836
!mov [v_Orange2], 0
!mov [v_Orange3], 0
; Apple = Apple + Orange
!mov eax, [v_Apple0]
!mov ecx, [v_Apple1]
!mov edx, [v_Apple2]
!add eax, [v_Orange0]
!adc ecx, [v_Orange1]
!adc edx, [v_Orange3]
!mov [v_Apple0], eax
!mov eax, [v_Apple3]
!adc eax, [v_Orange3]
!mov [v_Apple1], ecx
!mov [v_Apple2], edx
!mov [v_Apple3], eax
; Now how to display it?
Posted: Fri Aug 25, 2006 7:54 pm
by Nik
I don't know much Assembly and even less about the inner orkings of a processor so here is what I could finbd out using my C++ compiler (g++ 4.0.1) on my Intel Mac, it can Cross Compile for PPC and the code runs in rosetta so here are the examples for both architectures:
x86 (-mcpu=Intel Core Duo Prescott core):
Sizeof(long long): 8 bytes
Sizeof(long double): 16 bytes
ppc:
Sizeof(long long):8 bytes
Sizeof(long double): 16 bytes
So it seems bot platforms work with 128 bit floats
Posted: Fri Aug 25, 2006 8:52 pm
by jack
Nik, I suspect that the 10 byte (80 bit) is padded with 6 bytes for code allignment.