Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: bf5258cc7509b19ef9e55b167204eec09fd2397c
Ticket: 1878989fffffffffffffffffffffffffffffffff
avoid bigints for some multiplications
User & Date: msofer on 2008-01-24 16:00:24
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The current INST_MULT code essentially does: "if both multiplicands fit in x bytes, and there is a native 2x-wide integer, use that. Otherwise, bigint."
    
    I propose to add a new test after the current tests, but before going to bigint multiplication, that essentially does: "if sum-of-log_2 is below sizeof(intType), use intType mult"
    
    This will massively improve the speed on 64bit platforms where ints are 64 bits (*ILP, are there any), as they currently always multiply using bigints.
    
    On other platforms, it will improve the speed of multiplying a small number by a large one, eg, (5*(1<<51)). This is a much less critical case.
    
    The computation of the log_2 can be done relatively cheaply using table lookups; see eg http://www.cs.utk.edu/~vose/c-stuff/bithacks.html#IntegerLogLookup
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "msofer"
  10. subsystem changed to: "56. LibTomMath"
  11. title changed to: "avoid bigints for some multiplications"
  12. type changed to: "RFE"