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__pow__32_0_counted_for_0_body(i: bits[32] id=21, __loop_carry: (bits[32], bits[32], bits[32]) id=24) -> (bits[32], bits[32], bits[32]) { tuple_index.26: bits[32] = tuple_index(__loop_carry, index=0, id=26) literal.36: bits[32] = literal(value=1, id=36, pos=[(0,960,29)]) literal.25: bits[1] = literal(value=1, id=25) literal.27: bits[1] = literal(value=1, id=27) literal.44: bits[32] = literal(value=0, id=44, pos=[(0,961,25)]) tuple_index.29: bits[32] = tuple_index(__loop_carry, index=1, id=29) and.37: bits[32] = and(tuple_index.26, literal.36, id=37, pos=[(0,960,25)]) literal.38: bits[32] = literal(value=1, id=38, pos=[(0,960,41)]) tuple_index.32: bits[32] = tuple_index(__loop_carry, index=2, id=32) and.28: bits[1] = and(literal.25, literal.27, id=28) literal.30: bits[1] = literal(value=1, id=30) literal.42: bits[1] = literal(value=1, id=42, pos=[(0,961,14)]) eq.45: bits[1] = eq(tuple_index.26, literal.44, id=45, pos=[(0,961,20)]) umul.46: bits[32] = umul(tuple_index.29, tuple_index.29, id=46, pos=[(0,961,46)]) eq.39: bits[1] = eq(and.37, literal.38, id=39, pos=[(0,960,25)]) umul.40: bits[32] = umul(tuple_index.32, tuple_index.29, id=40, pos=[(0,960,51)]) literal.22: bits[32] = literal(value=0, id=22) and.31: bits[1] = and(and.28, literal.30, id=31) literal.33: bits[1] = literal(value=1, id=33) shrl.43: bits[32] = shrl(tuple_index.26, literal.42, id=43, pos=[(0,961,9)]) sel.47: bits[32] = sel(eq.45, cases=[umul.46, tuple_index.29], id=47, pos=[(0,961,17)]) result: bits[32] = sel(eq.39, cases=[tuple_index.32, umul.40], id=41, pos=[(0,960,21)]) add.23: bits[32] = add(i, literal.22, id=23) and.34: bits[1] = and(and.31, literal.33, id=34) literal.35: bits[32] = literal(value=32, id=35, pos=[(0,955,20)]) ret tuple.48: (bits[32], bits[32], bits[32]) = tuple(shrl.43, sel.47, result, id=48, pos=[(0,961,8)]) } fn __std__pow__32_0(x: bits[32] id=15, n: bits[32] id=16) -> bits[32] { result: bits[32] = literal(value=1, id=19, pos=[(0,956,17)]) tuple.20: (bits[32], bits[32], bits[32]) = tuple(n, x, result, id=20, pos=[(0,962,6)]) work: (bits[32], bits[32], bits[32]) = counted_for(tuple.20, trip_count=32, stride=1, body=____std__pow__32_0_counted_for_0_body, id=49) S: bits[1] = literal(value=0, id=17, pos=[(0,955,11)]) N: bits[32] = literal(value=32, id=18, pos=[(0,955,20)]) literal.50: bits[32] = literal(value=2, id=50, pos=[(0,963,9)]) ret tuple_index.51: bits[32] = tuple_index(work, index=2, id=51, pos=[(0,963,8)]) } fn __std__upow__32(x: bits[32] id=52, n: bits[32] id=53) -> bits[32] { N: bits[32] = literal(value=32, id=54, pos=[(0,966,12)]) ret invoke.55: bits[32] = invoke(x, n, to_apply=__std__pow__32_0, id=55, pos=[(0,966,54)]) } top fn __std__next_pow2(n: bits[32] id=56) -> bits[32] { literal.57: bits[32] = literal(value=2, id=57, pos=[(0,1685,39)]) invoke.58: bits[32] = invoke(n, to_apply=__std__clog2__32, id=58, pos=[(0,1685,51)]) ret invoke.59: bits[32] = invoke(literal.57, invoke.58, to_apply=__std__upow__32, id=59, pos=[(0,1685,38)]) }