package std file_number 0 "/inputs/subtree/xls/dslx/stdlib/std.x" fn __std__clog2__32(x: bits[32] id=1) -> bits[32] { literal.6: bits[32] = literal(value=1, id=6, pos=[(0,716,49)]) sub.7: bits[32] = sub(x, literal.6, id=7, pos=[(0,716,45)]) reverse.8: bits[32] = reverse(sub.7, id=8, pos=[(0,716,44)]) one_hot.9: bits[33] = one_hot(reverse.8, lsb_prio=true, id=9, pos=[(0,716,44)]) N: bits[32] = literal(value=32, id=2, pos=[(0,715,13)]) encode.10: bits[6] = encode(one_hot.9, id=10, pos=[(0,716,44)]) literal.3: bits[32] = literal(value=1, id=3, pos=[(0,716,12)]) zero_ext.5: bits[32] = zero_ext(N, new_bit_count=32, id=5) zero_ext.11: bits[32] = zero_ext(encode.10, new_bit_count=32, id=11, pos=[(0,716,44)]) uge.4: bits[1] = uge(x, literal.3, id=4, pos=[(0,716,7)]) literal.13: bits[32] = literal(value=0, id=13, pos=[(0,716,69)]) sub.12: bits[32] = sub(zero_ext.5, zero_ext.11, id=12, pos=[(0,716,25)]) ret sel.14: bits[32] = sel(uge.4, cases=[literal.13, sub.12], id=14, pos=[(0,716,4)]) } fn ____std__upow__32_counted_for_0_body(i: bits[32] id=20, __loop_carry: (bits[32], bits[32], bits[32]) id=23) -> (bits[32], bits[32], bits[32]) { tuple_index.25: bits[32] = tuple_index(__loop_carry, index=0, id=25) literal.35: bits[32] = literal(value=1, id=35, pos=[(0,960,29)]) literal.24: bits[1] = literal(value=1, id=24) literal.26: bits[1] = literal(value=1, id=26) and.36: bits[32] = and(tuple_index.25, literal.35, id=36, pos=[(0,960,25)]) literal.37: bits[32] = literal(value=1, id=37, pos=[(0,960,41)]) tuple_index.31: bits[32] = tuple_index(__loop_carry, index=2, id=31) tuple_index.28: bits[32] = tuple_index(__loop_carry, index=1, id=28) and.27: bits[1] = and(literal.24, literal.26, id=27) literal.29: bits[1] = literal(value=1, id=29) literal.41: bits[1] = literal(value=1, id=41, pos=[(0,962,14)]) eq.38: bits[1] = eq(and.36, literal.37, id=38, pos=[(0,960,25)]) umul.39: bits[32] = umul(tuple_index.31, tuple_index.28, id=39, pos=[(0,960,51)]) literal.21: bits[32] = literal(value=0, id=21) and.30: bits[1] = and(and.27, literal.29, id=30) literal.32: bits[1] = literal(value=1, id=32) shrl.42: bits[32] = shrl(tuple_index.25, literal.41, id=42, pos=[(0,962,9)]) umul.43: bits[32] = umul(tuple_index.28, tuple_index.28, id=43, pos=[(0,962,17)]) result: bits[32] = sel(eq.38, cases=[tuple_index.31, umul.39], id=40, pos=[(0,960,21)]) add.22: bits[32] = add(i, literal.21, id=22) and.33: bits[1] = and(and.30, literal.32, id=33) literal.34: bits[32] = literal(value=32, id=34, pos=[(0,955,12)]) ret tuple.44: (bits[32], bits[32], bits[32]) = tuple(shrl.42, umul.43, result, id=44, pos=[(0,962,8)]) } fn __std__upow__32(x: bits[32] id=15, n: bits[32] id=16) -> bits[32] { result: bits[32] = literal(value=1, id=18, pos=[(0,956,17)]) tuple.19: (bits[32], bits[32], bits[32]) = tuple(n, x, result, id=19, pos=[(0,963,6)]) work: (bits[32], bits[32], bits[32]) = counted_for(tuple.19, trip_count=32, stride=1, body=____std__upow__32_counted_for_0_body, id=45) N: bits[32] = literal(value=32, id=17, pos=[(0,955,12)]) literal.46: bits[32] = literal(value=2, id=46, pos=[(0,964,9)]) ret tuple_index.47: bits[32] = tuple_index(work, index=2, id=47, pos=[(0,964,8)]) } top fn __std__next_pow2(n: bits[32] id=48) -> bits[32] { literal.49: bits[32] = literal(value=2, id=49, pos=[(0,1680,39)]) invoke.50: bits[32] = invoke(n, to_apply=__std__clog2__32, id=50, pos=[(0,1680,51)]) ret invoke.51: bits[32] = invoke(literal.49, invoke.50, to_apply=__std__upow__32, id=51, pos=[(0,1680,38)]) }