[PATCH] D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library
    Jacob Lifshay via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Mar 28 13:59:55 PDT 2022
    
    
  
programmerjake requested changes to this revision.
programmerjake added inline comments.
This revision now requires changes to proceed.
================
Comment at: compiler-rt/lib/builtins/int_lib.h:119
+COMPILER_RT_ABI void __udivmodei5(su_int *quo, su_int *rem, const su_int *a,
+                                  const su_int *b, unsigned int words);
+
----------------
this should be changed to pass in a buffer big enough for knuth division...
that is `words * 2 + 1` (the buffer can just be `a` but zero-extended). also `b` needs to be non-const since knuth division needs to modify it.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120327/new/
https://reviews.llvm.org/D120327
    
    
More information about the llvm-commits
mailing list