1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
3 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
4 target triple = "i386-apple-darwin9.0"
6 define void @cpuid(ptr %data) nounwind {
8 ; CHECK: ## %bb.0: ## %entry
9 ; CHECK-NEXT: pushl %ebx
10 ; CHECK-NEXT: pushl %esi
11 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %esi
12 ; CHECK-NEXT: movl 20(%esi), %eax
13 ; CHECK-NEXT: movl 24(%esi), %ebx
14 ; CHECK-NEXT: movl 28(%esi), %ecx
15 ; CHECK-NEXT: movl 32(%esi), %edx
16 ; CHECK-NEXT: ## InlineAsm Start
18 ; CHECK-NEXT: ## InlineAsm End
19 ; CHECK-NEXT: movl %ebx, 8(%esi)
20 ; CHECK-NEXT: movl %ecx, 12(%esi)
21 ; CHECK-NEXT: movl %edx, 16(%esi)
22 ; CHECK-NEXT: movl %eax, 4(%esi)
23 ; CHECK-NEXT: popl %esi
24 ; CHECK-NEXT: popl %ebx
27 %arrayidx = getelementptr i32, ptr %data, i32 1 ; <ptr> [#uses=1]
28 %arrayidx2 = getelementptr i32, ptr %data, i32 2 ; <ptr> [#uses=1]
29 %arrayidx4 = getelementptr i32, ptr %data, i32 3 ; <ptr> [#uses=1]
30 %arrayidx6 = getelementptr i32, ptr %data, i32 4 ; <ptr> [#uses=1]
31 %arrayidx8 = getelementptr i32, ptr %data, i32 5 ; <ptr> [#uses=1]
32 %tmp9 = load i32, ptr %arrayidx8 ; <i32> [#uses=1]
33 %arrayidx11 = getelementptr i32, ptr %data, i32 6 ; <ptr> [#uses=1]
34 %tmp12 = load i32, ptr %arrayidx11 ; <i32> [#uses=1]
35 %arrayidx14 = getelementptr i32, ptr %data, i32 7 ; <ptr> [#uses=1]
36 %tmp15 = load i32, ptr %arrayidx14 ; <i32> [#uses=1]
37 %arrayidx17 = getelementptr i32, ptr %data, i32 8 ; <ptr> [#uses=1]
38 %tmp18 = load i32, ptr %arrayidx17 ; <i32> [#uses=1]
39 %0 = call i32 asm "cpuid", "={ax},=*{bx},=*{cx},=*{dx},{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i32) %arrayidx2, ptr elementtype(i32) %arrayidx4, ptr elementtype(i32) %arrayidx6, i32 %tmp9, i32 %tmp12, i32 %tmp15, i32 %tmp18) nounwind ; <i32> [#uses=1]
40 store i32 %0, ptr %arrayidx