1target 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:32:32-n8:16:32-S128" 2target triple = "i386-unknown-linux-gnu" 3 4declare <4 x float> @llvm.x86.sse.min.ps(<4 x float>, <4 x float>) 5declare <4 x float> @llvm.x86.sse.max.ps(<4 x float>, <4 x float>) 6declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>) 7declare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>) 8 9define <4 x float> @_Z5clampDv4_fS_S_(<4 x float> %in, <4 x float> %low, <4 x float> %high) nounwind readnone alwaysinline { 10 %1 = tail call <4 x float> @llvm.x86.sse.min.ps(<4 x float> %in, <4 x float> %high) nounwind readnone 11 %2 = tail call <4 x float> @llvm.x86.sse.max.ps(<4 x float> %1, <4 x float> %low) nounwind readnone 12 ret <4 x float> %2 13} 14 15define <3 x float> @_Z5clampDv3_fS_S_(<3 x float> %in, <3 x float> %low, <3 x float> %high) nounwind readnone alwaysinline { 16 %1 = shufflevector <3 x float> %in, <3 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 17 %2 = shufflevector <3 x float> %low, <3 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 18 %3 = shufflevector <3 x float> %high, <3 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 19 %4 = tail call <4 x float> @_Z5clampDv4_fS_S_(<4 x float> %1, <4 x float> %2, <4 x float> %3) nounwind readnone 20 %5 = shufflevector <4 x float> %4, <4 x float> undef, <3 x i32> <i32 0, i32 1, i32 2> 21 ret <3 x float> %5 22} 23 24define <2 x float> @_Z5clampDv2_fS_S_(<2 x float> %in, <2 x float> %low, <2 x float> %high) nounwind readnone alwaysinline { 25 %1 = shufflevector <2 x float> %in, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 26 %2 = shufflevector <2 x float> %low, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 27 %3 = shufflevector <2 x float> %high, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 28 %4 = tail call <4 x float> @_Z5clampDv4_fS_S_(<4 x float> %1, <4 x float> %2, <4 x float> %3) nounwind readnone 29 %5 = shufflevector <4 x float> %4, <4 x float> undef, <2 x i32> <i32 0, i32 1> 30 ret <2 x float> %5 31} 32 33define float @_Z5clampfff(float %in, float %low, float %high) nounwind readnone alwaysinline { 34 %1 = insertelement <4 x float> undef, float %in, i32 0 35 %2 = insertelement <4 x float> undef, float %low, i32 0 36 %3 = insertelement <4 x float> undef, float %high, i32 0 37 %4 = tail call <4 x float> @llvm.x86.sse.min.ss(<4 x float> %1, <4 x float> %3) nounwind readnone 38 %5 = tail call <4 x float> @llvm.x86.sse.max.ss(<4 x float> %4, <4 x float> %2) nounwind readnone 39 %6 = extractelement <4 x float> %5, i32 0 40 ret float %6 41} 42 43define <4 x float> @_Z5clampDv4_fff(<4 x float> %in, float %low, float %high) nounwind readonly { 44 %1 = insertelement <4 x float> undef, float %low, i32 0 45 %2 = insertelement <4 x float> %1, float %low, i32 1 46 %3 = insertelement <4 x float> %2, float %low, i32 2 47 %4 = insertelement <4 x float> %3, float %low, i32 3 48 %5 = insertelement <4 x float> undef, float %high, i32 0 49 %6 = insertelement <4 x float> %5, float %high, i32 1 50 %7 = insertelement <4 x float> %6, float %high, i32 2 51 %8 = insertelement <4 x float> %7, float %high, i32 3 52 %9 = tail call <4 x float> @_Z5clampDv4_fS_S_(<4 x float> %in, <4 x float> %4, <4 x float> %8) nounwind readnone 53 ret <4 x float> %9 54} 55 56define <3 x float> @_Z5clampDv3_fff(<3 x float> %in, float %low, float %high) nounwind readonly { 57 %1 = insertelement <3 x float> undef, float %low, i32 0 58 %2 = insertelement <3 x float> %1, float %low, i32 1 59 %3 = insertelement <3 x float> %2, float %low, i32 2 60 %4 = insertelement <3 x float> undef, float %high, i32 0 61 %5 = insertelement <3 x float> %4, float %high, i32 1 62 %6 = insertelement <3 x float> %5, float %high, i32 2 63 %7 = tail call <3 x float> @_Z5clampDv3_fS_S_(<3 x float> %in, <3 x float> %3, <3 x float> %6) nounwind readnone 64 ret <3 x float> %7 65} 66 67define <2 x float> @_Z5clampDv2_fff(<2 x float> %in, float %low, float %high) nounwind readonly { 68 %1 = insertelement <2 x float> undef, float %low, i32 0 69 %2 = insertelement <2 x float> %1, float %low, i32 1 70 %3 = insertelement <2 x float> undef, float %high, i32 0 71 %4 = insertelement <2 x float> %3, float %high, i32 1 72 %5 = tail call <2 x float> @_Z5clampDv2_fS_S_(<2 x float> %in, <2 x float> %2, <2 x float> %4) nounwind readnone 73 ret <2 x float> %5 74} 75