1 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
2 ; RUN: -mattr=+altivec -vec-extabi -xcoff-traceback-table=true < %s | \
3 ; RUN: FileCheck --check-prefixes=CHECK-ASM,COMMON %s
5 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -function-sections \
6 ; RUN: -mcpu=pwr4 -mattr=+altivec -vec-extabi < %s | \
7 ; RUN: FileCheck --check-prefixes=CHECK-FUNC,COMMON %s
9 define float @bar() #0 {
11 %fvalue = alloca float, align 4
12 %taken = alloca i32, align 4
13 %data = alloca i32, align 4
14 store float 1.000000e+00, float* %fvalue, align 4
15 %0 = load float, float* %fvalue, align 4
16 %1 = call float asm "fneg $0,$1\0A\09", "=b,b,~{f31},~{f30},~{f29},~{f28},~{f27}"(float %0)
17 store float %1, float* %fvalue, align 4
18 store i32 123, i32* %data, align 4
19 %2 = load i32, i32* %data, align 4
20 %3 = call i32 asm "cntlzw $0, $1\0A\09", "=b,b,~{r31},~{r30},~{r29},~{r28}"(i32 %2)
21 store i32 %3, i32* %taken, align 4
22 %4 = load i32, i32* %taken, align 4
23 %conv = sitofp i32 %4 to float
24 %5 = load float, float* %fvalue, align 4
25 %add = fadd float %conv, %5
29 define <4 x i32> @foov() #0 {
31 %taken = alloca <4 x i32>, align 16
32 %data = alloca <4 x i32>, align 16
33 store <4 x i32> <i32 123, i32 0, i32 0, i32 0>, <4 x i32>* %data, align 16
34 call void asm sideeffect "", "~{v31},~{v30},~{v29},~{v28}"()
35 %0 = load <4 x i32>, <4 x i32>* %taken, align 16
39 ; COMMON: .vbyte 4, 0x00000000 # Traceback table begin
40 ; COMMON-NEXT: .byte 0x00 # Version = 0
41 ; COMMON-NEXT: .byte 0x09 # Language = CPlusPlus
42 ; COMMON-NEXT: .byte 0x22 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue
43 ; COMMON-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure
44 ; COMMON-NEXT: # -HasControlledStorage, -IsTOCless
45 ; COMMON-NEXT: # +IsFloatingPointPresent
46 ; COMMON-NEXT: # -IsFloatingPointOperationLogOrAbortEnabled
47 ; COMMON-NEXT: .byte 0x60 # -IsInterruptHandler, +IsFunctionNamePresent, +IsAllocaUsed
48 ; COMMON-NEXT: # OnConditionDirective = 0, -IsCRSaved, -IsLRSaved
49 ; COMMON-NEXT: .byte 0x85 # +IsBackChainStored, -IsFixup, NumOfFPRsSaved = 5
50 ; COMMON-NEXT: .byte 0x04 # -HasExtensionTable, -HasVectorInfo, NumOfGPRsSaved = 4
51 ; COMMON-NEXT: .byte 0x00 # NumberOfFixedParms = 0
52 ; COMMON-NEXT: .byte 0x01 # NumberOfFPParms = 0, +HasParmsOnStack
53 ; CHECK-ASM-NEXT: .vbyte 4, L..bar0-.bar # Function size
54 ; CHECK-FUNC-NEXT: .vbyte 4, L..bar0-.bar[PR] # Function size
55 ; COMMON-NEXT: .vbyte 2, 0x0003 # Function name len = 3
56 ; COMMON-NEXT: .byte "bar" # Function Name
57 ; COMMON-NEXT: .byte 0x1f # AllocaUsed
58 ; COMMON-NEXT: # -- End function
61 ; COMMON-NEXT: .vbyte 4, 0x00000000 # Traceback table begin
62 ; COMMON-NEXT: .byte 0x00 # Version = 0
63 ; COMMON-NEXT: .byte 0x09 # Language = CPlusPlus
64 ; COMMON-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue
65 ; COMMON-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure
66 ; COMMON-NEXT: # -HasControlledStorage, -IsTOCless
67 ; COMMON-NEXT: # -IsFloatingPointPresent
68 ; COMMON-NEXT: # -IsFloatingPointOperationLogOrAbortEnabled
69 ; COMMON-NEXT: .byte 0x40 # -IsInterruptHandler, +IsFunctionNamePresent, -IsAllocaUsed
70 ; COMMON-NEXT: # OnConditionDirective = 0, -IsCRSaved, -IsLRSaved
71 ; COMMON-NEXT: .byte 0x80 # +IsBackChainStored, -IsFixup, NumOfFPRsSaved = 0
72 ; COMMON-NEXT: .byte 0xc0 # +HasExtensionTable, +HasVectorInfo, NumOfGPRsSaved = 0
73 ; COMMON-NEXT: .byte 0x00 # NumberOfFixedParms = 0
74 ; COMMON-NEXT: .byte 0x01 # NumberOfFPParms = 0, +HasParmsOnStack
75 ; CHECK-ASM-NEXT: .vbyte 4, L..foov0-.foov # Function size
76 ; CHECK-FUNC-NEXT: .vbyte 4, L..foov0-.foov[PR] # Function size
77 ; COMMON-NEXT: .vbyte 2, 0x0004 # Function name len = 4
78 ; COMMON-NEXT: .byte "foov" # Function Name
79 ; COMMON-NEXT: .byte 0x12 # NumOfVRsSaved = 4, +IsVRSavedOnStack, -HasVarArgs
80 ; COMMON-NEXT: .byte 0x01 # NumOfVectorParams = 0, +HasVMXInstruction
81 ; COMMON-NEXT: .vbyte 4, 0x00000000 # Vector Parameter type =
82 ; COMMON-NEXT: .vbyte 2, 0x0000 # Padding
83 ; COMMON-NEXT: .byte 0x08 # ExtensionTableFlag = TB_EH_INFO
84 ; COMMON-NEXT: .align 2
85 ; COMMON-NEXT: .vbyte 4, L..C2-TOC[TC0] # EHInfo Table
87 ; COMMON: .csect .eh_info_table[RW],2
88 ; COMMON-NEXT:__ehinfo.1:
89 ; COMMON-NEXT: .vbyte 4, 0
90 ; COMMON-NEXT: .align 2
91 ; COMMON-NEXT: .vbyte 4, 0
92 ; COMMON-NEXT: .vbyte 4, 0
93 ; CHECK-ASM-NEXT: .csect .text[PR],2
94 ; CHECK-FUNC-NEXT: .csect .foov[PR],2
95 ; COMMON-NEXT: # -- End function
98 ; COMMON-NEXT: .tc __ehinfo.1[TC],__ehinfo.1