Discussion:
Question about Word128
(too old to reply)
Aelita
2018-08-06 17:10:11 UTC
Permalink
Hello!

My name is Aelita and for many years I have been fruitfully using your wonderful freepascal
for my research in algebra, geometry and physics.
Thank you for your inspirational work!

I'm very interested in seeing the numbers Word128 and Int128 appear in freepascal
(with natural operations A*B, A div B, A mod B, A xor B, A shl N, etc.)!

Is there a chance that this will happen in the near future?

Thanks again,
Aelita
--
С уважением,
Aelita mailto:aelita-***@narod.ru

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://li
Sven Barth via fpc-devel
2018-08-07 09:09:17 UTC
Permalink
Post by Aelita
Hello!
My name is Aelita and for many years I have been fruitfully using your wonderful freepascal
for my research in algebra, geometry and physics.
Thank you for your inspirational work!
I'm very interested in seeing the numbers Word128 and Int128 appear in freepascal
(with natural operations A*B, A div B, A mod B, A xor B, A shl N, etc.)!
Is there a chance that this will happen in the near future?
Using records and operator overloading you can implement them yourself. No
need to burden the compiler with it. The only disadvantage would be the
inability to use that large literals... but that could be helped a bit with
conversions from floating points,at least if full accuracy isn't required.

Regards,
Sven
J. Gareth Moreton
2018-08-07 14:11:52 UTC
Permalink
I think there was talk at one point about implementing Float128 (or
"Quadruple") for Free Pascal, mostly for internal compiler purposes.  For
OWords though (or is it EWords or DQWords?) I think a library or package
will be better initially.  Still, it might be something to consider if
Intel or another processor manufacturer introduce 128-bit number functions
for XMM registers and equivalent.

Gareth aka. Kit

On Tue 07/08/18 10:09 , Sven Barth via fpc-devel
fpc-***@lists.freepascal.org sent:
Aelita schrieb am Di., 7. Aug. 2018, 09:53:
Hello!

My name is Aelita and for many years I have been fruitfully using your
wonderful freepascal
for my research in algebra, geometry and physics.
Thank you for your inspirational work!

I'm very interested in seeing the numbers Word128 and Int128 appear in
freepascal
(with natural operations A*B, A div B, A mod B, A xor B, A shl N, etc.)!

Is there a chance that this will happen in the near future?

Using records and operator overloading you can implement them yourself. No
need to burden the compiler with it. The only disadvantage would be the
inability to use that large literals... but that could be helped a bit with
conversions from floating points,at least if full accuracy isn't
required. 
Regards,  Sven  _______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[3]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



Links:
Kirinn
2018-08-07 21:06:28 UTC
Permalink
To be clear, 128-bit octawords and the like are not natively supported
on most consumer-oriented processors. To support 128-bit operations, an
extensive emulation layer would need to be set up, not an easy task
within the scope of a compiler and the RTL.

If you need 128-bit integer maths in the near future, your best bet
would be to write a quick and dirty implementation yourself with records
and operator overloading, as Sven described. Has anyone done that yet?
It might make an interesting unit for the Free Component Library or
something.

I note that SysUtils includes an "Int128Rec", which is a record type for
holding a 128-bit int. Looks like it's currently used only by
InterlockedCompareExchange128. Someone brave could expand upon that.

~Kirinn
Post by J. Gareth Moreton
I think there was talk at one point about implementing Float128 (or
"Quadruple") for Free Pascal, mostly for internal compiler purposes. 
For OWords though (or is it EWords or DQWords?) I think a library or
package will be better initially.  Still, it might be something to
consider if Intel or another processor manufacturer introduce 128-bit
number functions for XMM registers and equivalent.
Gareth aka. Kit
On Tue 07/08/18 10:09 , Sven Barth via fpc-devel
Hello!
My name is Aelita and for many years I have been fruitfully
using your wonderful freepascal
for my research in algebra, geometry and physics.
Thank you for your inspirational work!
I'm very interested in seeing the numbers Word128 and Int128
appear in freepascal
(with natural operations A*B, A div B, A mod B, A xor B, A shl N, etc.)!
Is there a chance that this will happen in the near future?
Using records and operator overloading you can implement them
yourself. No need to burden the compiler with it. The only
disadvantage would be the inability to use that large literals...
but that could be helped a bit with conversions from floating
points,at least if full accuracy isn't required.
Regards,
Sven
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
<%3Ca%20href=>">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
J. Gareth Moreton
2018-08-08 00:24:19 UTC
Permalink
I'll happily give it a shot, so long as I don't give myself too many
side-projects that I forget more important things!

Gareth aka. Kit

On Tue 07/08/18 22:06 , Kirinn ***@mooncore.eu sent:

To be clear, 128-bit octawords and the like are not natively supported on
most consumer-oriented processors. To support 128-bit operations, an
extensive emulation layer would need to be set up, not an easy task within
the scope of a compiler and the RTL.

If you need 128-bit integer maths in the near future, your best bet would
be to write a quick and dirty implementation yourself with records and
operator overloading, as Sven described. Has anyone done that yet? It might
make an interesting unit for the Free Component Library or something.

I note that SysUtils includes an "Int128Rec", which is a record type for
holding a 128-bit int. Looks like it's currently used only by
InterlockedCompareExchange128. Someone brave could expand upon that.

~Kirinn

On 08/07/2018 03:11 PM, J. Gareth Moreton wrote:
I think there was talk at one point about implementing Float128 (or
"Quadruple") for Free Pascal, mostly for internal compiler purposes.  For
OWords though (or is it EWords or DQWords?) I think a library or package
will be better initially.  Still, it might be something to consider if
Intel or another processor manufacturer introduce 128-bit number functions
for XMM registers and equivalent.

Gareth aka. Kit

On Tue 07/08/18 10:09 , Sven Barth via fpc-devel
fpc-***@lists.freepascal.org [1] sent:
Aelita schrieb am Di., 7. Aug. 2018, 09:53:
Hello!

My name is Aelita and for many years I have been fruitfully using your
wonderful freepascal
for my research in algebra, geometry and physics.
Thank you for your inspirational work!

I'm very interested in seeing the numbers Word128 and Int128 appear in
freepascal
(with natural operations A*B, A div B, A mod B, A xor B, A shl N, etc.)!

Is there a chance that this will happen in the near future?

Using records and operator overloading you can implement them yourself.
No need to burden the compiler with it. The only disadvantage would be the
inability to use that large literals... but that could be helped a bit with
conversions from floating points,at least if full accuracy isn't
required. 
Regards,  Sven  _______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [3]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[4]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel [5]

_______________________________________________ 
fpc-devel maillist - fpc-***@lists.freepascal.org 
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel 

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [6]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[7]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



Links:
------
[1] mailto:fpc-***@lists.freepascal.org
[2] mailto:aelita-***@narod.ru
[3] mailto:fpc-***@lists.freepascal.org
[4] http://secureweb.fast.net.uk/ http:=
[5] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[6] mailto:fpc-***@lists.freepascal.org
[7] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Loading...