1; RUN: llc < %s -march=ppc64 2; ModuleID = 'mult-alt-generic.c' 3target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64" 4target triple = "powerpc64" 5 6@mout0 = common global i32 0, align 4 7@min1 = common global i32 0, align 4 8@marray = common global [2 x i32] zeroinitializer, align 4 9 10define void @single_m() nounwind { 11entry: 12 call void asm "foo $1,$0", "=*m,*m"(i32* @mout0, i32* @min1) nounwind 13 ret void 14} 15 16define void @single_o() nounwind { 17entry: 18 %out0 = alloca i32, align 4 19 %index = alloca i32, align 4 20 store i32 0, i32* %out0, align 4 21 store i32 1, i32* %index, align 4 22 ret void 23} 24 25define void @single_V() nounwind { 26entry: 27 ret void 28} 29 30define void @single_lt() nounwind { 31entry: 32 %out0 = alloca i32, align 4 33 %in1 = alloca i32, align 4 34 store i32 0, i32* %out0, align 4 35 store i32 1, i32* %in1, align 4 36 %tmp = load i32* %in1, align 4 37 %0 = call i32 asm "foo $1,$0", "=r,<r"(i32 %tmp) nounwind 38 store i32 %0, i32* %out0, align 4 39 %tmp1 = load i32* %in1, align 4 40 %1 = call i32 asm "foo $1,$0", "=r,r<"(i32 %tmp1) nounwind 41 store i32 %1, i32* %out0, align 4 42 ret void 43} 44 45define void @single_gt() nounwind { 46entry: 47 %out0 = alloca i32, align 4 48 %in1 = alloca i32, align 4 49 store i32 0, i32* %out0, align 4 50 store i32 1, i32* %in1, align 4 51 %tmp = load i32* %in1, align 4 52 %0 = call i32 asm "foo $1,$0", "=r,>r"(i32 %tmp) nounwind 53 store i32 %0, i32* %out0, align 4 54 %tmp1 = load i32* %in1, align 4 55 %1 = call i32 asm "foo $1,$0", "=r,r>"(i32 %tmp1) nounwind 56 store i32 %1, i32* %out0, align 4 57 ret void 58} 59 60define void @single_r() nounwind { 61entry: 62 %out0 = alloca i32, align 4 63 %in1 = alloca i32, align 4 64 store i32 0, i32* %out0, align 4 65 store i32 1, i32* %in1, align 4 66 %tmp = load i32* %in1, align 4 67 %0 = call i32 asm "foo $1,$0", "=r,r"(i32 %tmp) nounwind 68 store i32 %0, i32* %out0, align 4 69 ret void 70} 71 72define void @single_i() nounwind { 73entry: 74 %out0 = alloca i32, align 4 75 store i32 0, i32* %out0, align 4 76 %0 = call i32 asm "foo $1,$0", "=r,i"(i32 1) nounwind 77 store i32 %0, i32* %out0, align 4 78 ret void 79} 80 81define void @single_n() nounwind { 82entry: 83 %out0 = alloca i32, align 4 84 store i32 0, i32* %out0, align 4 85 %0 = call i32 asm "foo $1,$0", "=r,n"(i32 1) nounwind 86 store i32 %0, i32* %out0, align 4 87 ret void 88} 89 90define void @single_E() nounwind { 91entry: 92 %out0 = alloca double, align 8 93 store double 0.000000e+000, double* %out0, align 8 94; No lowering support. 95; %0 = call double asm "foo $1,$0", "=r,E"(double 1.000000e+001) nounwind 96; store double %0, double* %out0, align 8 97 ret void 98} 99 100define void @single_F() nounwind { 101entry: 102 %out0 = alloca double, align 8 103 store double 0.000000e+000, double* %out0, align 8 104; No lowering support. 105; %0 = call double asm "foo $1,$0", "=r,F"(double 1.000000e+000) nounwind 106; store double %0, double* %out0, align 8 107 ret void 108} 109 110define void @single_s() nounwind { 111entry: 112 %out0 = alloca i32, align 4 113 store i32 0, i32* %out0, align 4 114 ret void 115} 116 117define void @single_g() nounwind { 118entry: 119 %out0 = alloca i32, align 4 120 %in1 = alloca i32, align 4 121 store i32 0, i32* %out0, align 4 122 store i32 1, i32* %in1, align 4 123 %tmp = load i32* %in1, align 4 124 %0 = call i32 asm "foo $1,$0", "=r,imr"(i32 %tmp) nounwind 125 store i32 %0, i32* %out0, align 4 126 %tmp1 = load i32* @min1, align 4 127 %1 = call i32 asm "foo $1,$0", "=r,imr"(i32 %tmp1) nounwind 128 store i32 %1, i32* %out0, align 4 129 %2 = call i32 asm "foo $1,$0", "=r,imr"(i32 1) nounwind 130 store i32 %2, i32* %out0, align 4 131 ret void 132} 133 134define void @single_X() nounwind { 135entry: 136 %out0 = alloca i32, align 4 137 %in1 = alloca i32, align 4 138 store i32 0, i32* %out0, align 4 139 store i32 1, i32* %in1, align 4 140 %tmp = load i32* %in1, align 4 141 %0 = call i32 asm "foo $1,$0", "=r,X"(i32 %tmp) nounwind 142 store i32 %0, i32* %out0, align 4 143 %tmp1 = load i32* @min1, align 4 144 %1 = call i32 asm "foo $1,$0", "=r,X"(i32 %tmp1) nounwind 145 store i32 %1, i32* %out0, align 4 146 %2 = call i32 asm "foo $1,$0", "=r,X"(i32 1) nounwind 147 store i32 %2, i32* %out0, align 4 148 %3 = call i32 asm "foo $1,$0", "=r,X"(i32* getelementptr inbounds ([2 x i32]* @marray, i32 0, i32 0)) nounwind 149 store i32 %3, i32* %out0, align 4 150 %4 = call i32 asm "foo $1,$0", "=r,X"(double 1.000000e+001) nounwind 151 store i32 %4, i32* %out0, align 4 152 %5 = call i32 asm "foo $1,$0", "=r,X"(double 1.000000e+000) nounwind 153 store i32 %5, i32* %out0, align 4 154 ret void 155} 156 157define void @single_p() nounwind { 158entry: 159 %out0 = alloca i32, align 4 160 store i32 0, i32* %out0, align 4 161 %0 = call i32 asm "foo $1,$0", "=r,r"(i32* getelementptr inbounds ([2 x i32]* @marray, i32 0, i32 0)) nounwind 162 store i32 %0, i32* %out0, align 4 163 ret void 164} 165 166define void @multi_m() nounwind { 167entry: 168 %tmp = load i32* @min1, align 4 169 call void asm "foo $1,$0", "=*m|r,m|r"(i32* @mout0, i32 %tmp) nounwind 170 ret void 171} 172 173define void @multi_o() nounwind { 174entry: 175 %out0 = alloca i32, align 4 176 %index = alloca i32, align 4 177 store i32 0, i32* %out0, align 4 178 store i32 1, i32* %index, align 4 179 ret void 180} 181 182define void @multi_V() nounwind { 183entry: 184 ret void 185} 186 187define void @multi_lt() nounwind { 188entry: 189 %out0 = alloca i32, align 4 190 %in1 = alloca i32, align 4 191 store i32 0, i32* %out0, align 4 192 store i32 1, i32* %in1, align 4 193 %tmp = load i32* %in1, align 4 194 %0 = call i32 asm "foo $1,$0", "=r|r,r|<r"(i32 %tmp) nounwind 195 store i32 %0, i32* %out0, align 4 196 %tmp1 = load i32* %in1, align 4 197 %1 = call i32 asm "foo $1,$0", "=r|r,r|r<"(i32 %tmp1) nounwind 198 store i32 %1, i32* %out0, align 4 199 ret void 200} 201 202define void @multi_gt() nounwind { 203entry: 204 %out0 = alloca i32, align 4 205 %in1 = alloca i32, align 4 206 store i32 0, i32* %out0, align 4 207 store i32 1, i32* %in1, align 4 208 %tmp = load i32* %in1, align 4 209 %0 = call i32 asm "foo $1,$0", "=r|r,r|>r"(i32 %tmp) nounwind 210 store i32 %0, i32* %out0, align 4 211 %tmp1 = load i32* %in1, align 4 212 %1 = call i32 asm "foo $1,$0", "=r|r,r|r>"(i32 %tmp1) nounwind 213 store i32 %1, i32* %out0, align 4 214 ret void 215} 216 217define void @multi_r() nounwind { 218entry: 219 %out0 = alloca i32, align 4 220 %in1 = alloca i32, align 4 221 store i32 0, i32* %out0, align 4 222 store i32 1, i32* %in1, align 4 223 %tmp = load i32* %in1, align 4 224 %0 = call i32 asm "foo $1,$0", "=r|r,r|m"(i32 %tmp) nounwind 225 store i32 %0, i32* %out0, align 4 226 ret void 227} 228 229define void @multi_i() nounwind { 230entry: 231 %out0 = alloca i32, align 4 232 store i32 0, i32* %out0, align 4 233 %0 = call i32 asm "foo $1,$0", "=r|r,r|i"(i32 1) nounwind 234 store i32 %0, i32* %out0, align 4 235 ret void 236} 237 238define void @multi_n() nounwind { 239entry: 240 %out0 = alloca i32, align 4 241 store i32 0, i32* %out0, align 4 242 %0 = call i32 asm "foo $1,$0", "=r|r,r|n"(i32 1) nounwind 243 store i32 %0, i32* %out0, align 4 244 ret void 245} 246 247define void @multi_E() nounwind { 248entry: 249 %out0 = alloca double, align 8 250 store double 0.000000e+000, double* %out0, align 8 251; No lowering support. 252; %0 = call double asm "foo $1,$0", "=r|r,r|E"(double 1.000000e+001) nounwind 253; store double %0, double* %out0, align 8 254 ret void 255} 256 257define void @multi_F() nounwind { 258entry: 259 %out0 = alloca double, align 8 260 store double 0.000000e+000, double* %out0, align 8 261; No lowering support. 262; %0 = call double asm "foo $1,$0", "=r|r,r|F"(double 1.000000e+000) nounwind 263; store double %0, double* %out0, align 8 264 ret void 265} 266 267define void @multi_s() nounwind { 268entry: 269 %out0 = alloca i32, align 4 270 store i32 0, i32* %out0, align 4 271 ret void 272} 273 274define void @multi_g() nounwind { 275entry: 276 %out0 = alloca i32, align 4 277 %in1 = alloca i32, align 4 278 store i32 0, i32* %out0, align 4 279 store i32 1, i32* %in1, align 4 280 %tmp = load i32* %in1, align 4 281 %0 = call i32 asm "foo $1,$0", "=r|r,r|imr"(i32 %tmp) nounwind 282 store i32 %0, i32* %out0, align 4 283 %tmp1 = load i32* @min1, align 4 284 %1 = call i32 asm "foo $1,$0", "=r|r,r|imr"(i32 %tmp1) nounwind 285 store i32 %1, i32* %out0, align 4 286 %2 = call i32 asm "foo $1,$0", "=r|r,r|imr"(i32 1) nounwind 287 store i32 %2, i32* %out0, align 4 288 ret void 289} 290 291define void @multi_X() nounwind { 292entry: 293 %out0 = alloca i32, align 4 294 %in1 = alloca i32, align 4 295 store i32 0, i32* %out0, align 4 296 store i32 1, i32* %in1, align 4 297 %tmp = load i32* %in1, align 4 298 %0 = call i32 asm "foo $1,$0", "=r|r,r|X"(i32 %tmp) nounwind 299 store i32 %0, i32* %out0, align 4 300 %tmp1 = load i32* @min1, align 4 301 %1 = call i32 asm "foo $1,$0", "=r|r,r|X"(i32 %tmp1) nounwind 302 store i32 %1, i32* %out0, align 4 303 %2 = call i32 asm "foo $1,$0", "=r|r,r|X"(i32 1) nounwind 304 store i32 %2, i32* %out0, align 4 305 %3 = call i32 asm "foo $1,$0", "=r|r,r|X"(i32* getelementptr inbounds ([2 x i32]* @marray, i32 0, i32 0)) nounwind 306 store i32 %3, i32* %out0, align 4 307 %4 = call i32 asm "foo $1,$0", "=r|r,r|X"(double 1.000000e+001) nounwind 308 store i32 %4, i32* %out0, align 4 309 %5 = call i32 asm "foo $1,$0", "=r|r,r|X"(double 1.000000e+000) nounwind 310 store i32 %5, i32* %out0, align 4 311 ret void 312} 313 314define void @multi_p() nounwind { 315entry: 316 %out0 = alloca i32, align 4 317 store i32 0, i32* %out0, align 4 318 %0 = call i32 asm "foo $1,$0", "=r|r,r|r"(i32* getelementptr inbounds ([2 x i32]* @marray, i32 0, i32 0)) nounwind 319 store i32 %0, i32* %out0, align 4 320 ret void 321} 322