2016-07-23 04:03:43 +08:00
|
|
|
# RUN: llc -O0 -run-pass=legalize-mir -global-isel %s -o - 2>&1 | FileCheck %s
|
|
|
|
|
|
|
|
--- |
|
|
|
|
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
|
|
|
|
target triple = "aarch64-apple-ios"
|
2016-08-05 04:54:13 +08:00
|
|
|
define void @test_scalar_add_big() {
|
|
|
|
entry:
|
|
|
|
ret void
|
|
|
|
}
|
2016-08-05 02:35:11 +08:00
|
|
|
define void @test_scalar_add_small() {
|
|
|
|
entry:
|
|
|
|
ret void
|
|
|
|
}
|
2016-07-23 04:03:43 +08:00
|
|
|
define void @test_vector_add() {
|
|
|
|
entry:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
...
|
|
|
|
|
2016-08-05 04:54:13 +08:00
|
|
|
---
|
|
|
|
name: test_scalar_add_big
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
- { id: 2, class: _ }
|
2016-08-31 02:52:46 +08:00
|
|
|
- { id: 3, class: _ }
|
|
|
|
- { id: 4, class: _ }
|
|
|
|
- { id: 5, class: _ }
|
|
|
|
- { id: 6, class: _ }
|
|
|
|
- { id: 7, class: _ }
|
|
|
|
- { id: 8, class: _ }
|
2016-08-05 04:54:13 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
liveins: %x0, %x1, %x2, %x3
|
|
|
|
; CHECK-LABEL: name: test_scalar_add_big
|
2016-08-31 04:51:25 +08:00
|
|
|
; CHECK-NOT: G_EXTRACT
|
|
|
|
; CHECK-NOT: G_SEQUENCE
|
2016-08-26 01:37:32 +08:00
|
|
|
; CHECK-DAG: [[CARRY0_32:%.*]](32) = G_CONSTANT s32 0
|
|
|
|
; CHECK-DAG: [[CARRY0:%[0-9]+]](1) = G_TRUNC { s1, s32 } [[CARRY0_32]]
|
2016-08-31 04:51:25 +08:00
|
|
|
; CHECK: [[RES_LO:%.*]](64), [[CARRY:%.*]](1) = G_UADDE s64 %0, %2, [[CARRY0]]
|
|
|
|
; CHECK: [[RES_HI:%.*]](64), {{%.*}}(1) = G_UADDE s64 %1, %3, [[CARRY]]
|
|
|
|
; CHECK-NOT: G_EXTRACT
|
|
|
|
; CHECK-NOT: G_SEQUENCE
|
|
|
|
; CHECK: %x0 = COPY [[RES_LO]]
|
|
|
|
; CHECK: %x1 = COPY [[RES_HI]]
|
2016-08-05 04:54:13 +08:00
|
|
|
|
2016-09-01 05:24:02 +08:00
|
|
|
%0(64) = G_TYPE s64 %x0
|
|
|
|
%1(64) = G_TYPE s64 %x1
|
|
|
|
%2(64) = G_TYPE s64 %x2
|
|
|
|
%3(64) = G_TYPE s64 %x3
|
2016-08-31 02:52:46 +08:00
|
|
|
%4(128) = G_SEQUENCE { s128, s64, s64 } %0, 0, %1, 64
|
|
|
|
%5(128) = G_SEQUENCE { s128, s64, s64 } %2, 0, %3, 64
|
|
|
|
%6(128) = G_ADD s128 %4, %5
|
|
|
|
%7(64), %8(64) = G_EXTRACT { s64, s64, s128 } %6, 0, 64
|
|
|
|
%x0 = COPY %7
|
|
|
|
%x1 = COPY %8
|
2016-08-05 04:54:13 +08:00
|
|
|
...
|
|
|
|
|
2016-08-05 02:35:11 +08:00
|
|
|
---
|
|
|
|
name: test_scalar_add_small
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
- { id: 2, class: _ }
|
2016-08-31 02:52:46 +08:00
|
|
|
- { id: 3, class: _ }
|
|
|
|
- { id: 4, class: _ }
|
|
|
|
- { id: 5, class: _ }
|
2016-08-05 02:35:11 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
liveins: %x0, %x1, %x2, %x3
|
|
|
|
; CHECK-LABEL: name: test_scalar_add_small
|
2016-08-31 02:52:46 +08:00
|
|
|
; CHECK: [[RES:%.*]](8) = G_ADD s8 %2, %3
|
2016-08-05 02:35:11 +08:00
|
|
|
|
2016-09-01 05:24:02 +08:00
|
|
|
%0(64) = G_TYPE s64 %x0
|
|
|
|
%1(64) = G_TYPE s64 %x1
|
2016-08-31 02:52:46 +08:00
|
|
|
%2(8) = G_TRUNC { s8, s64 } %0
|
|
|
|
%3(8) = G_TRUNC { s8, s64 } %1
|
|
|
|
%4(8) = G_ADD s8 %2, %3
|
|
|
|
%5(64) = G_ANYEXT { s64, s8 } %4
|
|
|
|
%x0 = COPY %5
|
2016-08-05 02:35:11 +08:00
|
|
|
...
|
|
|
|
|
2016-07-23 04:03:43 +08:00
|
|
|
---
|
|
|
|
name: test_vector_add
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
- { id: 2, class: _ }
|
2016-08-31 02:52:46 +08:00
|
|
|
- { id: 3, class: _ }
|
|
|
|
- { id: 4, class: _ }
|
|
|
|
- { id: 5, class: _ }
|
|
|
|
- { id: 6, class: _ }
|
|
|
|
- { id: 7, class: _ }
|
|
|
|
- { id: 8, class: _ }
|
2016-07-23 04:03:43 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
liveins: %q0, %q1, %q2, %q3
|
|
|
|
; CHECK-LABEL: name: test_vector_add
|
2016-08-31 04:51:25 +08:00
|
|
|
; CHECK-NOT: G_EXTRACT
|
|
|
|
; CHECK-NOT: G_SEQUENCE
|
|
|
|
; CHECK: [[RES_LO:%.*]](128) = G_ADD <2 x s64> %0, %2
|
|
|
|
; CHECK: [[RES_HI:%.*]](128) = G_ADD <2 x s64> %1, %3
|
|
|
|
; CHECK-NOT: G_EXTRACT
|
|
|
|
; CHECK-NOT: G_SEQUENCE
|
|
|
|
; CHECK: %q0 = COPY [[RES_LO]]
|
|
|
|
; CHECK: %q1 = COPY [[RES_HI]]
|
2016-07-23 04:03:43 +08:00
|
|
|
|
2016-09-01 05:24:02 +08:00
|
|
|
%0(128) = G_TYPE s128 %q0
|
|
|
|
%1(128) = G_TYPE s128 %q1
|
|
|
|
%2(128) = G_TYPE s128 %q2
|
|
|
|
%3(128) = G_TYPE s128 %q3
|
2016-08-31 02:52:46 +08:00
|
|
|
%4(256) = G_SEQUENCE { s256, s128, s128 } %0, 0, %1, 128
|
|
|
|
%5(256) = G_SEQUENCE { s256, s128, s128 } %2, 0, %3, 128
|
|
|
|
%6(256) = G_ADD <4 x s64> %4, %5
|
|
|
|
%7(128), %8(128) = G_EXTRACT { s128, s128, s256 } %6, 0, 128
|
|
|
|
%q0 = COPY %7
|
|
|
|
%q1 = COPY %8
|
2016-07-23 04:03:43 +08:00
|
|
|
...
|