diff options
author | Justin Holewinski <jholewinski@nvidia.com> | 2014-07-23 18:46:03 +0000 |
---|---|---|
committer | Justin Holewinski <jholewinski@nvidia.com> | 2014-07-23 18:46:03 +0000 |
commit | 03f160f9d3adfcdc0446c514eee67ad7f79b3c8c (patch) | |
tree | 9aab841eaf7191791932d3e7683e6393a22b4122 /test/CodeGen/NVPTX/mulwide.ll | |
parent | 8b832c1c3951f095cd7581af8313fb0e7d58a21c (diff) |
[NVPTX] mul.wide generation works for any smaller integer source types, not just the next smaller power of two
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/NVPTX/mulwide.ll')
-rw-r--r-- | test/CodeGen/NVPTX/mulwide.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/NVPTX/mulwide.ll b/test/CodeGen/NVPTX/mulwide.ll index 43bb63098f6..8cfb5c2a7df 100644 --- a/test/CodeGen/NVPTX/mulwide.ll +++ b/test/CodeGen/NVPTX/mulwide.ll @@ -23,6 +23,28 @@ define i32 @mulwideu16(i16 %a, i16 %b) { ret i32 %val2 } +; OPT-LABEL: @mulwide8 +; NOOPT-LABEL: @mulwide8 +define i32 @mulwide8(i8 %a, i8 %b) { +; OPT: mul.wide.s16 +; NOOPT: mul.lo.s32 + %val0 = sext i8 %a to i32 + %val1 = sext i8 %b to i32 + %val2 = mul i32 %val0, %val1 + ret i32 %val2 +} + +; OPT-LABEL: @mulwideu8 +; NOOPT-LABEL: @mulwideu8 +define i32 @mulwideu8(i8 %a, i8 %b) { +; OPT: mul.wide.u16 +; NOOPT: mul.lo.s32 + %val0 = zext i8 %a to i32 + %val1 = zext i8 %b to i32 + %val2 = mul i32 %val0, %val1 + ret i32 %val2 +} + ; OPT-LABEL: @mulwide32 ; NOOPT-LABEL: @mulwide32 define i64 @mulwide32(i32 %a, i32 %b) { |