Permalink
Browse files

DCPU16: Fixed the returnSize function and the datalayout in the test

Signed-off-by: Nils Hasenbanck <nils@hasenbanck.de>
  • Loading branch information...
1 parent c096002 commit d1e9a2a95f7b3738b28f5d909905ee355b366408 @hasenbanck hasenbanck committed Apr 17, 2012
@@ -231,11 +231,10 @@ class TargetData : public ImmutablePass {
/// overwritten by storing the specified type. For example, returns 5
/// for i36 and 10 for x86_fp80.
uint64_t getTypeStoreSize(Type *Ty) const {
- if (WordAddressing==true) {
- return (getTypeSizeInBits(Ty)+7)/16;
- } else {
+ if (WordAddressing)
+ return (getTypeSizeInBits(Ty)+15)/16;
+ else
return (getTypeSizeInBits(Ty)+7)/8;
- }
}
/// getTypeStoreSizeInBits - Return the maximum number of bits that may be
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=dcpu16 | not grep {UNREACHABLE|ERROR}
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @hailstone() nounwind {
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=dcpu16 | FileCheck %s
; RUN: llc < %s -O0 -march=dcpu16 | FileCheck %s -check-prefix=CHECK-O0
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @f(i16 %x) nounwind {
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @first(i16* %a) nounwind {
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=dcpu16 | FileCheck %s
; RUN: llc < %s -O0 -march=dcpu16 | FileCheck %s -check-prefix=CHECK-O0
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @bic(i16 %a, i16 %b) nounwind readnone {
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @swpb(i16 %x) nounwind readnone {
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @shift_ri(i16 %a) nounwind readnone {
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-i64:64:64-n8:16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define void @mul_by_17(i16* nocapture %as, i16 %size_a) nounwind {
@@ -1,6 +1,6 @@
; XFAIL: *
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @am1(i16 %x, i16* %a) nounwind {
@@ -1,6 +1,6 @@
; XFAIL: *
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define void @am1(i16* %a, i16 %x) nounwind {
@@ -1,6 +1,6 @@
; XFAIL: *
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @am1(i16* %a) nounwind {
@@ -1,6 +1,6 @@
; XFAIL: *
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define void @am1(i16* %a, i16 %b) nounwind {
@@ -1,6 +1,6 @@
; RUN: llc -march=dcpu16 < %s | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
@foo = common global i16 0, align 2
@@ -1,5 +1,5 @@
; RUN: llc -march=dcpu16 -combiner-alias-analysis < %s | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
@foo = common global i16 0, align 2
@bar = common global i16 0, align 2
@@ -1,5 +1,5 @@
; RUN: llc -march=dcpu16 < %s | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
@foo = common global i16 0, align 2
@@ -1,5 +1,5 @@
; RUN: llc -march=dcpu16 < %s | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @mov() nounwind {
@@ -1,5 +1,5 @@
; RUN: llc -march=dcpu16 < %s | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
@foo = common global i16 0, align 2
@@ -1,5 +1,5 @@
; RUN: llc -march=dcpu16 < %s | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @mov(i16 %a, i16 %b) nounwind {
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @sum2(i16 %a, i16 %b) nounwind {
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=dcpu16 | FileCheck %s
-target datalayout = "e-p:16:16:16-i8:16:16-i16:16:16-i32:16:32-s0:16:16-n16"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @f1(i16 %x, i16 %y) nounwind {
@@ -0,0 +1,17 @@
+; RUN: llc < %s -march=dcpu16 | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
+target triple = "dcpu16"
+
+define void @simpleInc() nounwind {
+entry:
+ %ptr = alloca i16*, align 1
+ store i16* inttoptr (i16 -32768 to i16*), i16** %ptr, align 1
+ %0 = load i16** %ptr, align 1
+ %add.ptr = getelementptr inbounds i16* %0, i16 1
+ store i16* %add.ptr, i16** %ptr, align 1
+ ret void
+}
+
+; CHECK: :simpleInc
+; CHECK: SET [I], 0x8000
+; CHECK: SET [I], 0x8001
@@ -1,5 +1,5 @@
; RUN: llc -march=dcpu16 < %s | FileCheck %s
-target datalayout = "e-p:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:16:32"
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-s0:8:8-n16"
target triple = "dcpu16"
define i16 @sccweqand(i16 %a, i16 %b) nounwind {

0 comments on commit d1e9a2a

Please sign in to comment.