1 ; RUN: llc < %s -march=x86-64 -no-integrated-as 2 ; ModuleID = 'mult-alt-generic.c' 3 target 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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" 4 target triple = "x86_64" 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 10 define void @single_m() nounwind { 11 entry: 12 call void asm "foo $1,$0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i32* @mout0, i32* @min1) nounwind 13 ret void 14 } 15 16 define void @single_o() nounwind { 17 entry: 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 25 define void @single_V() nounwind { 26 entry: 27 ret void 28 } 29 30 define void @single_lt() nounwind { 31 entry: 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, i32* %in1, align 4 37 %0 = call i32 asm "foo $1,$0", "=r,<r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 38 store i32 %0, i32* %out0, align 4 39 %tmp1 = load i32, i32* %in1, align 4 40 %1 = call i32 asm "foo $1,$0", "=r,r<,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind 41 store i32 %1, i32* %out0, align 4 42 ret void 43 } 44 45 define void @single_gt() nounwind { 46 entry: 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, i32* %in1, align 4 52 %0 = call i32 asm "foo $1,$0", "=r,>r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 53 store i32 %0, i32* %out0, align 4 54 %tmp1 = load i32, i32* %in1, align 4 55 %1 = call i32 asm "foo $1,$0", "=r,r>,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind 56 store i32 %1, i32* %out0, align 4 57 ret void 58 } 59 60 define void @single_r() nounwind { 61 entry: 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, i32* %in1, align 4 67 %0 = call i32 asm "foo $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 68 store i32 %0, i32* %out0, align 4 69 ret void 70 } 71 72 define void @single_i() nounwind { 73 entry: 74 %out0 = alloca i32, align 4 75 store i32 0, i32* %out0, align 4 76 %0 = call i32 asm "foo $1,$0", "=r,i,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind 77 store i32 %0, i32* %out0, align 4 78 ret void 79 } 80 81 define void @single_n() nounwind { 82 entry: 83 %out0 = alloca i32, align 4 84 store i32 0, i32* %out0, align 4 85 %0 = call i32 asm "foo $1,$0", "=r,n,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind 86 store i32 %0, i32* %out0, align 4 87 ret void 88 } 89 90 define void @single_E() nounwind { 91 entry: 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,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+001) nounwind 96 ; store double %0, double* %out0, align 8 97 ret void 98 } 99 100 define void @single_F() nounwind { 101 entry: 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,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+000) nounwind 106 ; store double %0, double* %out0, align 8 107 ret void 108 } 109 110 define void @single_s() nounwind { 111 entry: 112 %out0 = alloca i32, align 4 113 store i32 0, i32* %out0, align 4 114 ret void 115 } 116 117 define void @single_g() nounwind { 118 entry: 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, i32* %in1, align 4 124 %0 = call i32 asm "foo $1,$0", "=r,imr,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 125 store i32 %0, i32* %out0, align 4 126 %tmp1 = load i32, i32* @min1, align 4 127 %1 = call i32 asm "foo $1,$0", "=r,imr,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind 128 store i32 %1, i32* %out0, align 4 129 %2 = call i32 asm "foo $1,$0", "=r,imr,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind 130 store i32 %2, i32* %out0, align 4 131 ret void 132 } 133 134 define void @single_X() nounwind { 135 entry: 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, i32* %in1, align 4 141 %0 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 142 store i32 %0, i32* %out0, align 4 143 %tmp1 = load i32, i32* @min1, align 4 144 %1 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind 145 store i32 %1, i32* %out0, align 4 146 %2 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind 147 store i32 %2, i32* %out0, align 4 148 %3 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(i32* getelementptr inbounds ([2 x i32], [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,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+001) nounwind 151 store i32 %4, i32* %out0, align 4 152 %5 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+000) nounwind 153 store i32 %5, i32* %out0, align 4 154 ret void 155 } 156 157 define void @single_p() nounwind { 158 entry: 159 %out0 = alloca i32, align 4 160 store i32 0, i32* %out0, align 4 161 %0 = call i32 asm "foo $1,$0", "=r,im,~{dirflag},~{fpsr},~{flags}"(i32* getelementptr inbounds ([2 x i32], [2 x i32]* @marray, i32 0, i32 0)) nounwind 162 store i32 %0, i32* %out0, align 4 163 ret void 164 } 165 166 define void @multi_m() nounwind { 167 entry: 168 %tmp = load i32, i32* @min1, align 4 169 call void asm "foo $1,$0", "=*m|r,m|r,~{dirflag},~{fpsr},~{flags}"(i32* @mout0, i32 %tmp) nounwind 170 ret void 171 } 172 173 define void @multi_o() nounwind { 174 entry: 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 182 define void @multi_V() nounwind { 183 entry: 184 ret void 185 } 186 187 define void @multi_lt() nounwind { 188 entry: 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, i32* %in1, align 4 194 %0 = call i32 asm "foo $1,$0", "=r|r,r|<r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 195 store i32 %0, i32* %out0, align 4 196 %tmp1 = load i32, i32* %in1, align 4 197 %1 = call i32 asm "foo $1,$0", "=r|r,r|r<,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind 198 store i32 %1, i32* %out0, align 4 199 ret void 200 } 201 202 define void @multi_gt() nounwind { 203 entry: 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, i32* %in1, align 4 209 %0 = call i32 asm "foo $1,$0", "=r|r,r|>r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 210 store i32 %0, i32* %out0, align 4 211 %tmp1 = load i32, i32* %in1, align 4 212 %1 = call i32 asm "foo $1,$0", "=r|r,r|r>,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind 213 store i32 %1, i32* %out0, align 4 214 ret void 215 } 216 217 define void @multi_r() nounwind { 218 entry: 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, i32* %in1, align 4 224 %0 = call i32 asm "foo $1,$0", "=r|r,r|m,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 225 store i32 %0, i32* %out0, align 4 226 ret void 227 } 228 229 define void @multi_i() nounwind { 230 entry: 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,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind 234 store i32 %0, i32* %out0, align 4 235 ret void 236 } 237 238 define void @multi_n() nounwind { 239 entry: 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,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind 243 store i32 %0, i32* %out0, align 4 244 ret void 245 } 246 247 define void @multi_E() nounwind { 248 entry: 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,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+001) nounwind 253 ; store double %0, double* %out0, align 8 254 ret void 255 } 256 257 define void @multi_F() nounwind { 258 entry: 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,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+000) nounwind 263 ; store double %0, double* %out0, align 8 264 ret void 265 } 266 267 define void @multi_s() nounwind { 268 entry: 269 %out0 = alloca i32, align 4 270 store i32 0, i32* %out0, align 4 271 ret void 272 } 273 274 define void @multi_g() nounwind { 275 entry: 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, i32* %in1, align 4 281 %0 = call i32 asm "foo $1,$0", "=r|r,r|imr,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 282 store i32 %0, i32* %out0, align 4 283 %tmp1 = load i32, i32* @min1, align 4 284 %1 = call i32 asm "foo $1,$0", "=r|r,r|imr,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind 285 store i32 %1, i32* %out0, align 4 286 %2 = call i32 asm "foo $1,$0", "=r|r,r|imr,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind 287 store i32 %2, i32* %out0, align 4 288 ret void 289 } 290 291 define void @multi_X() nounwind { 292 entry: 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, i32* %in1, align 4 298 %0 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind 299 store i32 %0, i32* %out0, align 4 300 %tmp1 = load i32, i32* @min1, align 4 301 %1 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind 302 store i32 %1, i32* %out0, align 4 303 %2 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind 304 store i32 %2, i32* %out0, align 4 305 %3 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(i32* getelementptr inbounds ([2 x i32], [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,~{dirflag},~{fpsr},~{flags}"(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,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+000) nounwind 310 store i32 %5, i32* %out0, align 4 311 ret void 312 } 313 314 define void @multi_p() nounwind { 315 entry: 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|im,~{dirflag},~{fpsr},~{flags}"(i32* getelementptr inbounds ([2 x i32], [2 x i32]* @marray, i32 0, i32 0)) nounwind 319 store i32 %0, i32* %out0, align 4 320 ret void 321 } 322