Overview
| Artifact ID: | 6312c6358a07f84b91a145f2372a34477b69117880282fd18c989cdc640c6063 |
|---|---|
| Ticket: | 931802a0f552db2e96d2ecf2439bdfb393b49451
Require Tcl_WideInt/Tcl_WideUInt to be exactly 64 bits |
| User & Date: | chrstphrchvz on 2022-09-06 09:11:04 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
Both TIP 72 and the IntObj documentation say that <tt>Tcl_WideInt</tt> (wide integer, and <tt>Tcl_WideUInt</tt> unsigned wide integer) is "at least" 64 bits. For clarity and compatibility, I would propose requiring <tt>Tcl_WideInt</tt> to be exactly 64 bits, at least until some future Tcl version. Some compilers on some platforms, such as GCC and Clang on 64-bit (but not 32-bit), already offer an <tt>__int128</tt> type. 128-bit arithmetic is accomplished using several 64-bit operations, since it is not natively supported by hardware (general purpose register file/ALU), similar to how 64-bit operations are accomplished on 32-bit platforms. But even without native 128-bit arithmetic, <tt>__int128</tt> could still be far faster than bignum for any Tcl applications doing up to 128-bit computing. However, I would think far more software, including core Tcl, would be broken by defining <tt>Tcl_WideInt</tt> as wider than 64-bit. And following TIP 484, there is presumably little interest in Tcl once again having two "native" integer types (wide and double-wide). So maybe defining <tt>Tcl_WideInt</tt> as anything other than 64 bit, e.g.<tt>__int128</tt>, should be forbidden. Alternatively, if <tt>Tcl_WideInt</tt> is to ever be redefined as (preferably exactly) 128-bit, it should be done by some future Tcl version when the ABI is allowed to change.
- is_private changed to: "0"
- login: "chrstphrchvz"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "chrstphrchvz"
- subsystem changed to: "10. Objects"
- title changed to:
Require Tcl_WideInt/Tcl_WideUInt to be exactly 64 bits
- type changed to: "RFE"