| 1 |
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu | FileCheck %s |
| 2 |
|
| 3 |
%struct.CGLDI = type { ptr, i32, i32, i32, i32, i32, ptr, i32, ptr, ptr, %struct.vv_t } |
| 4 |
%struct.cgli = type { i32, ptr, ptr, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, ptr, ptr, ptr, ptr, float, float, float, float, i32, ptr, float, ptr, [16 x i32] } |
| 5 |
%struct.CGLSI = type { ptr, i32, ptr, ptr, i32, i32, ptr, ptr, %struct.vv_t, %struct.vv_t, ptr } |
| 6 |
%struct._cgro = type opaque |
| 7 |
%struct.xx_t = type { [3 x %struct.vv_t], [2 x %struct.vv_t], [2 x [3 x ptr]] } |
| 8 |
%struct.vv_t = type { <16 x i8> } |
| 9 |
@llvm.used = appending global [1 x ptr] [ ptr @lb ], section "llvm.metadata" ; <ptr> [#uses=0] |
| 10 |
|
| 11 |
; CHECK: lb |
| 12 |
; CHECK: blr |
| 13 |
define void @lb(ptr %src, i32 %n, ptr %dst) nounwind { |
| 14 |
entry: |
| 15 |
%0 = load i32, ptr null, align 4 ; <i32> [#uses=1] |
| 16 |
%1 = icmp sgt i32 %0, 0 ; <i1> [#uses=1] |
| 17 |
br i1 %1, label %bb.nph4945, label %return |
| 18 |
|
| 19 |
bb.nph4945: ; preds = %entry |
| 20 |
%2 = getelementptr [2 x i64], ptr null, i32 0, i32 1 ; <ptr> [#uses=6] |
| 21 |
%3 = getelementptr [2 x i64], ptr null, i32 0, i32 1 ; <ptr> [#uses=3] |
| 22 |
br label %bb2326 |
| 23 |
|
| 24 |
bb2217: ; preds = %bb2326 |
| 25 |
%4 = or i64 0, 0 ; <i64> [#uses=2] |
| 26 |
%5 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] |
| 27 |
%6 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] |
| 28 |
%7 = getelementptr float, ptr null, i32 2 ; <ptr> [#uses=1] |
| 29 |
%8 = load float, ptr %7, align 4 ; <float> [#uses=1] |
| 30 |
%9 = getelementptr float, ptr null, i32 3 ; <ptr> [#uses=1] |
| 31 |
%10 = load float, ptr %9, align 4 ; <float> [#uses=1] |
| 32 |
%11 = fmul float %8, 6.553500e+04 ; <float> [#uses=1] |
| 33 |
%12 = fadd float %11, 5.000000e-01 ; <float> [#uses=1] |
| 34 |
%13 = fmul float %10, 6.553500e+04 ; <float> [#uses=1] |
| 35 |
%14 = fadd float %13, 5.000000e-01 ; <float> [#uses=3] |
| 36 |
%15 = fcmp olt float %12, 0.000000e+00 ; <i1> [#uses=0] |
| 37 |
%16 = fcmp olt float %14, 0.000000e+00 ; <i1> [#uses=1] |
| 38 |
br i1 %16, label %bb2265, label %bb2262 |
| 39 |
|
| 40 |
bb2262: ; preds = %bb2217 |
| 41 |
%17 = fcmp ogt float %14, 6.553500e+04 ; <i1> [#uses=1] |
| 42 |
br i1 %17, label %bb2264, label %bb2265 |
| 43 |
|
| 44 |
bb2264: ; preds = %bb2262 |
| 45 |
br label %bb2265 |
| 46 |
|
| 47 |
bb2265: ; preds = %bb2264, %bb2262, %bb2217 |
| 48 |
%f3596.0 = phi float [ 6.553500e+04, %bb2264 ], [ 0.000000e+00, %bb2217 ], [ %14, %bb2262 ] ; <float> [#uses=1] |
| 49 |
%18 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] |
| 50 |
%19 = fptosi float %f3596.0 to i32 ; <i32> [#uses=1] |
| 51 |
%20 = zext i32 %5 to i64 ; <i64> [#uses=1] |
| 52 |
%21 = shl i64 %20, 48 ; <i64> [#uses=1] |
| 53 |
%22 = zext i32 %6 to i64 ; <i64> [#uses=1] |
| 54 |
%23 = shl i64 %22, 32 ; <i64> [#uses=1] |
| 55 |
%24 = sext i32 %18 to i64 ; <i64> [#uses=1] |
| 56 |
%25 = shl i64 %24, 16 ; <i64> [#uses=1] |
| 57 |
%26 = sext i32 %19 to i64 ; <i64> [#uses=1] |
| 58 |
%27 = or i64 %23, %21 ; <i64> [#uses=1] |
| 59 |
%28 = or i64 %27, %25 ; <i64> [#uses=1] |
| 60 |
%29 = or i64 %28, %26 ; <i64> [#uses=2] |
| 61 |
%30 = shl i64 %4, 48 ; <i64> [#uses=1] |
| 62 |
%31 = shl i64 %29, 32 ; <i64> [#uses=1] |
| 63 |
%32 = and i64 %31, 281470681743360 ; <i64> [#uses=1] |
| 64 |
store i64 %4, ptr null, align 16 |
| 65 |
store i64 %29, ptr %2, align 8 |
| 66 |
%33 = getelementptr i8, ptr null, i32 0 ; <ptr> [#uses=1] |
| 67 |
%34 = load float, ptr %33, align 4 ; <float> [#uses=1] |
| 68 |
%35 = getelementptr float, ptr %33, i32 1 ; <ptr> [#uses=1] |
| 69 |
%36 = load float, ptr %35, align 4 ; <float> [#uses=1] |
| 70 |
%37 = fmul float %34, 6.553500e+04 ; <float> [#uses=1] |
| 71 |
%38 = fadd float %37, 5.000000e-01 ; <float> [#uses=1] |
| 72 |
%39 = fmul float %36, 6.553500e+04 ; <float> [#uses=1] |
| 73 |
%40 = fadd float %39, 5.000000e-01 ; <float> [#uses=3] |
| 74 |
%41 = fcmp olt float %38, 0.000000e+00 ; <i1> [#uses=0] |
| 75 |
%42 = fcmp olt float %40, 0.000000e+00 ; <i1> [#uses=1] |
| 76 |
br i1 %42, label %bb2277, label %bb2274 |
| 77 |
|
| 78 |
bb2274: ; preds = %bb2265 |
| 79 |
%43 = fcmp ogt float %40, 6.553500e+04 ; <i1> [#uses=0] |
| 80 |
br label %bb2277 |
| 81 |
|
| 82 |
bb2277: ; preds = %bb2274, %bb2265 |
| 83 |
%f1582.0 = phi float [ 0.000000e+00, %bb2265 ], [ %40, %bb2274 ] ; <float> [#uses=1] |
| 84 |
%44 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] |
| 85 |
%45 = fptosi float %f1582.0 to i32 ; <i32> [#uses=1] |
| 86 |
%46 = getelementptr float, ptr %33, i32 2 ; <ptr> [#uses=1] |
| 87 |
%47 = load float, ptr %46, align 4 ; <float> [#uses=1] |
| 88 |
%48 = getelementptr float, ptr %33, i32 3 ; <ptr> [#uses=1] |
| 89 |
%49 = load float, ptr %48, align 4 ; <float> [#uses=1] |
| 90 |
%50 = fmul float %47, 6.553500e+04 ; <float> [#uses=1] |
| 91 |
%51 = fadd float %50, 5.000000e-01 ; <float> [#uses=1] |
| 92 |
%52 = fmul float %49, 6.553500e+04 ; <float> [#uses=1] |
| 93 |
%53 = fadd float %52, 5.000000e-01 ; <float> [#uses=1] |
| 94 |
%54 = fcmp olt float %51, 0.000000e+00 ; <i1> [#uses=0] |
| 95 |
%55 = fcmp olt float %53, 0.000000e+00 ; <i1> [#uses=0] |
| 96 |
%56 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] |
| 97 |
%57 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] |
| 98 |
%58 = zext i32 %44 to i64 ; <i64> [#uses=1] |
| 99 |
%59 = shl i64 %58, 48 ; <i64> [#uses=1] |
| 100 |
%60 = zext i32 %45 to i64 ; <i64> [#uses=1] |
| 101 |
%61 = shl i64 %60, 32 ; <i64> [#uses=1] |
| 102 |
%62 = sext i32 %56 to i64 ; <i64> [#uses=1] |
| 103 |
%63 = shl i64 %62, 16 ; <i64> [#uses=1] |
| 104 |
%64 = sext i32 %57 to i64 ; <i64> [#uses=1] |
| 105 |
%65 = or i64 %61, %59 ; <i64> [#uses=1] |
| 106 |
%66 = or i64 %65, %63 ; <i64> [#uses=1] |
| 107 |
%67 = or i64 %66, %64 ; <i64> [#uses=2] |
| 108 |
%68 = getelementptr i8, ptr null, i32 0 ; <ptr> [#uses=1] |
| 109 |
%69 = load float, ptr %68, align 4 ; <float> [#uses=1] |
| 110 |
%70 = getelementptr float, ptr %68, i32 1 ; <ptr> [#uses=1] |
| 111 |
%71 = load float, ptr %70, align 4 ; <float> [#uses=1] |
| 112 |
%72 = fmul float %69, 6.553500e+04 ; <float> [#uses=1] |
| 113 |
%73 = fadd float %72, 5.000000e-01 ; <float> [#uses=3] |
| 114 |
%74 = fmul float %71, 6.553500e+04 ; <float> [#uses=1] |
| 115 |
%75 = fadd float %74, 5.000000e-01 ; <float> [#uses=1] |
| 116 |
%76 = fcmp olt float %73, 0.000000e+00 ; <i1> [#uses=1] |
| 117 |
br i1 %76, label %bb2295, label %bb2292 |
| 118 |
|
| 119 |
bb2292: ; preds = %bb2277 |
| 120 |
%77 = fcmp ogt float %73, 6.553500e+04 ; <i1> [#uses=1] |
| 121 |
br i1 %77, label %bb2294, label %bb2295 |
| 122 |
|
| 123 |
bb2294: ; preds = %bb2292 |
| 124 |
br label %bb2295 |
| 125 |
|
| 126 |
bb2295: ; preds = %bb2294, %bb2292, %bb2277 |
| 127 |
%f0569.0 = phi float [ 6.553500e+04, %bb2294 ], [ 0.000000e+00, %bb2277 ], [ %73, %bb2292 ] ; <float> [#uses=1] |
| 128 |
%78 = fcmp olt float %75, 0.000000e+00 ; <i1> [#uses=0] |
| 129 |
%79 = fptosi float %f0569.0 to i32 ; <i32> [#uses=1] |
| 130 |
%80 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] |
| 131 |
%81 = getelementptr float, ptr %68, i32 2 ; <ptr> [#uses=1] |
| 132 |
%82 = load float, ptr %81, align 4 ; <float> [#uses=1] |
| 133 |
%83 = getelementptr float, ptr %68, i32 3 ; <ptr> [#uses=1] |
| 134 |
%84 = load float, ptr %83, align 4 ; <float> [#uses=1] |
| 135 |
%85 = fmul float %82, 6.553500e+04 ; <float> [#uses=1] |
| 136 |
%86 = fadd float %85, 5.000000e-01 ; <float> [#uses=1] |
| 137 |
%87 = fmul float %84, 6.553500e+04 ; <float> [#uses=1] |
| 138 |
%88 = fadd float %87, 5.000000e-01 ; <float> [#uses=1] |
| 139 |
%89 = fcmp olt float %86, 0.000000e+00 ; <i1> [#uses=0] |
| 140 |
%90 = fcmp olt float %88, 0.000000e+00 ; <i1> [#uses=0] |
| 141 |
%91 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] |
| 142 |
%92 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] |
| 143 |
%93 = zext i32 %79 to i64 ; <i64> [#uses=1] |
| 144 |
%94 = shl i64 %93, 48 ; <i64> [#uses=1] |
| 145 |
%95 = zext i32 %80 to i64 ; <i64> [#uses=1] |
| 146 |
%96 = shl i64 %95, 32 ; <i64> [#uses=1] |
| 147 |
%97 = sext i32 %91 to i64 ; <i64> [#uses=1] |
| 148 |
%98 = shl i64 %97, 16 ; <i64> [#uses=1] |
| 149 |
%99 = sext i32 %92 to i64 ; <i64> [#uses=1] |
| 150 |
%100 = or i64 %96, %94 ; <i64> [#uses=1] |
| 151 |
%101 = or i64 %100, %98 ; <i64> [#uses=1] |
| 152 |
%102 = or i64 %101, %99 ; <i64> [#uses=2] |
| 153 |
%103 = shl i64 %67, 16 ; <i64> [#uses=1] |
| 154 |
%104 = and i64 %103, 4294901760 ; <i64> [#uses=1] |
| 155 |
%105 = and i64 %102, 65535 ; <i64> [#uses=1] |
| 156 |
%106 = or i64 %32, %30 ; <i64> [#uses=1] |
| 157 |
%107 = or i64 %106, %104 ; <i64> [#uses=1] |
| 158 |
%108 = or i64 %107, %105 ; <i64> [#uses=1] |
| 159 |
store i64 %67, ptr null, align 16 |
| 160 |
store i64 %102, ptr %3, align 8 |
| 161 |
%109 = icmp eq i64 %108, 0 ; <i1> [#uses=1] |
| 162 |
br i1 %109, label %bb2325, label %bb2315 |
| 163 |
|
| 164 |
bb2315: ; preds = %bb2295 |
| 165 |
%110 = icmp eq ptr %155, null ; <i1> [#uses=1] |
| 166 |
br i1 %110, label %bb2318, label %bb2317 |
| 167 |
|
| 168 |
bb2317: ; preds = %bb2315 |
| 169 |
%111 = load i64, ptr null, align 16 ; <i64> [#uses=1] |
| 170 |
%112 = call i32 (...) @_u16a_cm( i64 %111, ptr %155, double 0.000000e+00, double 1.047551e+06 ) nounwind ; <i32> [#uses=1] |
| 171 |
%113 = sext i32 %112 to i64 ; <i64> [#uses=1] |
| 172 |
store i64 %113, ptr null, align 16 |
| 173 |
%114 = load i64, ptr %2, align 8 ; <i64> [#uses=1] |
| 174 |
%115 = call i32 (...) @_u16a_cm( i64 %114, ptr %155, double 0.000000e+00, double 1.047551e+06 ) nounwind ; <i32> [#uses=1] |
| 175 |
%116 = sext i32 %115 to i64 ; <i64> [#uses=1] |
| 176 |
store i64 %116, ptr %2, align 8 |
| 177 |
%117 = load i64, ptr null, align 16 ; <i64> [#uses=1] |
| 178 |
%118 = call i32 (...) @_u16a_cm( i64 %117, ptr %155, double 0.000000e+00, double 1.047551e+06 ) nounwind ; <i32> [#uses=1] |
| 179 |
%119 = sext i32 %118 to i64 ; <i64> [#uses=1] |
| 180 |
store i64 %119, ptr null, align 16 |
| 181 |
%120 = load i64, ptr %3, align 8 ; <i64> [#uses=1] |
| 182 |
%121 = call i32 (...) @_u16a_cm( i64 %120, ptr %155, double 0.000000e+00, double 1.047551e+06 ) nounwind ; <i32> [#uses=0] |
| 183 |
unreachable |
| 184 |
|
| 185 |
bb2318: ; preds = %bb2315 |
| 186 |
%122 = getelementptr %struct.CGLSI, ptr %src, i32 %indvar5021, i32 8 ; <ptr> [#uses=1] |
| 187 |
%123 = load i64, ptr %122, align 8 ; <i64> [#uses=1] |
| 188 |
%124 = trunc i64 %123 to i32 ; <i32> [#uses=4] |
| 189 |
%125 = load i64, ptr null, align 16 ; <i64> [#uses=1] |
| 190 |
%126 = call i32 (...) @_u16_ff( i64 %125, i32 %124 ) nounwind ; <i32> [#uses=1] |
| 191 |
%127 = sext i32 %126 to i64 ; <i64> [#uses=1] |
| 192 |
store i64 %127, ptr null, align 16 |
| 193 |
%128 = load i64, ptr %2, align 8 ; <i64> [#uses=1] |
| 194 |
%129 = call i32 (...) @_u16_ff( i64 %128, i32 %124 ) nounwind ; <i32> [#uses=1] |
| 195 |
%130 = sext i32 %129 to i64 ; <i64> [#uses=1] |
| 196 |
store i64 %130, ptr %2, align 8 |
| 197 |
%131 = load i64, ptr null, align 16 ; <i64> [#uses=1] |
| 198 |
%132 = call i32 (...) @_u16_ff( i64 %131, i32 %124 ) nounwind ; <i32> [#uses=1] |
| 199 |
%133 = sext i32 %132 to i64 ; <i64> [#uses=1] |
| 200 |
store i64 %133, ptr null, align 16 |
| 201 |
%134 = load i64, ptr %3, align 8 ; <i64> [#uses=1] |
| 202 |
%135 = call i32 (...) @_u16_ff( i64 %134, i32 %124 ) nounwind ; <i32> [#uses=0] |
| 203 |
unreachable |
| 204 |
|
| 205 |
bb2319: ; preds = %bb2326 |
| 206 |
%136 = getelementptr %struct.CGLSI, ptr %src, i32 %indvar5021, i32 2 ; <ptr> [#uses=1] |
| 207 |
%137 = load ptr, ptr %136, align 4 ; <ptr> [#uses=4] |
| 208 |
%138 = getelementptr i8, ptr %137, i32 0 ; <ptr> [#uses=1] |
| 209 |
%139 = call i32 (...) @_u16_sf32( double 0.000000e+00, double 6.553500e+04, double 5.000000e-01, ptr %138 ) nounwind ; <i32> [#uses=1] |
| 210 |
%140 = sext i32 %139 to i64 ; <i64> [#uses=2] |
| 211 |
%141 = getelementptr i8, ptr %137, i32 0 ; <ptr> [#uses=1] |
| 212 |
%142 = call i32 (...) @_u16_sf32( double 0.000000e+00, double 6.553500e+04, double 5.000000e-01, ptr %141 ) nounwind ; <i32> [#uses=1] |
| 213 |
%143 = sext i32 %142 to i64 ; <i64> [#uses=2] |
| 214 |
%144 = shl i64 %140, 48 ; <i64> [#uses=0] |
| 215 |
%145 = shl i64 %143, 32 ; <i64> [#uses=1] |
| 216 |
%146 = and i64 %145, 281470681743360 ; <i64> [#uses=0] |
| 217 |
store i64 %140, ptr null, align 16 |
| 218 |
store i64 %143, ptr %2, align 8 |
| 219 |
%147 = getelementptr i8, ptr %137, i32 0 ; <ptr> [#uses=1] |
| 220 |
%148 = call i32 (...) @_u16_sf32( double 0.000000e+00, double 6.553500e+04, double 5.000000e-01, ptr %147 ) nounwind ; <i32> [#uses=1] |
| 221 |
%149 = sext i32 %148 to i64 ; <i64> [#uses=0] |
| 222 |
%150 = getelementptr i8, ptr %137, i32 0 ; <ptr> [#uses=1] |
| 223 |
%151 = call i32 (...) @_u16_sf32( double 0.000000e+00, double 6.553500e+04, double 5.000000e-01, ptr %150 ) nounwind ; <i32> [#uses=0] |
| 224 |
unreachable |
| 225 |
|
| 226 |
bb2325: ; preds = %bb2326, %bb2295 |
| 227 |
%indvar.next5145 = add i32 %indvar5021, 1 ; <i32> [#uses=1] |
| 228 |
br label %bb2326 |
| 229 |
|
| 230 |
bb2326: ; preds = %bb2325, %bb.nph4945 |
| 231 |
%indvar5021 = phi i32 [ 0, %bb.nph4945 ], [ %indvar.next5145, %bb2325 ] ; <i32> [#uses=6] |
| 232 |
%152 = icmp slt i32 %indvar5021, %n ; <i1> [#uses=0] |
| 233 |
%153 = getelementptr %struct.CGLSI, ptr %src, i32 %indvar5021, i32 10 ; <ptr> [#uses=1] |
| 234 |
%154 = load ptr, ptr %153, align 4 ; <ptr> [#uses=5] |
| 235 |
%155 = getelementptr %struct.CGLSI, ptr %src, i32 %indvar5021, i32 1 ; <ptr> [#uses=1] |
| 236 |
%156 = load i32, ptr %155, align 4 ; <i32> [#uses=1] |
| 237 |
%157 = and i32 %156, 255 ; <i32> [#uses=1] |
| 238 |
switch i32 %157, label %bb2325 [ |
| 239 |
i32 59, label %bb2217 |
| 240 |
i32 60, label %bb2319 |
| 241 |
] |
| 242 |
|
| 243 |
return: ; preds = %entry |
| 244 |
ret void |
| 245 |
} |
| 246 |
|
| 247 |
declare i32 @_u16_ff(...) |
| 248 |
|
| 249 |
declare i32 @_u16a_cm(...) |
| 250 |
|
| 251 |
declare i32 @_u16_sf32(...) |