1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -verify-machineinstrs -mcpu=mvp -mattr=+multivalue -target-abi=experimental-mv | FileCheck %s --check-prefix=MULTIVALUE
3 ; RUN: llc < %s -verify-machineinstrs -mcpu=mvp | FileCheck %s --check-prefix=NO_MULTIVALUE
5 ; Test libcall signatures when multivalue is enabled and disabled
7 target triple = "wasm32-unknown-unknown"
9 define i128 @multivalue_sdiv(i128 %a, i128 %b) {
10 ; MULTIVALUE-LABEL: multivalue_sdiv:
11 ; MULTIVALUE: .functype multivalue_sdiv (i64, i64, i64, i64) -> (i64, i64)
12 ; MULTIVALUE-NEXT: # %bb.0:
13 ; MULTIVALUE-NEXT: local.get 0
14 ; MULTIVALUE-NEXT: local.get 1
15 ; MULTIVALUE-NEXT: local.get 2
16 ; MULTIVALUE-NEXT: local.get 3
17 ; MULTIVALUE-NEXT: call __divti3
18 ; MULTIVALUE-NEXT: # fallthrough-return
20 ; NO_MULTIVALUE-LABEL: multivalue_sdiv:
21 ; NO_MULTIVALUE: .functype multivalue_sdiv (i32, i64, i64, i64, i64) -> ()
22 ; NO_MULTIVALUE-NEXT: .local i32
23 ; NO_MULTIVALUE-NEXT: # %bb.0:
24 ; NO_MULTIVALUE-NEXT: global.get __stack_pointer
25 ; NO_MULTIVALUE-NEXT: i32.const 16
26 ; NO_MULTIVALUE-NEXT: i32.sub
27 ; NO_MULTIVALUE-NEXT: local.tee 5
28 ; NO_MULTIVALUE-NEXT: global.set __stack_pointer
29 ; NO_MULTIVALUE-NEXT: local.get 5
30 ; NO_MULTIVALUE-NEXT: local.get 1
31 ; NO_MULTIVALUE-NEXT: local.get 2
32 ; NO_MULTIVALUE-NEXT: local.get 3
33 ; NO_MULTIVALUE-NEXT: local.get 4
34 ; NO_MULTIVALUE-NEXT: call __divti3
35 ; NO_MULTIVALUE-NEXT: local.get 0
36 ; NO_MULTIVALUE-NEXT: local.get 5
37 ; NO_MULTIVALUE-NEXT: i32.const 8
38 ; NO_MULTIVALUE-NEXT: i32.add
39 ; NO_MULTIVALUE-NEXT: i64.load 0
40 ; NO_MULTIVALUE-NEXT: i64.store 8
41 ; NO_MULTIVALUE-NEXT: local.get 0
42 ; NO_MULTIVALUE-NEXT: local.get 5
43 ; NO_MULTIVALUE-NEXT: i64.load 0
44 ; NO_MULTIVALUE-NEXT: i64.store 0
45 ; NO_MULTIVALUE-NEXT: local.get 5
46 ; NO_MULTIVALUE-NEXT: i32.const 16
47 ; NO_MULTIVALUE-NEXT: i32.add
48 ; NO_MULTIVALUE-NEXT: global.set __stack_pointer
49 ; NO_MULTIVALUE-NEXT: # fallthrough-return
50 %div = sdiv i128 %a, %b
55 define fp128 @multivalue_fsub(fp128 %a, fp128 %b) {
56 ; MULTIVALUE-LABEL: multivalue_fsub:
57 ; MULTIVALUE: .functype multivalue_fsub (i64, i64, i64, i64) -> (i64, i64)
58 ; MULTIVALUE-NEXT: # %bb.0:
59 ; MULTIVALUE-NEXT: local.get 0
60 ; MULTIVALUE-NEXT: local.get 1
61 ; MULTIVALUE-NEXT: local.get 2
62 ; MULTIVALUE-NEXT: local.get 3
63 ; MULTIVALUE-NEXT: call __subtf3
64 ; MULTIVALUE-NEXT: # fallthrough-return
66 ; NO_MULTIVALUE-LABEL: multivalue_fsub:
67 ; NO_MULTIVALUE: .functype multivalue_fsub (i32, i64, i64, i64, i64) -> ()
68 ; NO_MULTIVALUE-NEXT: .local i32
69 ; NO_MULTIVALUE-NEXT: # %bb.0:
70 ; NO_MULTIVALUE-NEXT: global.get __stack_pointer
71 ; NO_MULTIVALUE-NEXT: i32.const 16
72 ; NO_MULTIVALUE-NEXT: i32.sub
73 ; NO_MULTIVALUE-NEXT: local.tee 5
74 ; NO_MULTIVALUE-NEXT: global.set __stack_pointer
75 ; NO_MULTIVALUE-NEXT: local.get 5
76 ; NO_MULTIVALUE-NEXT: local.get 1
77 ; NO_MULTIVALUE-NEXT: local.get 2
78 ; NO_MULTIVALUE-NEXT: local.get 3
79 ; NO_MULTIVALUE-NEXT: local.get 4
80 ; NO_MULTIVALUE-NEXT: call __subtf3
81 ; NO_MULTIVALUE-NEXT: local.get 0
82 ; NO_MULTIVALUE-NEXT: local.get 5
83 ; NO_MULTIVALUE-NEXT: i32.const 8
84 ; NO_MULTIVALUE-NEXT: i32.add
85 ; NO_MULTIVALUE-NEXT: i64.load 0
86 ; NO_MULTIVALUE-NEXT: i64.store 8
87 ; NO_MULTIVALUE-NEXT: local.get 0
88 ; NO_MULTIVALUE-NEXT: local.get 5
89 ; NO_MULTIVALUE-NEXT: i64.load 0
90 ; NO_MULTIVALUE-NEXT: i64.store 0
91 ; NO_MULTIVALUE-NEXT: local.get 5
92 ; NO_MULTIVALUE-NEXT: i32.const 16
93 ; NO_MULTIVALUE-NEXT: i32.add
94 ; NO_MULTIVALUE-NEXT: global.set __stack_pointer
95 ; NO_MULTIVALUE-NEXT: # fallthrough-return
96 %sub = fsub fp128 %a, %b
100 define i128 @multivalue_lshr(i128 %a, i128 %b) {
101 ; MULTIVALUE-LABEL: multivalue_lshr:
102 ; MULTIVALUE: .functype multivalue_lshr (i64, i64, i64, i64) -> (i64, i64)
103 ; MULTIVALUE-NEXT: # %bb.0:
104 ; MULTIVALUE-NEXT: local.get 2
105 ; MULTIVALUE-NEXT: local.get 3
106 ; MULTIVALUE-NEXT: local.get 0
107 ; MULTIVALUE-NEXT: i32.wrap_i64
108 ; MULTIVALUE-NEXT: call __ashlti3
109 ; MULTIVALUE-NEXT: # fallthrough-return
111 ; NO_MULTIVALUE-LABEL: multivalue_lshr:
112 ; NO_MULTIVALUE: .functype multivalue_lshr (i32, i64, i64, i64, i64) -> ()
113 ; NO_MULTIVALUE-NEXT: .local i32
114 ; NO_MULTIVALUE-NEXT: # %bb.0:
115 ; NO_MULTIVALUE-NEXT: global.get __stack_pointer
116 ; NO_MULTIVALUE-NEXT: i32.const 16
117 ; NO_MULTIVALUE-NEXT: i32.sub
118 ; NO_MULTIVALUE-NEXT: local.tee 5
119 ; NO_MULTIVALUE-NEXT: global.set __stack_pointer
120 ; NO_MULTIVALUE-NEXT: local.get 5
121 ; NO_MULTIVALUE-NEXT: local.get 3
122 ; NO_MULTIVALUE-NEXT: local.get 4
123 ; NO_MULTIVALUE-NEXT: local.get 1
124 ; NO_MULTIVALUE-NEXT: i32.wrap_i64
125 ; NO_MULTIVALUE-NEXT: call __ashlti3
126 ; NO_MULTIVALUE-NEXT: local.get 0
127 ; NO_MULTIVALUE-NEXT: local.get 5
128 ; NO_MULTIVALUE-NEXT: i32.const 8
129 ; NO_MULTIVALUE-NEXT: i32.add
130 ; NO_MULTIVALUE-NEXT: i64.load 0
131 ; NO_MULTIVALUE-NEXT: i64.store 8
132 ; NO_MULTIVALUE-NEXT: local.get 0
133 ; NO_MULTIVALUE-NEXT: local.get 5
134 ; NO_MULTIVALUE-NEXT: i64.load 0
135 ; NO_MULTIVALUE-NEXT: i64.store 0
136 ; NO_MULTIVALUE-NEXT: local.get 5
137 ; NO_MULTIVALUE-NEXT: i32.const 16
138 ; NO_MULTIVALUE-NEXT: i32.add
139 ; NO_MULTIVALUE-NEXT: global.set __stack_pointer
140 ; NO_MULTIVALUE-NEXT: # fallthrough-return
141 %tmp = shl i128 %b, %a