Commit f629442b authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski

Fix a major copy'n'paste error in LLVM CodeGen

Summary:
In D4592, `AddWordC` is lowered as an unsigned subtraction instead
of an unsigned addition when compiling with LLVM.

This patch rectifies that.

Reviewers: angerman, bgamari, monoidal

Reviewed By: angerman, bgamari, monoidal

Subscribers: osa1, rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4969
parent 4ea9311c
......@@ -804,7 +804,7 @@ cmmPrimOpFunctions mop = do
++ showSDoc dflags (ppr $ widthToLlvmInt w)
MO_Add2 w -> fsLit $ "llvm.uadd.with.overflow."
++ showSDoc dflags (ppr $ widthToLlvmInt w)
MO_AddWordC w -> fsLit $ "llvm.usub.with.overflow."
MO_AddWordC w -> fsLit $ "llvm.uadd.with.overflow."
++ showSDoc dflags (ppr $ widthToLlvmInt w)
MO_SubWordC w -> fsLit $ "llvm.usub.with.overflow."
++ showSDoc dflags (ppr $ widthToLlvmInt w)
......
......@@ -62,7 +62,7 @@ test('CarryOverflow', omit_ways(['ghci']), compile_and_run, [''])
test('T9407', normal, compile_and_run, [''])
test('T9810', normal, compile_and_run, [''])
test('T10011', normal, compile_and_run, [''])
test('T10962', omit_ways(['ghci']), compile_and_run, ['-O2'])
test('T10962', [omit_ways(['ghci']), extra_ways(['llvm'])], compile_and_run, ['-O2'])
test('T11702', extra_ways(['optasm']), compile_and_run, [''])
test('T12136', normal, compile_and_run, [''])
test('T15301', normal, compile_and_run, ['-O2'])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment