1 ; RUN: llc -mtriple=m68k -global-isel -stop-after=legalizer < %s | FileCheck %s
3 define i32 @test_add(i32 %x, i32 %y) {
4 ; CHECK-LABEL: name: test_add
5 ; CHECK: bb.1 (%ir-block.0):
6 ; CHECK: [[G_F_I1:%[0-9]+]]:_(p0) = G_FRAME_INDEX
7 ; CHECK: [[G_LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[G_F_I1]](p0)
8 ; CHECK: [[G_F_I2:%[0-9]+]]:_(p0) = G_FRAME_INDEX
9 ; CHECK: [[G_LOAD2:%[0-9]+]]:_(s32) = G_LOAD [[G_F_I2]](p0)
10 ; CHECK: [[G_ADD1:%[0-9]+]]:_(s32) = G_ADD [[G_LOAD1]], [[G_LOAD2]]
11 ; CHECK: $d0 = COPY [[G_ADD1]](s32)
12 ; CHECK: RTS implicit $d0
17 define i32 @test_sub(i32 %x, i32 %y) {
18 ; CHECK-LABEL: name: test_sub
19 ; CHECK: bb.1 (%ir-block.0):
20 ; CHECK: [[G_F_I1:%[0-9]+]]:_(p0) = G_FRAME_INDEX
21 ; CHECK: [[G_LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[G_F_I1]](p0)
22 ; CHECK: [[G_F_I2:%[0-9]+]]:_(p0) = G_FRAME_INDEX
23 ; CHECK: [[G_LOAD2:%[0-9]+]]:_(s32) = G_LOAD [[G_F_I2]](p0)
24 ; CHECK: [[G_SUB1:%[0-9]+]]:_(s32) = G_SUB [[G_LOAD1]], [[G_LOAD2]]
25 ; CHECK: $d0 = COPY [[G_SUB1]](s32)
26 ; CHECK: RTS implicit $d0
27 %diff = sub i32 %x, %y
31 define i32 @test_mul(i32 %x, i32 %y) {
32 ; CHECK-LABEL: name: test_mul
33 ; CHECK: bb.1 (%ir-block.0):
34 ; CHECK: [[G_F_I1:%[0-9]+]]:_(p0) = G_FRAME_INDEX
35 ; CHECK: [[G_LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[G_F_I1]](p0)
36 ; CHECK: [[G_F_I2:%[0-9]+]]:_(p0) = G_FRAME_INDEX
37 ; CHECK: [[G_LOAD2:%[0-9]+]]:_(s32) = G_LOAD [[G_F_I2]](p0)
38 ; CHECK: [[G_MUL1:%[0-9]+]]:_(s32) = G_MUL [[G_LOAD1]], [[G_LOAD2]]
39 ; CHECK: $d0 = COPY [[G_MUL1]](s32)
40 ; CHECK: RTS implicit $d0
41 %prod = mul i32 %x, %y
45 define i32 @test_udiv(i32 %x, i32 %y) {
46 ; CHECK-LABEL: name: test_udiv
47 ; CHECK: bb.1 (%ir-block.0):
48 ; CHECK: [[G_F_I1:%[0-9]+]]:_(p0) = G_FRAME_INDEX
49 ; CHECK: [[G_LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[G_F_I1]](p0)
50 ; CHECK: [[G_F_I2:%[0-9]+]]:_(p0) = G_FRAME_INDEX
51 ; CHECK: [[G_LOAD2:%[0-9]+]]:_(s32) = G_LOAD [[G_F_I2]](p0)
52 ; CHECK: [[G_DIV1:%[0-9]+]]:_(s32) = G_UDIV [[G_LOAD1]], [[G_LOAD2]]
53 ; CHECK: $d0 = COPY [[G_DIV1]](s32)
54 ; CHECK: RTS implicit $d0
55 %div = udiv i32 %x, %y