aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/NVPTX
diff options
context:
space:
mode:
authorJustin Holewinski <jholewinski@nvidia.com>2013-07-01 12:58:58 +0000
committerJustin Holewinski <jholewinski@nvidia.com>2013-07-01 12:58:58 +0000
commit03e5bb2c87c05ca42f9940e14f22275b136a9883 (patch)
tree654354664e6a60c3077ee514a2880f3bffa16069 /test/CodeGen/NVPTX
parent8834184a463514530728a8032df165558393cd9c (diff)
downloadexternal_llvm-03e5bb2c87c05ca42f9940e14f22275b136a9883.zip
external_llvm-03e5bb2c87c05ca42f9940e14f22275b136a9883.tar.gz
external_llvm-03e5bb2c87c05ca42f9940e14f22275b136a9883.tar.bz2
[NVPTX] Handle signext/zeroext attributes properly
Fix a case where we were incorrectly sign-extending a value when we should have been zero-extending the value. Also change some SIGN_EXTEND to ANY_EXTEND because we really dont care and may have more opportunity to fold subexpressions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/NVPTX')
-rw-r--r--test/CodeGen/NVPTX/sext-params.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/NVPTX/sext-params.ll b/test/CodeGen/NVPTX/sext-params.ll
new file mode 100644
index 0000000..a559630
--- /dev/null
+++ b/test/CodeGen/NVPTX/sext-params.ll
@@ -0,0 +1,16 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
+
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
+
+
+define i8 @foo(i8 signext %a) {
+; CHECK: ld.param.s8
+ %ret = add i8 %a, 3
+ ret i8 %ret
+}
+
+define i8 @bar(i8 zeroext %a) {
+; CHECK: ld.param.u8
+ %ret = add i8 %a, 3
+ ret i8 %ret
+}