How does Rust's 128-bit integer `i128` work on a 64-bit system?Is there hardware support for 128bit integers in modern processors?How can I use a custom type for keys in a boost::unordered_map?How to convert a decimal ascii string to integer array in C?An efficient way to do basic 128 bit integer calculations in C++?Why does Rust bother with “let”?Chaining checked arithmetic operations in Rust__int128 supported by emscripten? If not, how to implement 128 bit int multiplication?How do I evaluate expressions in Rust's macro system?Why does a generic function replicating C's fread for unsigned integers always return zero?How can I implement the From trait for all types implementing a trait but use a specific implementation for certain types?Reading UINT 128 from Node JS Buffer

HackerRank Implement Queue using two stacks Solution

Map vs. Table for index-specific operations on 2D arrays

Can it be useful for a player block with a hanging piece in a back rank mate situation?

Partial Fractions: Why does this shortcut method work?

Does the problem of P vs NP come under the category of Operational Research?

Ernie and the Superconducting Boxes

Why do player start with fighting for the corners in go?

How does Rust's 128-bit integer `i128` work on a 64-bit system?

δόλος = deceit in John 1:47

Pre-Greek θάλασσα "thalassa" and Turkish talaz

How did Biff return to 2015 from 1955 without a lightning strike?

Does KNN have a loss function?

How do people drown while wearing a life jacket?

How to structure presentation to avoid getting questions that will be answered later in the presentation?

Has J.J.Jameson ever found out that Peter Parker is Spider-Man?

Went to a big 4 but got fired for underperformance in a year recently - Now every one thinks I'm pro - How to balance expectations?

"Fewer errors means better products" or "Fewer errors mean better products"?

Misrepresentation on DS-160

Selecting rows conflicting values in WHERE clause

Backpacking with incontinence

Should I take up a Creative Writing online course?

What sort of solar system / atmospheric conditions, if any, would allow for a very cold planet that still receives plenty of light from its sun?

How to draw twisted cuves?

Could flaps be raised upward to serve as spoilers / lift dumpers?



How does Rust's 128-bit integer `i128` work on a 64-bit system?


Is there hardware support for 128bit integers in modern processors?How can I use a custom type for keys in a boost::unordered_map?How to convert a decimal ascii string to integer array in C?An efficient way to do basic 128 bit integer calculations in C++?Why does Rust bother with “let”?Chaining checked arithmetic operations in Rust__int128 supported by emscripten? If not, how to implement 128 bit int multiplication?How do I evaluate expressions in Rust's macro system?Why does a generic function replicating C's fread for unsigned integers always return zero?How can I implement the From trait for all types implementing a trait but use a specific implementation for certain types?Reading UINT 128 from Node JS Buffer






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6















Rust has 128-bit integers, denoted with the datatype i128 (and u128 for unsigned ints):



let a: i128 = 170141183460469231731687303715884105727;


How does Rust make these i128 values work on a 64-bit OS? How does it do arithmetic on these? Since, as far as I know, the value cannot fit in one register of a x86-64 CPU. Does the compiler somehow use 2 registers for one i128 value, or are they using some kind of big integer struct to represent them?










share|improve this question
































    6















    Rust has 128-bit integers, denoted with the datatype i128 (and u128 for unsigned ints):



    let a: i128 = 170141183460469231731687303715884105727;


    How does Rust make these i128 values work on a 64-bit OS? How does it do arithmetic on these? Since, as far as I know, the value cannot fit in one register of a x86-64 CPU. Does the compiler somehow use 2 registers for one i128 value, or are they using some kind of big integer struct to represent them?










    share|improve this question




























      6












      6








      6








      Rust has 128-bit integers, denoted with the datatype i128 (and u128 for unsigned ints):



      let a: i128 = 170141183460469231731687303715884105727;


      How does Rust make these i128 values work on a 64-bit OS? How does it do arithmetic on these? Since, as far as I know, the value cannot fit in one register of a x86-64 CPU. Does the compiler somehow use 2 registers for one i128 value, or are they using some kind of big integer struct to represent them?










      share|improve this question
















      Rust has 128-bit integers, denoted with the datatype i128 (and u128 for unsigned ints):



      let a: i128 = 170141183460469231731687303715884105727;


      How does Rust make these i128 values work on a 64-bit OS? How does it do arithmetic on these? Since, as far as I know, the value cannot fit in one register of a x86-64 CPU. Does the compiler somehow use 2 registers for one i128 value, or are they using some kind of big integer struct to represent them?







      rust int128 llvm-codegen






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 7 hours ago









      Lukas Kalbertodt

      29.4k4 gold badges75 silver badges140 bronze badges




      29.4k4 gold badges75 silver badges140 bronze badges










      asked 9 hours ago









      ruoholaruohola

      5,7013 gold badges10 silver badges38 bronze badges




      5,7013 gold badges10 silver badges38 bronze badges

























          3 Answers
          3






          active

          oldest

          votes


















          9














          All Rust's integer types are compiled to LLVM integers. The LLVM abstract machine allows integers of any bit width from 1 to 2^23 - 1.* LLVM instructions typically work on integers of any size.



          Obviously, there aren't many 8388607-bit architectures out there, so when the code is compiled to native machine code, LLVM has to decide how to implement it. The semantics of an abstract instruction like add are defined by LLVM. Typically, instructions that have a single-instruction equivalent in native code will be compiled to that instruction, while those that don't will be emulated, possibly with multiple instructions. mcarton's answer demonstrates both native and emulated instructions.



          (This doesn't only apply to integers that are larger than the native machine can support, but also to those that are smaller. For example, modern architectures might not support native 8-bit arithmetic, so an add instruction on two i8s may be emulated with a wider instruction, the extra bits discarded.)




          Does the compiler somehow use 2 registers for one i128 value? Or are they using some kind of big integer struct to represent them?




          At the level of LLVM IR, the answer is neither: i128 fits in a single register, just like every other single-valued type. On the other hand, once translated to machine code, there isn't really a difference between the two, because structs may be decomposed into registers just like integers. When doing arithmetic, though, loading the whole thing into two registers is a pretty safe bet.




          * Although I understand that support for sizes larger than 128 and non-powers of two is spotty and the implementation may have bugs, which may partly explain why Rust only exposes 1-, 8-, 16-, 32-, 64-, and 128-bit integers.






          share|improve this answer


































            6














            The compiler will store these in multiple registers and use multiple instructions to do arithmetic on those values if needed. For example, given



            fn main() 
            let a = 42u128;
            let b = a + 1337;



            the compiler generates:



            playground::main:
            sub rsp, 56
            mov qword ptr [rsp + 32], 0
            mov qword ptr [rsp + 24], 42
            mov rax, qword ptr [rsp + 24]
            mov rcx, qword ptr [rsp + 32]
            add rax, 1337
            adc rcx, 0
            setb dl
            mov rsi, rax
            test dl, 1
            mov qword ptr [rsp + 16], rax
            mov qword ptr [rsp + 8], rsi
            mov qword ptr [rsp], rcx
            jne .LBB8_2
            mov rax, qword ptr [rsp + 16]
            mov qword ptr [rsp + 40], rax
            mov rcx, qword ptr [rsp]
            mov qword ptr [rsp + 48], rcx
            add rsp, 56
            ret


            where you can see that the value 42 is stored in rax and rcx. For comparison, here is the simpler 64 bits variant:



            playground::main:
            sub rsp, 24
            mov qword ptr [rsp + 8], 42
            mov rax, qword ptr [rsp + 8]
            add rax, 1337
            setb cl
            test cl, 1
            mov qword ptr [rsp], rax
            jne .LBB8_2
            mov rax, qword ptr [rsp]
            mov qword ptr [rsp + 16], rax
            add rsp, 24
            ret





            share|improve this answer
































              -1














              64 bit in a 64 bit architecture refers to the length of address to the actual position in memory.



              128 bit in in the i128 type refers to the size of the data which is stored at the location






              share|improve this answer




















              • 3





                Okay, so how would one divide this number by 2, for example? 64-bit computers can only divide 64-, 32- and 16-bit numbers, if I'm not mistaken

                – ForceBru
                8 hours ago







              • 1





                @ForceBru There isn't any particular reason why a 32 or 64 bit system couldn't implement 128 bit addition in a single instruction. In fact, many architectures support it in a limited way - e.g. producing a 128 bit result from a 64 bit operation. See stackoverflow.com/a/34239917/493729.

                – Peter Hall
                6 hours ago













              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f57340308%2fhow-does-rusts-128-bit-integer-i128-work-on-a-64-bit-system%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              9














              All Rust's integer types are compiled to LLVM integers. The LLVM abstract machine allows integers of any bit width from 1 to 2^23 - 1.* LLVM instructions typically work on integers of any size.



              Obviously, there aren't many 8388607-bit architectures out there, so when the code is compiled to native machine code, LLVM has to decide how to implement it. The semantics of an abstract instruction like add are defined by LLVM. Typically, instructions that have a single-instruction equivalent in native code will be compiled to that instruction, while those that don't will be emulated, possibly with multiple instructions. mcarton's answer demonstrates both native and emulated instructions.



              (This doesn't only apply to integers that are larger than the native machine can support, but also to those that are smaller. For example, modern architectures might not support native 8-bit arithmetic, so an add instruction on two i8s may be emulated with a wider instruction, the extra bits discarded.)




              Does the compiler somehow use 2 registers for one i128 value? Or are they using some kind of big integer struct to represent them?




              At the level of LLVM IR, the answer is neither: i128 fits in a single register, just like every other single-valued type. On the other hand, once translated to machine code, there isn't really a difference between the two, because structs may be decomposed into registers just like integers. When doing arithmetic, though, loading the whole thing into two registers is a pretty safe bet.




              * Although I understand that support for sizes larger than 128 and non-powers of two is spotty and the implementation may have bugs, which may partly explain why Rust only exposes 1-, 8-, 16-, 32-, 64-, and 128-bit integers.






              share|improve this answer































                9














                All Rust's integer types are compiled to LLVM integers. The LLVM abstract machine allows integers of any bit width from 1 to 2^23 - 1.* LLVM instructions typically work on integers of any size.



                Obviously, there aren't many 8388607-bit architectures out there, so when the code is compiled to native machine code, LLVM has to decide how to implement it. The semantics of an abstract instruction like add are defined by LLVM. Typically, instructions that have a single-instruction equivalent in native code will be compiled to that instruction, while those that don't will be emulated, possibly with multiple instructions. mcarton's answer demonstrates both native and emulated instructions.



                (This doesn't only apply to integers that are larger than the native machine can support, but also to those that are smaller. For example, modern architectures might not support native 8-bit arithmetic, so an add instruction on two i8s may be emulated with a wider instruction, the extra bits discarded.)




                Does the compiler somehow use 2 registers for one i128 value? Or are they using some kind of big integer struct to represent them?




                At the level of LLVM IR, the answer is neither: i128 fits in a single register, just like every other single-valued type. On the other hand, once translated to machine code, there isn't really a difference between the two, because structs may be decomposed into registers just like integers. When doing arithmetic, though, loading the whole thing into two registers is a pretty safe bet.




                * Although I understand that support for sizes larger than 128 and non-powers of two is spotty and the implementation may have bugs, which may partly explain why Rust only exposes 1-, 8-, 16-, 32-, 64-, and 128-bit integers.






                share|improve this answer





























                  9












                  9








                  9







                  All Rust's integer types are compiled to LLVM integers. The LLVM abstract machine allows integers of any bit width from 1 to 2^23 - 1.* LLVM instructions typically work on integers of any size.



                  Obviously, there aren't many 8388607-bit architectures out there, so when the code is compiled to native machine code, LLVM has to decide how to implement it. The semantics of an abstract instruction like add are defined by LLVM. Typically, instructions that have a single-instruction equivalent in native code will be compiled to that instruction, while those that don't will be emulated, possibly with multiple instructions. mcarton's answer demonstrates both native and emulated instructions.



                  (This doesn't only apply to integers that are larger than the native machine can support, but also to those that are smaller. For example, modern architectures might not support native 8-bit arithmetic, so an add instruction on two i8s may be emulated with a wider instruction, the extra bits discarded.)




                  Does the compiler somehow use 2 registers for one i128 value? Or are they using some kind of big integer struct to represent them?




                  At the level of LLVM IR, the answer is neither: i128 fits in a single register, just like every other single-valued type. On the other hand, once translated to machine code, there isn't really a difference between the two, because structs may be decomposed into registers just like integers. When doing arithmetic, though, loading the whole thing into two registers is a pretty safe bet.




                  * Although I understand that support for sizes larger than 128 and non-powers of two is spotty and the implementation may have bugs, which may partly explain why Rust only exposes 1-, 8-, 16-, 32-, 64-, and 128-bit integers.






                  share|improve this answer















                  All Rust's integer types are compiled to LLVM integers. The LLVM abstract machine allows integers of any bit width from 1 to 2^23 - 1.* LLVM instructions typically work on integers of any size.



                  Obviously, there aren't many 8388607-bit architectures out there, so when the code is compiled to native machine code, LLVM has to decide how to implement it. The semantics of an abstract instruction like add are defined by LLVM. Typically, instructions that have a single-instruction equivalent in native code will be compiled to that instruction, while those that don't will be emulated, possibly with multiple instructions. mcarton's answer demonstrates both native and emulated instructions.



                  (This doesn't only apply to integers that are larger than the native machine can support, but also to those that are smaller. For example, modern architectures might not support native 8-bit arithmetic, so an add instruction on two i8s may be emulated with a wider instruction, the extra bits discarded.)




                  Does the compiler somehow use 2 registers for one i128 value? Or are they using some kind of big integer struct to represent them?




                  At the level of LLVM IR, the answer is neither: i128 fits in a single register, just like every other single-valued type. On the other hand, once translated to machine code, there isn't really a difference between the two, because structs may be decomposed into registers just like integers. When doing arithmetic, though, loading the whole thing into two registers is a pretty safe bet.




                  * Although I understand that support for sizes larger than 128 and non-powers of two is spotty and the implementation may have bugs, which may partly explain why Rust only exposes 1-, 8-, 16-, 32-, 64-, and 128-bit integers.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 8 hours ago

























                  answered 8 hours ago









                  trentcltrentcl

                  7,8833 gold badges20 silver badges39 bronze badges




                  7,8833 gold badges20 silver badges39 bronze badges


























                      6














                      The compiler will store these in multiple registers and use multiple instructions to do arithmetic on those values if needed. For example, given



                      fn main() 
                      let a = 42u128;
                      let b = a + 1337;



                      the compiler generates:



                      playground::main:
                      sub rsp, 56
                      mov qword ptr [rsp + 32], 0
                      mov qword ptr [rsp + 24], 42
                      mov rax, qword ptr [rsp + 24]
                      mov rcx, qword ptr [rsp + 32]
                      add rax, 1337
                      adc rcx, 0
                      setb dl
                      mov rsi, rax
                      test dl, 1
                      mov qword ptr [rsp + 16], rax
                      mov qword ptr [rsp + 8], rsi
                      mov qword ptr [rsp], rcx
                      jne .LBB8_2
                      mov rax, qword ptr [rsp + 16]
                      mov qword ptr [rsp + 40], rax
                      mov rcx, qword ptr [rsp]
                      mov qword ptr [rsp + 48], rcx
                      add rsp, 56
                      ret


                      where you can see that the value 42 is stored in rax and rcx. For comparison, here is the simpler 64 bits variant:



                      playground::main:
                      sub rsp, 24
                      mov qword ptr [rsp + 8], 42
                      mov rax, qword ptr [rsp + 8]
                      add rax, 1337
                      setb cl
                      test cl, 1
                      mov qword ptr [rsp], rax
                      jne .LBB8_2
                      mov rax, qword ptr [rsp]
                      mov qword ptr [rsp + 16], rax
                      add rsp, 24
                      ret





                      share|improve this answer





























                        6














                        The compiler will store these in multiple registers and use multiple instructions to do arithmetic on those values if needed. For example, given



                        fn main() 
                        let a = 42u128;
                        let b = a + 1337;



                        the compiler generates:



                        playground::main:
                        sub rsp, 56
                        mov qword ptr [rsp + 32], 0
                        mov qword ptr [rsp + 24], 42
                        mov rax, qword ptr [rsp + 24]
                        mov rcx, qword ptr [rsp + 32]
                        add rax, 1337
                        adc rcx, 0
                        setb dl
                        mov rsi, rax
                        test dl, 1
                        mov qword ptr [rsp + 16], rax
                        mov qword ptr [rsp + 8], rsi
                        mov qword ptr [rsp], rcx
                        jne .LBB8_2
                        mov rax, qword ptr [rsp + 16]
                        mov qword ptr [rsp + 40], rax
                        mov rcx, qword ptr [rsp]
                        mov qword ptr [rsp + 48], rcx
                        add rsp, 56
                        ret


                        where you can see that the value 42 is stored in rax and rcx. For comparison, here is the simpler 64 bits variant:



                        playground::main:
                        sub rsp, 24
                        mov qword ptr [rsp + 8], 42
                        mov rax, qword ptr [rsp + 8]
                        add rax, 1337
                        setb cl
                        test cl, 1
                        mov qword ptr [rsp], rax
                        jne .LBB8_2
                        mov rax, qword ptr [rsp]
                        mov qword ptr [rsp + 16], rax
                        add rsp, 24
                        ret





                        share|improve this answer



























                          6












                          6








                          6







                          The compiler will store these in multiple registers and use multiple instructions to do arithmetic on those values if needed. For example, given



                          fn main() 
                          let a = 42u128;
                          let b = a + 1337;



                          the compiler generates:



                          playground::main:
                          sub rsp, 56
                          mov qword ptr [rsp + 32], 0
                          mov qword ptr [rsp + 24], 42
                          mov rax, qword ptr [rsp + 24]
                          mov rcx, qword ptr [rsp + 32]
                          add rax, 1337
                          adc rcx, 0
                          setb dl
                          mov rsi, rax
                          test dl, 1
                          mov qword ptr [rsp + 16], rax
                          mov qword ptr [rsp + 8], rsi
                          mov qword ptr [rsp], rcx
                          jne .LBB8_2
                          mov rax, qword ptr [rsp + 16]
                          mov qword ptr [rsp + 40], rax
                          mov rcx, qword ptr [rsp]
                          mov qword ptr [rsp + 48], rcx
                          add rsp, 56
                          ret


                          where you can see that the value 42 is stored in rax and rcx. For comparison, here is the simpler 64 bits variant:



                          playground::main:
                          sub rsp, 24
                          mov qword ptr [rsp + 8], 42
                          mov rax, qword ptr [rsp + 8]
                          add rax, 1337
                          setb cl
                          test cl, 1
                          mov qword ptr [rsp], rax
                          jne .LBB8_2
                          mov rax, qword ptr [rsp]
                          mov qword ptr [rsp + 16], rax
                          add rsp, 24
                          ret





                          share|improve this answer













                          The compiler will store these in multiple registers and use multiple instructions to do arithmetic on those values if needed. For example, given



                          fn main() 
                          let a = 42u128;
                          let b = a + 1337;



                          the compiler generates:



                          playground::main:
                          sub rsp, 56
                          mov qword ptr [rsp + 32], 0
                          mov qword ptr [rsp + 24], 42
                          mov rax, qword ptr [rsp + 24]
                          mov rcx, qword ptr [rsp + 32]
                          add rax, 1337
                          adc rcx, 0
                          setb dl
                          mov rsi, rax
                          test dl, 1
                          mov qword ptr [rsp + 16], rax
                          mov qword ptr [rsp + 8], rsi
                          mov qword ptr [rsp], rcx
                          jne .LBB8_2
                          mov rax, qword ptr [rsp + 16]
                          mov qword ptr [rsp + 40], rax
                          mov rcx, qword ptr [rsp]
                          mov qword ptr [rsp + 48], rcx
                          add rsp, 56
                          ret


                          where you can see that the value 42 is stored in rax and rcx. For comparison, here is the simpler 64 bits variant:



                          playground::main:
                          sub rsp, 24
                          mov qword ptr [rsp + 8], 42
                          mov rax, qword ptr [rsp + 8]
                          add rax, 1337
                          setb cl
                          test cl, 1
                          mov qword ptr [rsp], rax
                          jne .LBB8_2
                          mov rax, qword ptr [rsp]
                          mov qword ptr [rsp + 16], rax
                          add rsp, 24
                          ret






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 8 hours ago









                          mcartonmcarton

                          9,1692 gold badges27 silver badges38 bronze badges




                          9,1692 gold badges27 silver badges38 bronze badges
























                              -1














                              64 bit in a 64 bit architecture refers to the length of address to the actual position in memory.



                              128 bit in in the i128 type refers to the size of the data which is stored at the location






                              share|improve this answer




















                              • 3





                                Okay, so how would one divide this number by 2, for example? 64-bit computers can only divide 64-, 32- and 16-bit numbers, if I'm not mistaken

                                – ForceBru
                                8 hours ago







                              • 1





                                @ForceBru There isn't any particular reason why a 32 or 64 bit system couldn't implement 128 bit addition in a single instruction. In fact, many architectures support it in a limited way - e.g. producing a 128 bit result from a 64 bit operation. See stackoverflow.com/a/34239917/493729.

                                – Peter Hall
                                6 hours ago















                              -1














                              64 bit in a 64 bit architecture refers to the length of address to the actual position in memory.



                              128 bit in in the i128 type refers to the size of the data which is stored at the location






                              share|improve this answer




















                              • 3





                                Okay, so how would one divide this number by 2, for example? 64-bit computers can only divide 64-, 32- and 16-bit numbers, if I'm not mistaken

                                – ForceBru
                                8 hours ago







                              • 1





                                @ForceBru There isn't any particular reason why a 32 or 64 bit system couldn't implement 128 bit addition in a single instruction. In fact, many architectures support it in a limited way - e.g. producing a 128 bit result from a 64 bit operation. See stackoverflow.com/a/34239917/493729.

                                – Peter Hall
                                6 hours ago













                              -1












                              -1








                              -1







                              64 bit in a 64 bit architecture refers to the length of address to the actual position in memory.



                              128 bit in in the i128 type refers to the size of the data which is stored at the location






                              share|improve this answer













                              64 bit in a 64 bit architecture refers to the length of address to the actual position in memory.



                              128 bit in in the i128 type refers to the size of the data which is stored at the location







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered 8 hours ago









                              erkandemerkandem

                              971 silver badge5 bronze badges




                              971 silver badge5 bronze badges










                              • 3





                                Okay, so how would one divide this number by 2, for example? 64-bit computers can only divide 64-, 32- and 16-bit numbers, if I'm not mistaken

                                – ForceBru
                                8 hours ago







                              • 1





                                @ForceBru There isn't any particular reason why a 32 or 64 bit system couldn't implement 128 bit addition in a single instruction. In fact, many architectures support it in a limited way - e.g. producing a 128 bit result from a 64 bit operation. See stackoverflow.com/a/34239917/493729.

                                – Peter Hall
                                6 hours ago












                              • 3





                                Okay, so how would one divide this number by 2, for example? 64-bit computers can only divide 64-, 32- and 16-bit numbers, if I'm not mistaken

                                – ForceBru
                                8 hours ago







                              • 1





                                @ForceBru There isn't any particular reason why a 32 or 64 bit system couldn't implement 128 bit addition in a single instruction. In fact, many architectures support it in a limited way - e.g. producing a 128 bit result from a 64 bit operation. See stackoverflow.com/a/34239917/493729.

                                – Peter Hall
                                6 hours ago







                              3




                              3





                              Okay, so how would one divide this number by 2, for example? 64-bit computers can only divide 64-, 32- and 16-bit numbers, if I'm not mistaken

                              – ForceBru
                              8 hours ago






                              Okay, so how would one divide this number by 2, for example? 64-bit computers can only divide 64-, 32- and 16-bit numbers, if I'm not mistaken

                              – ForceBru
                              8 hours ago





                              1




                              1





                              @ForceBru There isn't any particular reason why a 32 or 64 bit system couldn't implement 128 bit addition in a single instruction. In fact, many architectures support it in a limited way - e.g. producing a 128 bit result from a 64 bit operation. See stackoverflow.com/a/34239917/493729.

                              – Peter Hall
                              6 hours ago





                              @ForceBru There isn't any particular reason why a 32 or 64 bit system couldn't implement 128 bit addition in a single instruction. In fact, many architectures support it in a limited way - e.g. producing a 128 bit result from a 64 bit operation. See stackoverflow.com/a/34239917/493729.

                              – Peter Hall
                              6 hours ago

















                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f57340308%2fhow-does-rusts-128-bit-integer-i128-work-on-a-64-bit-system%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                              Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                              Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її