Page MenuHomePhabricator

mgehre-amd (Matthias Gehre)
User

Projects

User does not belong to any projects.

User Details

User Since
Feb 22 2022, 7:13 AM (56 w, 2 d)

Recent Activity

Yesterday

mgehre-amd requested review of D146617: [mlir][tosa] TosaToLinalg: Lower TOSA.Cast via RoundEven according to TOSA spec 0.60.0.
Wed, Mar 22, 2:59 AM · Restricted Project, Restricted Project

Mon, Feb 27

mgehre-amd added a comment to D144871: [CodeGen] Always expand division larger than i128.

The change looks correct. Let's wait for somebody else to give their final approval.

Mon, Feb 27, 6:37 AM · Restricted Project, Restricted Project

Dec 2 2022

mgehre-amd accepted D139170: [X86][clang] Lift _BitInt() supported max width..
Dec 2 2022, 12:24 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D139170: [X86][clang] Lift _BitInt() supported max width..

Do other targets not support > 128 bit integers, or is this PR only the first conservative step of lifting the limit?

I temporary only enabled > 128 bit FP conversion for X86 in https://reviews.llvm.org/D137241, since I highly relied on end-to-end tests to implement that pass and I don't have other targets' environment to verify. So same to this patch, I only lift the limit for X86. Hope other targets will follow us to enable for themselves. WDYT?

Dec 2 2022, 12:23 AM · Restricted Project, Restricted Project

Dec 1 2022

mgehre-amd added a comment to D139170: [X86][clang] Lift _BitInt() supported max width..

Do other targets not support > 128 bit integers, or is this PR only the first conservative step of lifting the limit?

Dec 1 2022, 11:51 PM · Restricted Project, Restricted Project
mgehre-amd added a comment to D137241: [X86] Add ExpandLargeFpConvert Pass and enable for X86.

I think this was the last reason for restricting _BitInt to <= 128 by default in clang. Are you planning to create a PR to lift that restriction now?

Dec 1 2022, 1:21 AM · Restricted Project, Restricted Project

Nov 29 2022

mgehre-amd accepted D137241: [X86] Add ExpandLargeFpConvert Pass and enable for X86.

I'm scared about missing some subtle issue in the implementation, but I think the test cases on the other PR should cover that.

Nov 29 2022, 5:29 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D137241: [X86] Add ExpandLargeFpConvert Pass and enable for X86.
Nov 29 2022, 5:22 AM · Restricted Project, Restricted Project

Nov 23 2022

mgehre-amd updated the diff for D133118: Fix invalid llvm.dbg.declare after instcombine (#56807).

Rebase main to update alloca-bitcast.ll

Nov 23 2022, 6:30 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D133118: Fix invalid llvm.dbg.declare after instcombine (#56807).
Nov 23 2022, 1:16 AM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D133118: Fix invalid llvm.dbg.declare after instcombine (#56807).

Split tests and remove explicit metadata numbers

Nov 23 2022, 1:15 AM · Restricted Project, Restricted Project

Nov 22 2022

mgehre-amd added a comment to D137241: [X86] Add ExpandLargeFpConvert Pass and enable for X86.

Great that you worked on this!
I will have a deeper look at the end of this week.

Nov 22 2022, 12:06 AM · Restricted Project, Restricted Project

Nov 18 2022

mgehre-amd commandeered D133118: Fix invalid llvm.dbg.declare after instcombine (#56807).

Hey @jmorse, I talked to @nikolaos-amd offline and will take over this revision.

Nov 18 2022, 7:53 AM · Restricted Project, Restricted Project

Sep 12 2022

mgehre-amd added a comment to D133691: Move TargetTransformInfo::maxLegalDivRemBitWidth -> TargetLowering::maxSupportedDivRemBitWidth.

Seems tests are failing when x86 is not configured.
See clang-aarch64-quick.

Sep 12 2022, 11:48 PM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D133691: Move TargetTransformInfo::maxLegalDivRemBitWidth -> TargetLowering::maxSupportedDivRemBitWidth.

Use a field instead of virtual functions

Sep 12 2022, 8:43 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.
Sep 12 2022, 6:30 AM · Restricted Project, Restricted Project
mgehre-amd requested review of D133691: Move TargetTransformInfo::maxLegalDivRemBitWidth -> TargetLowering::maxSupportedDivRemBitWidth.
Sep 12 2022, 6:30 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.
Sep 12 2022, 1:27 AM · Restricted Project, Restricted Project

Sep 8 2022

mgehre-amd added a comment to D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.

LGTM. Thanks @mgehre-amd for your great work to implementing this feature!

Agreed, thank you for this work! Do you agree that we can now bump BITINT_MAXWIDTH in Clang above 128 now, or are we still missing support for that (floating-point conversions were also a problem IIRC)?

Thanks back to everyone who helped by reviewing!
Unfortunately, float-to-big-int and and big-int-to-float conversions still crash in the backend.
I want to take a look at this next.

Sep 8 2022, 2:50 PM · Restricted Project, Restricted Project

Sep 7 2022

mgehre-amd added inline comments to D132850: [SingleSource] Add Regression C tests for Large Divide..
Sep 7 2022, 3:07 AM · Restricted Project
mgehre-amd added a comment to D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.

Breaks https://lab.llvm.org/buildbot/#/builders/85/builds/10520

******************** TEST 'LLVM :: Transforms/ExpandLargeDivRem/udiv129.ll' FAILED ********************
Script:
--
: 'RUN: at line 2';   /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/opt -S -expand-large-div-rem < /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/test/Transforms/ExpandLargeDivRem/udiv129.ll | /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/FileCheck /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/test/Transforms/ExpandLargeDivRem/udiv129.ll
--
Exit Code: 1

Command Output (stderr):
--
/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/test/Transforms/ExpandLargeDivRem/udiv129.ll:6:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: _udiv-special-cases:
              ^
<stdin>:5:19: note: scanning from here
define void @test(i129* %ptr, i129* %out) #0 {
                  ^
<stdin>:7:9: note: possible intended match here
 %res = udiv i129 %a, 3
        ^

Input file: <stdin>
Check file: /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/test/Transforms/ExpandLargeDivRem/udiv129.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          1: ; ModuleID = '<stdin>' 
          2: source_filename = "<stdin>" 
          3:  
          4: ; Function Attrs: nounwind 
          5: define void @test(i129* %ptr, i129* %out) #0 { 
next:6'0                       X~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
          6:  %a = load i129, i129* %ptr, align 4 
next:6'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          7:  %res = udiv i129 %a, 3 
next:6'0     ~~~~~~~~~~~~~~~~~~~~~~~~
next:6'1             ?                possible intended match
          8:  store i129 %res, i129* %out, align 4 
next:6'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          9:  ret void 
next:6'0     ~~~~~~~~~~
         10: } 
next:6'0     ~~
         11:  
next:6'0     ~
         12: attributes #0 = { nounwind } 
next:6'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>
Sep 7 2022, 3:04 AM · Restricted Project, Restricted Project

Sep 6 2022

mgehre-amd added inline comments to D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.
Sep 6 2022, 8:08 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D132850: [SingleSource] Add Regression C tests for Large Divide..
Sep 6 2022, 3:30 AM · Restricted Project
mgehre-amd updated the diff for D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.
  • Simplified tests to only check for NOT: call
Sep 6 2022, 12:21 AM · Restricted Project, Restricted Project

Sep 2 2022

mgehre-amd added a comment to D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.

The tests are too prolix to check the correctness and it's fragile to use so many registers. I suggest we remove those tests and just do run-time time in llvm-test-suite.

Yes, you are right. I will restrict the IR tests to maybe just check for the absence of a call instructions? And at least to check that llc doesn't assert like it used to do.

Sep 2 2022, 1:49 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D133118: Fix invalid llvm.dbg.declare after instcombine (#56807).

Hey, thanks for the PR!
In the test cases, I think that both of the modified transformations (simplifyAllocaArraySize & PromoteCastOfAllocation) trigger (one after another).

Sep 2 2022, 1:46 AM · Restricted Project, Restricted Project

Aug 25 2022

mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Ping :)

Aug 25 2022, 11:15 PM · Restricted Project, Restricted Project
mgehre-amd added a comment to D130079: Revert "[SelectionDAG] Emit calls to __divei4 and friends for division/remainder of large integers".

I recommend to revert this patch after the new patch landed in llvm, so that it doesn't break existing functionality.

Aug 25 2022, 11:12 PM · Restricted Project, Restricted Project

Aug 18 2022

mgehre-amd updated the diff for D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Rename expandlargedivrem to expand-large-div-rem
Fix filenames in comments

Aug 18 2022, 1:41 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.

Is this to address @arsenm's comments at https://reviews.llvm.org/D126644#3581469?

Aug 18 2022, 1:41 AM · Restricted Project, Restricted Project

Aug 17 2022

mgehre-amd added a comment to D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.

Thanks @aaron.ballman for helping out with the reviewers!

Aug 17 2022, 6:26 AM · Restricted Project, Restricted Project

Aug 15 2022

mgehre-amd updated the diff for D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Rebased

Aug 15 2022, 5:37 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Friendly ping :-)
I think I addressed all comments. Is somebody able to approve this?

Aug 15 2022, 12:25 AM · Restricted Project, Restricted Project

Jul 29 2022

mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

We usually provide a runtime library for specialized functionalities like this. Are such division operations common enough to benefit from compiler generated code?

We explored and prototyped the approach of adding a functions to compiler-rt in a different PR. We discovered multiple issues.

Jul 29 2022, 1:20 AM · Restricted Project, Restricted Project

Jul 28 2022

mgehre-amd updated the diff for D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.

Set limit to 64 bit for ARM and x86_32

Jul 28 2022, 3:34 PM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Clarify that x86_32 cannot lower division with more than 64 bits.

Jul 28 2022, 3:09 PM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.
Jul 28 2022, 3:02 PM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.
Jul 28 2022, 5:35 AM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Fix description of expand-div-rem-bits argument
Use ConstantInt::get

Jul 28 2022, 5:35 AM · Restricted Project, Restricted Project

Jul 19 2022

mgehre-amd requested review of D130079: Revert "[SelectionDAG] Emit calls to __divei4 and friends for division/remainder of large integers".
Jul 19 2022, 5:04 AM · Restricted Project, Restricted Project
mgehre-amd abandoned D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

Abandoned in favor of https://reviews.llvm.org/D130076

Jul 19 2022, 4:38 AM · Restricted Project, Restricted Project
mgehre-amd abandoned D123363: [SelectionDAG] Update emission of udivmodei5 to latest ABI changes.

I'm abandoning this approach in favor of https://reviews.llvm.org/D130076

Jul 19 2022, 4:38 AM · Restricted Project, Restricted Project
mgehre-amd updated the summary of D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.
Jul 19 2022, 4:36 AM · Restricted Project, Restricted Project
mgehre-amd abandoned D122234: [clang] Link libbitint for large division of _BitInt.

Instead of linking to libbitint, I instead created a backend pass to transform div/rem instructions: https://reviews.llvm.org/D130076

Jul 19 2022, 4:36 AM · Restricted Project, Restricted Project
mgehre-amd requested review of D130076: [llvm/CodeGen] Enable the ExpandLargeDivRem pass for X86, Arm and AArch64.
Jul 19 2022, 4:34 AM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Remove pass from pass pipeline (will be added in next PR)

Jul 19 2022, 3:04 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.
Jul 19 2022, 2:57 AM · Restricted Project, Restricted Project

Jul 15 2022

mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Thanks for the review! I updated the PR to reflect your comments.

Jul 15 2022, 1:39 AM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Implement review comments

Jul 15 2022, 1:39 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

I'm a bit confused, where in the code does this actually create functions? It doesn't look like expandDivision() does that, and I can't spot anything else creating __llvm_udivXXX either.

Jul 15 2022, 12:55 AM · Restricted Project, Restricted Project
mgehre-amd updated the summary of D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.
Jul 15 2022, 12:54 AM · Restricted Project, Restricted Project

Jul 12 2022

mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Ping, how can I get review/approval for this PR? Should I add somebody else as reviewer?

Jul 12 2022, 1:36 AM · Restricted Project, Restricted Project

Jul 6 2022

mgehre-amd closed D127287: clang: Introduce -fexperimental-max-bitint-width.

Merged

Jul 6 2022, 3:09 PM · Restricted Project, Restricted Project
mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

With the work around constant expressions (e.g. https://reviews.llvm.org/rG941c8e0ea50b), I might not need to handle div/mod constants anymore. For that reason, I would at least land this PR without support for transforming constant expressions.

Jul 6 2022, 3:07 PM · Restricted Project, Restricted Project

Jun 17 2022

mgehre-amd added inline comments to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.
Jun 17 2022, 3:45 AM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Use IntegerDivison.cpp
Do not emit separate functions
Turn into FunctionPass

Jun 17 2022, 3:45 AM · Restricted Project, Restricted Project

Jun 15 2022

mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Another problem is this will miss divisions embedded in constant expressions

Jun 15 2022, 12:44 AM · Restricted Project, Restricted Project

Jun 14 2022

mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

Actually, how is this really different from lib/Transforms/Utils/IntegerDivision.cpp? This just goes to 128 but the existing code goes up to 64. Can you merge them, or at least move the implementation bodies to the same place?

Jun 14 2022, 8:39 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.

My primary concern here is that we're unconditionally iterating over every instruction in the module, even if the pass has nothing to do. In the grand scheme of things, it isn't *that* expensive, but it's still not cheap, and we seem to have grown a number of passes doing similar walks. Can we merge this with some other walk over the module?

Jun 14 2022, 1:55 AM · Restricted Project, Restricted Project

Jun 8 2022

mgehre-amd updated the summary of D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.
Jun 8 2022, 8:15 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D127287: clang: Introduce -fexperimental-max-bitint-width.

Thanks for the quick review!

Jun 8 2022, 7:54 AM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D127287: clang: Introduce -fexperimental-max-bitint-width.

Used Optional
Added entry to release notes
Modifed help text according to suggestion
Added comment to LANGOPT that it will be removed in the future

Jun 8 2022, 7:53 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D122234: [clang] Link libbitint for large division of _BitInt.

I split the introduction of -fexperimental-max-bitint-width into https://reviews.llvm.org/D127287 because there is still discussion about the bitint libraries in the backend PRs.

Jun 8 2022, 3:55 AM · Restricted Project, Restricted Project
mgehre-amd requested review of D127287: clang: Introduce -fexperimental-max-bitint-width.
Jun 8 2022, 3:53 AM · Restricted Project, Restricted Project

May 30 2022

mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

I have tried to circumvent various issues around changing compiler-rt by synthesizing the division function directly in LLVM: https://reviews.llvm.org/D126644

May 30 2022, 5:46 AM · Restricted Project, Restricted Project
mgehre-amd requested review of D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass.
May 30 2022, 5:45 AM · Restricted Project, Restricted Project

May 9 2022

mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

There is some push back on the gcc mailing list both on requiring an extra word to enable Knuth [0]
and generally defining the libgcc function before _BitInt is implemented in gcc [1].
There are also concerns about whether this would be consistent with the ABI,
which is isn't finalized on all targets yet.

May 9 2022, 7:20 AM · Restricted Project, Restricted Project

May 5 2022

mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

Instead of putting the __divmodei5/__udivmodei5 routines in compiler-rt, can we just make the backend embed them into the object file?

May 5 2022, 12:46 AM · Restricted Project, Restricted Project

May 3 2022

mgehre-amd added inline comments to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.
May 3 2022, 11:43 PM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

unsigned int -> unsigned
Fix memory leaks in unit tests

May 3 2022, 12:04 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.
May 3 2022, 12:02 AM · Restricted Project, Restricted Project

Apr 10 2022

mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

Note for self: Also broke armv8 here: https://lab.llvm.org/buildbot/#/builders/178/builds/1902

Apr 10 2022, 10:26 PM · Restricted Project, Restricted Project

Apr 8 2022

mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

@mgehre-amd Please can you take a look at the buildbots breaks: https://lab.llvm.org/buildbot/#/builders/93/builds/8214

Apr 8 2022, 2:51 AM · Restricted Project, Restricted Project

Apr 7 2022

mgehre-amd requested review of D123363: [SelectionDAG] Update emission of udivmodei5 to latest ABI changes.
Apr 7 2022, 11:52 PM · Restricted Project, Restricted Project
mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

LGTM. Will you update the backend libcall?

Apr 7 2022, 11:04 PM · Restricted Project, Restricted Project
mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

@howard.hinnant, as Code Owner, do you know a good person to review/approve this? @programmerjake would like a second opinion.

Apr 7 2022, 7:29 AM · Restricted Project, Restricted Project

Mar 29 2022

mgehre-amd updated the diff for D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

Require 'a' to be a large integer with n + 1 words; update tests accordingly

Mar 29 2022, 7:55 AM · Restricted Project, Restricted Project
mgehre-amd retitled D122234: [clang] Link libbitint for large division of _BitInt from [clang] Link libbitint for large division of _BitInt; increase max _BitInt size to [clang] Link libbitint for large division of _BitInt.
Mar 29 2022, 6:45 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D122234: [clang] Link libbitint for large division of _BitInt.
Mar 29 2022, 6:44 AM · Restricted Project, Restricted Project
mgehre-amd updated the summary of D122234: [clang] Link libbitint for large division of _BitInt.
Mar 29 2022, 6:44 AM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D122234: [clang] Link libbitint for large division of _BitInt.
  • Remove diagnostics for float-to-bitint
  • Remove lexer changes (will be another PR)
  • Add -fexperimental-max-bitint-width=N
Mar 29 2022, 6:43 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.
Mar 29 2022, 1:57 AM · Restricted Project, Restricted Project

Mar 28 2022

mgehre-amd updated the summary of D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.
Mar 28 2022, 11:45 AM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

Implement a basic long division
Make it work on big endian machines
Only provide

void __divmodei5(su_int *quo, su_int *rem, su_int *a, su_int *b,
                               unsigned int words)

and

void __udivmodei5(su_int *quo, su_int *rem, const su_int *a,
                                const su_int *b, unsigned int words)
Mar 28 2022, 11:43 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D122234: [clang] Link libbitint for large division of _BitInt.
Mar 28 2022, 1:52 AM · Restricted Project, Restricted Project

Mar 22 2022

mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

In that case I will go for a subtract-shift implementation because Knuth seem to require multiple temporary buffers, and it would be odd to expose all of them through the API.
It also means that I likely need to modify the LLVM backend to emit calls to divmodei5 and not divei4 or __modei4.

Mar 22 2022, 9:58 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D122234: [clang] Link libbitint for large division of _BitInt.
Mar 22 2022, 9:53 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D122234: [clang] Link libbitint for large division of _BitInt.
Mar 22 2022, 9:28 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

I opened the review for the clang changes (including linking bitint by default) here: https://reviews.llvm.org/D122234

Mar 22 2022, 8:26 AM · Restricted Project, Restricted Project
mgehre-amd requested review of D122234: [clang] Link libbitint for large division of _BitInt.
Mar 22 2022, 8:24 AM · Restricted Project, Restricted Project
mgehre-amd accepted D122227: Fix _BitInt suffix width calculation.

Thanks a lot!

Mar 22 2022, 6:54 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to rG8cba72177dcd: Implement literal suffixes for _BitInt.
Mar 22 2022, 6:04 AM · Restricted Project

Mar 21 2022

mgehre-amd added a comment to D120327: compiler-rt: Add udivmodei5 to builtins and add bitint library.

Hey, yes it's still near the top of my TODO list. Had a few other things to do, but I'm planning to come back to this.

Mar 21 2022, 8:32 AM · Restricted Project, Restricted Project
mgehre-amd accepted D122075: [clang-tidy] Skip parentheses in `readability-make-member-function-const`.
Mar 21 2022, 1:20 AM · Restricted Project, Restricted Project
mgehre-amd added a comment to D122075: [clang-tidy] Skip parentheses in `readability-make-member-function-const`.

LGTM

Mar 21 2022, 1:19 AM · Restricted Project, Restricted Project

Mar 14 2022

mgehre-amd added a comment to D120329: [SelectionDAG] Emit calls to __divei4 and friends for division/remainder of large integers.

@LuoYuanke, thank you very much for the review and comments!

Mar 14 2022, 6:01 AM · Restricted Project, Restricted Project

Mar 11 2022

mgehre-amd added inline comments to D120329: [SelectionDAG] Emit calls to __divei4 and friends for division/remainder of large integers.
Mar 11 2022, 7:49 AM · Restricted Project, Restricted Project
mgehre-amd added inline comments to D120329: [SelectionDAG] Emit calls to __divei4 and friends for division/remainder of large integers.
Mar 11 2022, 7:39 AM · Restricted Project, Restricted Project
mgehre-amd updated the diff for D120329: [SelectionDAG] Emit calls to __divei4 and friends for division/remainder of large integers.

Rename to ExpandExtIntRes_DIVREM
Add nounwind

Mar 11 2022, 7:39 AM · Restricted Project, Restricted Project

Mar 7 2022

mgehre-amd updated the diff for D120329: [SelectionDAG] Emit calls to __divei4 and friends for division/remainder of large integers.

Add a test case for aarch64 (showing big endian)

Mar 7 2022, 7:08 AM · Restricted Project, Restricted Project