xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/2009-08-14-Win64MemoryIndirectArg.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s
2*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-mingw"
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; ModuleID = 'mm.bc'
5*9880d681SAndroid Build Coastguard Worker	%0 = type opaque		; type %0
6*9880d681SAndroid Build Coastguard Worker	%1 = type opaque		; type %1
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Workerdefine internal fastcc float @computeMipmappingRho(%0* %shaderExecutionStatePtr, i32 %index, <4 x float> %texCoord, <4 x float> %texCoordDX, <4 x float> %texCoordDY) readonly {
9*9880d681SAndroid Build Coastguard WorkerindexCheckBlock:
10*9880d681SAndroid Build Coastguard Worker	%indexCmp = icmp ugt i32 %index, 16		; <i1> [#uses=1]
11*9880d681SAndroid Build Coastguard Worker	br i1 %indexCmp, label %zeroReturnBlock, label %primitiveTextureFetchBlock
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard WorkerprimitiveTextureFetchBlock:		; preds = %indexCheckBlock
14*9880d681SAndroid Build Coastguard Worker	%pointerArithmeticTmp = bitcast %0* %shaderExecutionStatePtr to i8*		; <i8*> [#uses=1]
15*9880d681SAndroid Build Coastguard Worker	%pointerArithmeticTmp1 = getelementptr i8, i8* %pointerArithmeticTmp, i64 1808		; <i8*> [#uses=1]
16*9880d681SAndroid Build Coastguard Worker	%pointerArithmeticTmp2 = bitcast i8* %pointerArithmeticTmp1 to %1**		; <%1**> [#uses=1]
17*9880d681SAndroid Build Coastguard Worker	%primitivePtr = load %1*, %1** %pointerArithmeticTmp2		; <%1*> [#uses=1]
18*9880d681SAndroid Build Coastguard Worker	%pointerArithmeticTmp3 = bitcast %1* %primitivePtr to i8*		; <i8*> [#uses=1]
19*9880d681SAndroid Build Coastguard Worker	%pointerArithmeticTmp4 = getelementptr i8, i8* %pointerArithmeticTmp3, i64 19408		; <i8*> [#uses=1]
20*9880d681SAndroid Build Coastguard Worker	%pointerArithmeticTmp5 = bitcast i8* %pointerArithmeticTmp4 to %1**		; <%1**> [#uses=1]
21*9880d681SAndroid Build Coastguard Worker	%primitiveTexturePtr = getelementptr %1*, %1** %pointerArithmeticTmp5, i32 %index		; <%1**> [#uses=1]
22*9880d681SAndroid Build Coastguard Worker	%primitiveTexturePtr6 = load %1*, %1** %primitiveTexturePtr		; <%1*> [#uses=2]
23*9880d681SAndroid Build Coastguard Worker	br label %textureCheckBlock
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard WorkertextureCheckBlock:		; preds = %primitiveTextureFetchBlock
26*9880d681SAndroid Build Coastguard Worker	%texturePtrInt = ptrtoint %1* %primitiveTexturePtr6 to i64		; <i64> [#uses=1]
27*9880d681SAndroid Build Coastguard Worker	%testTextureNULL = icmp eq i64 %texturePtrInt, 0		; <i1> [#uses=1]
28*9880d681SAndroid Build Coastguard Worker	br i1 %testTextureNULL, label %zeroReturnBlock, label %rhoCalculateBlock
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard WorkerrhoCalculateBlock:		; preds = %textureCheckBlock
31*9880d681SAndroid Build Coastguard Worker	%pointerArithmeticTmp7 = bitcast %1* %primitiveTexturePtr6 to i8*		; <i8*> [#uses=1]
32*9880d681SAndroid Build Coastguard Worker	%pointerArithmeticTmp8 = getelementptr i8, i8* %pointerArithmeticTmp7, i64 640		; <i8*> [#uses=1]
33*9880d681SAndroid Build Coastguard Worker	%pointerArithmeticTmp9 = bitcast i8* %pointerArithmeticTmp8 to <4 x float>*		; <<4 x float>*> [#uses=1]
34*9880d681SAndroid Build Coastguard Worker	%dimensionsPtr = load <4 x float>, <4 x float>* %pointerArithmeticTmp9, align 1		; <<4 x float>> [#uses=2]
35*9880d681SAndroid Build Coastguard Worker	%texDiffDX = fsub <4 x float> %texCoordDX, %texCoord		; <<4 x float>> [#uses=1]
36*9880d681SAndroid Build Coastguard Worker	%texDiffDY = fsub <4 x float> %texCoordDY, %texCoord		; <<4 x float>> [#uses=1]
37*9880d681SAndroid Build Coastguard Worker	%ddx = fmul <4 x float> %texDiffDX, %dimensionsPtr		; <<4 x float>> [#uses=2]
38*9880d681SAndroid Build Coastguard Worker	%ddx10 = fmul <4 x float> %texDiffDY, %dimensionsPtr		; <<4 x float>> [#uses=2]
39*9880d681SAndroid Build Coastguard Worker	%ddxSquared = fmul <4 x float> %ddx, %ddx		; <<4 x float>> [#uses=3]
40*9880d681SAndroid Build Coastguard Worker	%0 = shufflevector <4 x float> %ddxSquared, <4 x float> %ddxSquared, <4 x i32> <i32 1, i32 0, i32 0, i32 0>		; <<4 x float>> [#uses=1]
41*9880d681SAndroid Build Coastguard Worker	%dxSquared = fadd <4 x float> %ddxSquared, %0		; <<4 x float>> [#uses=1]
42*9880d681SAndroid Build Coastguard Worker	%1 = call <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float> %dxSquared)		; <<4 x float>> [#uses=1]
43*9880d681SAndroid Build Coastguard Worker	%ddySquared = fmul <4 x float> %ddx10, %ddx10		; <<4 x float>> [#uses=3]
44*9880d681SAndroid Build Coastguard Worker	%2 = shufflevector <4 x float> %ddySquared, <4 x float> %ddySquared, <4 x i32> <i32 1, i32 0, i32 0, i32 0>		; <<4 x float>> [#uses=1]
45*9880d681SAndroid Build Coastguard Worker	%dySquared = fadd <4 x float> %ddySquared, %2		; <<4 x float>> [#uses=1]
46*9880d681SAndroid Build Coastguard Worker	%3 = call <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float> %dySquared)		; <<4 x float>> [#uses=1]
47*9880d681SAndroid Build Coastguard Worker	%4 = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> %1, <4 x float> %3)		; <<4 x float>> [#uses=1]
48*9880d681SAndroid Build Coastguard Worker	%rho = extractelement <4 x float> %4, i32 0		; <float> [#uses=1]
49*9880d681SAndroid Build Coastguard Worker	ret float %rho
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard WorkerzeroReturnBlock:		; preds = %textureCheckBlock, %indexCheckBlock
52*9880d681SAndroid Build Coastguard Worker	ret float 0.000000e+00
53*9880d681SAndroid Build Coastguard Worker}
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float>) nounwind readnone
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>) nounwind readnone
58