x86_sse2.ll 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. 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:32:32-n8:16:32-S128"
  2. target triple = "i686-unknown-linux"
  3. declare <4 x float> @llvm.x86.sse.min.ps(<4 x float>, <4 x float>)
  4. declare <4 x float> @llvm.x86.sse.max.ps(<4 x float>, <4 x float>)
  5. declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>)
  6. declare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>)
  7. declare float @llvm.sqrt.f32(float) nounwind readnone
  8. declare <2 x float> @llvm.sqrt.v2f32(<2 x float>) nounwind readnone
  9. declare <3 x float> @llvm.sqrt.v3f32(<3 x float>) nounwind readnone
  10. declare <4 x float> @llvm.sqrt.v4f32(<4 x float>) nounwind readnone
  11. declare float @llvm.exp.f32(float) nounwind readonly
  12. declare float @llvm.pow.f32(float, float) nounwind readonly
  13. define <4 x float> @_Z5clampDv4_fS_S_(<4 x float> %in, <4 x float> %low, <4 x float> %high) nounwind readnone alwaysinline {
  14. %1 = tail call <4 x float> @llvm.x86.sse.min.ps(<4 x float> %in, <4 x float> %high) nounwind readnone
  15. %2 = tail call <4 x float> @llvm.x86.sse.max.ps(<4 x float> %1, <4 x float> %low) nounwind readnone
  16. ret <4 x float> %2
  17. }
  18. define <3 x float> @_Z5clampDv3_fS_S_(<3 x float> %in, <3 x float> %low, <3 x float> %high) nounwind readnone alwaysinline {
  19. %1 = shufflevector <3 x float> %in, <3 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  20. %2 = shufflevector <3 x float> %low, <3 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  21. %3 = shufflevector <3 x float> %high, <3 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  22. %4 = tail call <4 x float> @_Z5clampDv4_fS_S_(<4 x float> %1, <4 x float> %2, <4 x float> %3) nounwind readnone
  23. %5 = shufflevector <4 x float> %4, <4 x float> undef, <3 x i32> <i32 0, i32 1, i32 2>
  24. ret <3 x float> %5
  25. }
  26. define <2 x float> @_Z5clampDv2_fS_S_(<2 x float> %in, <2 x float> %low, <2 x float> %high) nounwind readnone alwaysinline {
  27. %1 = shufflevector <2 x float> %in, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  28. %2 = shufflevector <2 x float> %low, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  29. %3 = shufflevector <2 x float> %high, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  30. %4 = tail call <4 x float> @_Z5clampDv4_fS_S_(<4 x float> %1, <4 x float> %2, <4 x float> %3) nounwind readnone
  31. %5 = shufflevector <4 x float> %4, <4 x float> undef, <2 x i32> <i32 0, i32 1>
  32. ret <2 x float> %5
  33. }
  34. define float @_Z5clampfff(float %in, float %low, float %high) nounwind readnone alwaysinline {
  35. %1 = insertelement <4 x float> undef, float %in, i32 0
  36. %2 = insertelement <4 x float> undef, float %low, i32 0
  37. %3 = insertelement <4 x float> undef, float %high, i32 0
  38. %4 = tail call <4 x float> @llvm.x86.sse.min.ss(<4 x float> %1, <4 x float> %3) nounwind readnone
  39. %5 = tail call <4 x float> @llvm.x86.sse.max.ss(<4 x float> %4, <4 x float> %2) nounwind readnone
  40. %6 = extractelement <4 x float> %5, i32 0
  41. ret float %6
  42. }
  43. define <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. define <3 x float> @_Z5clampDv3_fff(<3 x float> %in, float %low, float %high) nounwind readonly {
  56. %1 = insertelement <3 x float> undef, float %low, i32 0
  57. %2 = insertelement <3 x float> %1, float %low, i32 1
  58. %3 = insertelement <3 x float> %2, float %low, i32 2
  59. %4 = insertelement <3 x float> undef, float %high, i32 0
  60. %5 = insertelement <3 x float> %4, float %high, i32 1
  61. %6 = insertelement <3 x float> %5, float %high, i32 2
  62. %7 = tail call <3 x float> @_Z5clampDv3_fS_S_(<3 x float> %in, <3 x float> %3, <3 x float> %6) nounwind readnone
  63. ret <3 x float> %7
  64. }
  65. define <2 x float> @_Z5clampDv2_fff(<2 x float> %in, float %low, float %high) nounwind readonly {
  66. %1 = insertelement <2 x float> undef, float %low, i32 0
  67. %2 = insertelement <2 x float> %1, float %low, i32 1
  68. %3 = insertelement <2 x float> undef, float %high, i32 0
  69. %4 = insertelement <2 x float> %3, float %high, i32 1
  70. %5 = tail call <2 x float> @_Z5clampDv2_fS_S_(<2 x float> %in, <2 x float> %2, <2 x float> %4) nounwind readnone
  71. ret <2 x float> %5
  72. }
  73. define float @_Z4sqrtf(float %in) nounwind readnone alwaysinline {
  74. %1 = tail call float @llvm.sqrt.f32(float %in) nounwind readnone
  75. ret float %1
  76. }
  77. define <2 x float> @_Z4sqrtDv2_f(<2 x float> %in) nounwind readnone alwaysinline {
  78. %1 = tail call <2 x float> @llvm.sqrt.v2f32(<2 x float> %in) nounwind readnone
  79. ret <2 x float> %1
  80. }
  81. define <3 x float> @_Z4sqrtDv3_f(<3 x float> %in) nounwind readnone alwaysinline {
  82. %1 = tail call <3 x float> @llvm.sqrt.v3f32(<3 x float> %in) nounwind readnone
  83. ret <3 x float> %1
  84. }
  85. define <4 x float> @_Z4sqrtDv4_f(<4 x float> %in) nounwind readnone alwaysinline {
  86. %1 = tail call <4 x float> @llvm.sqrt.v4f32(<4 x float> %in) nounwind readnone
  87. ret <4 x float> %1
  88. }
  89. define float @_Z3powff(float %v1, float %v2) nounwind readnone alwaysinline {
  90. %1 = tail call float @llvm.pow.f32(float %v1, float %v2)
  91. ret float %1
  92. }