Răsfoiți Sursa

[NVPTX] Add lowering of i128 params.

The patch adds support of i128 params lowering. The changes are quite trivial to
support i128 as a "special case" of integer type. With this patch, we lower i128
params the same way as aggregates of size 16 bytes: .param .b8 _ [16].

Currently, NVPTX can't deal with the 128 bit integers:
* in some cases because of failed assertions like
  ValVTs.size() == OutVals.size() && "Bad return value decomposition"
* in other cases emitting PTX with .i128 or .u128 types (which are not valid [1])
  [1] http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#fundamental-types

Differential Revision: https://reviews.llvm.org/D34555
Patch by: Denys Zariaiev (denys.zariaiev@gmail.com)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308675 91177308-0d34-0410-b5e6-96231b3b80d8
Artem Belevich 8 ani în urmă
părinte
comite
09833a858c
2 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 2 2
      lib/Basic/Targets.cpp
  2. 2 2
      test/CodeGen/target-data.c

+ 2 - 2
lib/Basic/Targets.cpp

@@ -1833,9 +1833,9 @@ public:
     GPU = CudaArch::SM_20;
 
     if (TargetPointerWidth == 32)
-      resetDataLayout("e-p:32:32-i64:64-v16:16-v32:32-n16:32:64");
+      resetDataLayout("e-p:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64");
     else
-      resetDataLayout("e-i64:64-v16:16-v32:32-n16:32:64");
+      resetDataLayout("e-i64:64-i128:128-v16:16-v32:32-n16:32:64");
 
     // If possible, get a TargetInfo for our host triple, so we can match its
     // types.

+ 2 - 2
test/CodeGen/target-data.c

@@ -116,11 +116,11 @@
 
 // RUN: %clang_cc1 -triple nvptx-unknown -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=NVPTX
-// NVPTX: target datalayout = "e-p:32:32-i64:64-v16:16-v32:32-n16:32:64"
+// NVPTX: target datalayout = "e-p:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64"
 
 // RUN: %clang_cc1 -triple nvptx64-unknown -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=NVPTX64
-// NVPTX64: target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
+// NVPTX64: target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
 
 // RUN: %clang_cc1 -triple r600-unknown -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=R600