1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=m68k-linux -verify-machineinstrs | FileCheck %s
4 define i64 @test1(i64 %A, i32 %B) nounwind {
7 ; CHECK-NEXT: move.l (12,%sp), %d0
8 ; CHECK-NEXT: add.l (4,%sp), %d0
9 ; CHECK-NEXT: move.l (8,%sp), %d1
11 %tmp12 = zext i32 %B to i64
12 %tmp3 = shl i64 %tmp12, 32
13 %tmp5 = add i64 %tmp3, %A
17 define void @test2(i32* inreg %a) nounwind {
20 ; CHECK-NEXT: move.l %d0, %a0
21 ; CHECK-NEXT: add.l #128, (%a0)
23 %aa = load i32, i32* %a
29 define fastcc void @test2_fast(i32* inreg %a) nounwind {
30 ; CHECK-LABEL: test2_fast:
32 ; CHECK-NEXT: add.l #128, (%a0)
34 %aa = load i32, i32* %a
40 define fastcc void @test3(i64* inreg %a) nounwind {
43 ; CHECK-NEXT: suba.l #4, %sp
44 ; CHECK-NEXT: movem.l %d2, (0,%sp) ; 8-byte Folded Spill
45 ; CHECK-NEXT: move.l (%a0), %d0
46 ; CHECK-NEXT: move.l #0, %d1
47 ; CHECK-NEXT: move.l #-2147483648, %d2
48 ; CHECK-NEXT: add.l (4,%a0), %d2
49 ; CHECK-NEXT: addx.l %d0, %d1
50 ; CHECK-NEXT: move.l %d2, (4,%a0)
51 ; CHECK-NEXT: move.l %d1, (%a0)
52 ; CHECK-NEXT: movem.l (0,%sp), %d2 ; 8-byte Folded Reload
53 ; CHECK-NEXT: adda.l #4, %sp
55 %aa = load i64, i64* %a
56 %b = add i64 %aa, 2147483648
61 define fastcc void @test4(i64* inreg %a) nounwind {
64 ; CHECK-NEXT: suba.l #4, %sp
65 ; CHECK-NEXT: movem.l %d2, (0,%sp) ; 8-byte Folded Spill
66 ; CHECK-NEXT: move.l (%a0), %d0
67 ; CHECK-NEXT: move.l #0, %d1
68 ; CHECK-NEXT: move.l #128, %d2
69 ; CHECK-NEXT: add.l (4,%a0), %d2
70 ; CHECK-NEXT: addx.l %d0, %d1
71 ; CHECK-NEXT: move.l %d2, (4,%a0)
72 ; CHECK-NEXT: move.l %d1, (%a0)
73 ; CHECK-NEXT: movem.l (0,%sp), %d2 ; 8-byte Folded Reload
74 ; CHECK-NEXT: adda.l #4, %sp
76 %aa = load i64, i64* %a
82 define fastcc i32 @test9(i32 %x, i32 %y) nounwind readnone {
85 ; CHECK-NEXT: sub.l #10, %d0
87 ; CHECK-NEXT: and.l #255, %d0
88 ; CHECK-NEXT: sub.l %d0, %d1
89 ; CHECK-NEXT: move.l %d1, %d0
91 %cmp = icmp eq i32 %x, 10
92 %sub = sext i1 %cmp to i32
93 %cond = add i32 %sub, %y