package float64 file_number 0 "/inputs/subtree/xls/dslx/stdlib/apfloat.x" file_number 1 "/inputs/subtree/xls/dslx/stdlib/std.x" file_number 2 "/inputs/subtree/xls/dslx/stdlib/float64.x" fn __apfloat__is_zero_or_subnormal__11_52(x: (bits[1], bits[11], bits[52]) id=1) -> bits[1] { x_bexp: bits[11] = tuple_index(x, index=1, id=4, pos=[(0,804,5)]) literal.5: bits[11] = literal(value=0, id=5, pos=[(0,804,14)]) EXP_SZ: bits[32] = literal(value=11, id=2, pos=[(0,802,28)]) FRACTION_SZ: bits[32] = literal(value=52, id=3, pos=[(0,802,41)]) ret eq.6: bits[1] = eq(x_bexp, literal.5, id=6, pos=[(0,804,5)]) } fn __apfloat__zero__11_52(sign: bits[1] id=7) -> (bits[1], bits[11], bits[52]) { literal.10: bits[11] = literal(value=0, id=10, pos=[(0,131,47)]) literal.11: bits[52] = literal(value=0, id=11, pos=[(0,131,73)]) EXP_SZ: bits[32] = literal(value=11, id=8, pos=[(0,130,12)]) FRACTION_SZ: bits[32] = literal(value=52, id=9, pos=[(0,130,25)]) ret tuple.12: (bits[1], bits[11], bits[52]) = tuple(sign, literal.10, literal.11, id=12, pos=[(0,131,33)]) } fn __apfloat__subnormals_to_zero__11_52(x: (bits[1], bits[11], bits[52]) id=13) -> (bits[1], bits[11], bits[52]) { x_sign: bits[1] = tuple_index(x, index=0, id=17, pos=[(0,809,60)]) invoke.16: bits[1] = invoke(x, to_apply=__apfloat__is_zero_or_subnormal__11_52, id=16, pos=[(0,809,27)]) invoke.18: (bits[1], bits[11], bits[52]) = invoke(x_sign, to_apply=__apfloat__zero__11_52, id=18, pos=[(0,809,37)]) EXP_SZ: bits[32] = literal(value=11, id=14, pos=[(0,807,26)]) FRACTION_SZ: bits[32] = literal(value=52, id=15, pos=[(0,807,39)]) ret sel.19: (bits[1], bits[11], bits[52]) = sel(invoke.16, cases=[x, invoke.18], id=19, pos=[(0,809,4)]) } fn __std__mask_bits__11() -> bits[11] { literal.21: bits[11] = literal(value=0, id=21, pos=[(1,835,41)]) X: bits[32] = literal(value=11, id=20, pos=[(1,835,17)]) ret not.22: bits[11] = not(literal.21, id=22, pos=[(1,835,40)]) } fn __apfloat__tag__11_52(input_float: (bits[1], bits[11], bits[52]) id=23) -> bits[3] { input_float_bexp: bits[11] = tuple_index(input_float, index=1, id=27, pos=[(0,40,22)]) input_float_fraction: bits[52] = tuple_index(input_float, index=2, id=28, pos=[(0,40,40)]) tuple.29: (bits[11], bits[52]) = tuple(input_float_bexp, input_float_fraction, id=29, pos=[(0,40,10)]) EXPR_MASK: bits[11] = invoke(to_apply=__std__mask_bits__11, id=26, pos=[(0,39,36)]) tuple_index.59: bits[11] = tuple_index(tuple.29, index=0, id=59) tuple_index.50: bits[11] = tuple_index(tuple.29, index=0, id=50) literal.42: bits[11] = literal(value=0, id=42, pos=[(0,42,9)]) tuple_index.41: bits[11] = tuple_index(tuple.29, index=0, id=41) literal.32: bits[11] = literal(value=0, id=32, pos=[(0,41,9)]) tuple_index.31: bits[11] = tuple_index(tuple.29, index=0, id=31) literal.58: bits[1] = literal(value=1, id=58) eq.60: bits[1] = eq(EXPR_MASK, tuple_index.59, id=60) literal.49: bits[1] = literal(value=1, id=49) eq.51: bits[1] = eq(EXPR_MASK, tuple_index.50, id=51) literal.54: bits[52] = literal(value=0, id=54, pos=[(0,43,20)]) tuple_index.53: bits[52] = tuple_index(tuple.29, index=1, id=53) literal.40: bits[1] = literal(value=1, id=40) eq.43: bits[1] = eq(literal.42, tuple_index.41, id=43) literal.30: bits[1] = literal(value=1, id=30) eq.33: bits[1] = eq(literal.32, tuple_index.31, id=33) literal.36: bits[52] = literal(value=0, id=36, pos=[(0,41,23)]) tuple_index.35: bits[52] = tuple_index(tuple.29, index=1, id=35) and.61: bits[1] = and(literal.58, eq.60, id=61) literal.63: bits[1] = literal(value=1, id=63, pos=[(0,44,20)]) and.52: bits[1] = and(literal.49, eq.51, id=52) eq.55: bits[1] = eq(literal.54, tuple_index.53, id=55) and.44: bits[1] = and(literal.40, eq.43, id=44) literal.46: bits[1] = literal(value=1, id=46, pos=[(0,42,23)]) and.34: bits[1] = and(literal.30, eq.33, id=34) eq.37: bits[1] = eq(literal.36, tuple_index.35, id=37) literal.66: bits[1] = literal(value=1, id=66) literal.68: bits[1] = literal(value=1, id=68, pos=[(0,45,9)]) and.64: bits[1] = and(and.61, literal.63, id=64) and.56: bits[1] = and(and.52, eq.55, id=56) and.47: bits[1] = and(and.44, literal.46, id=47) and.38: bits[1] = and(and.34, eq.37, id=38) and.69: bits[1] = and(literal.66, literal.68, id=69) literal.71: bits[1] = literal(value=1, id=71, pos=[(0,45,12)]) concat.74: bits[4] = concat(and.64, and.56, and.47, and.38, id=74) literal.39: bits[3] = literal(value=3, id=39, pos=[(0,41,45)]) literal.48: bits[3] = literal(value=2, id=48, pos=[(0,42,29)]) literal.57: bits[3] = literal(value=1, id=57, pos=[(0,43,42)]) literal.65: bits[3] = literal(value=0, id=65, pos=[(0,44,26)]) literal.73: bits[3] = literal(value=4, id=73, pos=[(0,45,18)]) EXP_SZ: bits[32] = literal(value=11, id=24, pos=[(0,38,11)]) FRACTION_SZ: bits[32] = literal(value=52, id=25, pos=[(0,38,24)]) tuple_index.45: bits[52] = tuple_index(tuple.29, index=1, id=45) tuple_index.62: bits[52] = tuple_index(tuple.29, index=1, id=62) tuple_index.67: bits[11] = tuple_index(tuple.29, index=0, id=67) tuple_index.70: bits[52] = tuple_index(tuple.29, index=1, id=70) and.72: bits[1] = and(and.69, literal.71, id=72) ret priority_sel.75: bits[3] = priority_sel(concat.74, cases=[literal.39, literal.48, literal.57, literal.65], default=literal.73, id=75) } fn __apfloat__qnan__11_52() -> (bits[1], bits[11], bits[52]) { FRACTION_SZ: bits[32] = literal(value=52, id=77, pos=[(0,50,25)]) literal.82: bits[32] = literal(value=1, id=82, pos=[(0,54,57)]) sub.83: bits[32] = sub(FRACTION_SZ, literal.82, id=83, pos=[(0,54,43)]) invoke.79: bits[11] = invoke(to_apply=__std__mask_bits__11, id=79, pos=[(0,53,28)]) literal.81: bits[52] = literal(value=1, id=81, pos=[(0,54,18)]) zero_ext.84: bits[52] = zero_ext(sub.83, new_bit_count=52, id=84) literal.78: bits[1] = literal(value=0, id=78, pos=[(0,52,14)]) zero_ext.80: bits[11] = zero_ext(invoke.79, new_bit_count=11, id=80) shll.85: bits[52] = shll(literal.81, zero_ext.84, id=85, pos=[(0,54,18)]) EXP_SZ: bits[32] = literal(value=11, id=76, pos=[(0,50,12)]) ret tuple.86: (bits[1], bits[11], bits[52]) = tuple(literal.78, zero_ext.80, shll.85, id=86, pos=[(0,51,33)]) } fn __apfloat__inf__11_52(sign: bits[1] id=87) -> (bits[1], bits[11], bits[52]) { invoke.90: bits[11] = invoke(to_apply=__std__mask_bits__11, id=90, pos=[(0,78,28)]) literal.91: bits[52] = literal(value=0, id=91, pos=[(0,79,18)]) EXP_SZ: bits[32] = literal(value=11, id=88, pos=[(0,75,11)]) FRACTION_SZ: bits[32] = literal(value=52, id=89, pos=[(0,75,24)]) ret tuple.92: (bits[1], bits[11], bits[52]) = tuple(sign, invoke.90, literal.91, id=92, pos=[(0,76,33)]) } fn __std__signed_max_value__11_10() -> bits[11] { literal.95: bits[11] = literal(value=1, id=95, pos=[(1,47,6)]) N_MINUS_ONE: bits[32] = literal(value=10, id=94, pos=[(1,46,32)]) shll.96: bits[11] = shll(literal.95, N_MINUS_ONE, id=96, pos=[(1,47,6)]) literal.97: bits[11] = literal(value=1, id=97, pos=[(1,47,32)]) sub.98: bits[11] = sub(shll.96, literal.97, id=98, pos=[(1,47,6)]) N: bits[32] = literal(value=11, id=93, pos=[(1,46,24)]) ret sign_ext.99: bits[11] = sign_ext(sub.98, new_bit_count=11, id=99) } fn __apfloat__bias__11(unbiased_exponent: bits[11] id=100) -> bits[11] { BIAS: bits[11] = invoke(to_apply=__std__signed_max_value__11_10, id=102, pos=[(0,343,38)]) add.103: bits[11] = add(unbiased_exponent, BIAS, id=103, pos=[(0,344,5)]) EXP_SZ: bits[32] = literal(value=11, id=101, pos=[(0,342,12)]) ret sign_ext.104: bits[11] = sign_ext(add.103, new_bit_count=11, id=104) } fn __apfloat__has_fractional_part__11_52(f: (bits[1], bits[11], bits[52]) id=105) -> bits[1] { FRACTION_SZ: bits[32] = literal(value=52, id=107, pos=[(0,4191,40)]) bit_slice.109: bits[11] = bit_slice(FRACTION_SZ, start=0, width=11, id=109) f_bexp: bits[11] = tuple_index(f, index=1, id=108, pos=[(0,4192,5)]) invoke.110: bits[11] = invoke(bit_slice.109, to_apply=__apfloat__bias__11, id=110, pos=[(0,4192,17)]) EXP_SZ: bits[32] = literal(value=11, id=106, pos=[(0,4191,27)]) ret ult.111: bits[1] = ult(f_bexp, invoke.110, id=111, pos=[(0,4192,5)]) } fn __apfloat__has_negative_exponent__11_52(f: (bits[1], bits[11], bits[52]) id=112) -> bits[1] { literal.116: bits[11] = literal(value=0, id=116, pos=[(0,4219,18)]) f_bexp: bits[11] = tuple_index(f, index=1, id=115, pos=[(0,4219,5)]) invoke.117: bits[11] = invoke(literal.116, to_apply=__apfloat__bias__11, id=117, pos=[(0,4219,17)]) EXP_SZ: bits[32] = literal(value=11, id=113, pos=[(0,4217,29)]) FRACTION_SZ: bits[32] = literal(value=52, id=114, pos=[(0,4217,42)]) ret ult.118: bits[1] = ult(f_bexp, invoke.117, id=118, pos=[(0,4219,5)]) } fn __std__mask_bits__10() -> bits[10] { literal.120: bits[10] = literal(value=0, id=120, pos=[(1,835,41)]) X: bits[32] = literal(value=10, id=119, pos=[(1,835,17)]) ret not.121: bits[10] = not(literal.120, id=121, pos=[(1,835,40)]) } fn __apfloat__one__11_52(sign: bits[1] id=122) -> (bits[1], bits[11], bits[52]) { invoke.127: bits[10] = invoke(to_apply=__std__mask_bits__10, id=127, pos=[(0,150,28)]) EXP_SZ: bits[32] = literal(value=11, id=123, pos=[(0,146,11)]) literal.125: bits[32] = literal(value=1, id=125, pos=[(0,147,34)]) zero_ext.128: bits[11] = zero_ext(invoke.127, new_bit_count=11, id=128) literal.129: bits[52] = literal(value=0, id=129, pos=[(0,151,18)]) FRACTION_SZ: bits[32] = literal(value=52, id=124, pos=[(0,146,24)]) MASK_SZ: bits[32] = sub(EXP_SZ, literal.125, id=126, pos=[(0,147,25)]) ret tuple.130: (bits[1], bits[11], bits[52]) = tuple(sign, zero_ext.128, literal.129, id=130, pos=[(0,148,33)]) } fn __apfloat__exponent_bias__11_52(f: (bits[1], bits[11], bits[52]) id=131) -> bits[11] { invoke.134: bits[11] = invoke(to_apply=__std__signed_max_value__11_10, id=134, pos=[(0,221,25)]) EXP_SZ: bits[32] = literal(value=11, id=132, pos=[(0,220,21)]) FRACTION_SZ: bits[32] = literal(value=52, id=133, pos=[(0,220,34)]) ret sign_ext.135: bits[11] = sign_ext(invoke.134, new_bit_count=11, id=135) } fn __apfloat__unbiased_exponent__11_52(f: (bits[1], bits[11], bits[52]) id=136) -> bits[11] { f_bexp: bits[11] = tuple_index(f, index=1, id=140, pos=[(0,266,6)]) zero_ext.141: bits[11] = zero_ext(f_bexp, new_bit_count=11, id=141) bias: bits[11] = invoke(f, to_apply=__apfloat__exponent_bias__11_52, id=139, pos=[(0,265,28)]) EXP_SZ: bits[32] = literal(value=11, id=137, pos=[(0,263,25)]) FRACTION_SZ: bits[32] = literal(value=52, id=138, pos=[(0,263,38)]) ret sub.142: bits[11] = sub(zero_ext.141, bias, id=142, pos=[(0,266,6)]) } fn __std__mask_bits__52() -> bits[52] { literal.144: bits[52] = literal(value=0, id=144, pos=[(1,835,41)]) X: bits[32] = literal(value=52, id=143, pos=[(1,835,17)]) ret not.145: bits[52] = not(literal.144, id=145, pos=[(1,835,40)]) } fn __apfloat__round_up_no_sign_positive_exp__11_52(f: (bits[1], bits[11], bits[52]) id=146) -> (bits[1], bits[11], bits[52]) { exp: bits[11] = invoke(f, to_apply=__apfloat__unbiased_exponent__11_52, id=149, pos=[(0,4238,31)]) invoke.150: bits[52] = invoke(to_apply=__std__mask_bits__52, id=150, pos=[(0,4240,40)]) sign_ext.151: bits[32] = sign_ext(exp, new_bit_count=32, id=151) f_fraction: bits[52] = tuple_index(f, index=2, id=153, pos=[(0,4259,9)]) fractional_mask: bits[52] = shrl(invoke.150, sign_ext.151, id=152, pos=[(0,4240,40)]) zero_ext.154: bits[53] = zero_ext(f_fraction, new_bit_count=53, id=154) zero_ext.155: bits[53] = zero_ext(fractional_mask, new_bit_count=53, id=155) fraction_up: bits[53] = add(zero_ext.154, zero_ext.155, id=156, pos=[(0,4259,9)]) FRACTION_SZ: bits[32] = literal(value=52, id=148, pos=[(0,4235,46)]) dynamic_bit_slice.158: bits[1] = dynamic_bit_slice(fraction_up, FRACTION_SZ, width=1, id=158, pos=[(0,4262,46)]) literal.161: bits[53] = literal(value=0, id=161, pos=[(0,4264,40)]) f_bexp: bits[11] = tuple_index(f, index=1, id=157, pos=[(0,4262,27)]) zero_ext.159: bits[11] = zero_ext(dynamic_bit_slice.158, new_bit_count=11, id=159) dynamic_bit_slice.162: bits[52] = dynamic_bit_slice(fraction_up, literal.161, width=52, id=162, pos=[(0,4264,39)]) not.163: bits[52] = not(fractional_mask, id=163, pos=[(0,4264,62)]) f_sign: bits[1] = tuple_index(f, index=0, id=165, pos=[(0,4265,21)]) bexp_with_carry: bits[11] = add(f_bexp, zero_ext.159, id=160, pos=[(0,4262,27)]) fraction_integral: bits[52] = and(dynamic_bit_slice.162, not.163, id=164, pos=[(0,4264,39)]) EXP_SZ: bits[32] = literal(value=11, id=147, pos=[(0,4235,33)]) ret tuple.166: (bits[1], bits[11], bits[52]) = tuple(f_sign, bexp_with_carry, fraction_integral, id=166, pos=[(0,4265,12)]) } fn __apfloat__round_down_no_sign_positive_exp__11_52(f: (bits[1], bits[11], bits[52]) id=167) -> (bits[1], bits[11], bits[52]) { exp: bits[11] = invoke(f, to_apply=__apfloat__unbiased_exponent__11_52, id=170, pos=[(0,4272,31)]) invoke.171: bits[52] = invoke(to_apply=__std__mask_bits__52, id=171, pos=[(0,4274,40)]) sign_ext.172: bits[32] = sign_ext(exp, new_bit_count=32, id=172) fractional_mask: bits[52] = shrl(invoke.171, sign_ext.172, id=173, pos=[(0,4274,40)]) f_fraction: bits[52] = tuple_index(f, index=2, id=174, pos=[(0,4276,29)]) not.175: bits[52] = not(fractional_mask, id=175, pos=[(0,4276,41)]) f_sign: bits[1] = tuple_index(f, index=0, id=177, pos=[(0,4277,21)]) f_bexp: bits[11] = tuple_index(f, index=1, id=178, pos=[(0,4277,35)]) fraction_integral: bits[52] = and(f_fraction, not.175, id=176, pos=[(0,4276,29)]) EXP_SZ: bits[32] = literal(value=11, id=168, pos=[(0,4269,35)]) FRACTION_SZ: bits[32] = literal(value=52, id=169, pos=[(0,4269,48)]) ret tuple.179: (bits[1], bits[11], bits[52]) = tuple(f_sign, f_bexp, fraction_integral, id=179, pos=[(0,4277,12)]) } fn __apfloat__floor_with_denorms__11_52(f: (bits[1], bits[11], bits[52]) id=180) -> (bits[1], bits[11], bits[52]) { f_sign__3: bits[1] = tuple_index(f, index=0, id=207, pos=[(0,4507,23)]) literal.208: bits[1] = literal(value=1, id=208, pos=[(0,4507,32)]) f_sign__2: bits[1] = tuple_index(f, index=0, id=199, pos=[(0,4500,20)]) literal.200: bits[1] = literal(value=0, id=200, pos=[(0,4500,29)]) literal.204: bits[1] = literal(value=0, id=204, pos=[(0,4505,46)]) literal.202: bits[1] = literal(value=1, id=202, pos=[(0,4502,45)]) eq.209: bits[1] = eq(f_sign__3, literal.208, id=209, pos=[(0,4507,23)]) invoke.211: (bits[1], bits[11], bits[52]) = invoke(f, to_apply=__apfloat__round_down_no_sign_positive_exp__11_52, id=211, pos=[(0,4512,47)]) invoke.210: (bits[1], bits[11], bits[52]) = invoke(f, to_apply=__apfloat__round_up_no_sign_positive_exp__11_52, id=210, pos=[(0,4509,45)]) ne.201: bits[1] = ne(f_sign__2, literal.200, id=201, pos=[(0,4500,20)]) invoke.205: (bits[1], bits[11], bits[52]) = invoke(literal.204, to_apply=__apfloat__zero__11_52, id=205, pos=[(0,4505,24)]) invoke.203: (bits[1], bits[11], bits[52]) = invoke(literal.202, to_apply=__apfloat__one__11_52, id=203, pos=[(0,4502,23)]) literal.191: bits[3] = literal(value=3, id=191, pos=[(0,4495,8)]) invoke.183: bits[3] = invoke(f, to_apply=__apfloat__tag__11_52, id=183, pos=[(0,4492,13)]) literal.187: bits[3] = literal(value=1, id=187, pos=[(0,4494,8)]) literal.184: bits[3] = literal(value=0, id=184, pos=[(0,4493,8)]) invoke.196: bits[1] = invoke(f, to_apply=__apfloat__has_fractional_part__11_52, id=196, pos=[(0,4497,35)]) invoke.198: bits[1] = invoke(f, to_apply=__apfloat__has_negative_exponent__11_52, id=198, pos=[(0,4499,43)]) sel.212: (bits[1], bits[11], bits[52]) = sel(eq.209, cases=[invoke.211, invoke.210], id=212, pos=[(0,4507,19)]) sel.206: (bits[1], bits[11], bits[52]) = sel(ne.201, cases=[invoke.205, invoke.203], id=206, pos=[(0,4500,16)]) eq.192: bits[1] = eq(literal.191, invoke.183, id=192) eq.188: bits[1] = eq(literal.187, invoke.183, id=188) eq.185: bits[1] = eq(literal.184, invoke.183, id=185) f_sign: bits[1] = tuple_index(f, index=0, id=189, pos=[(0,4494,58)]) f_sign__1: bits[1] = tuple_index(f, index=0, id=193, pos=[(0,4495,55)]) not.197: bits[1] = not(invoke.196, id=197, pos=[(0,4497,15)]) sel.213: (bits[1], bits[11], bits[52]) = sel(invoke.198, cases=[sel.212, sel.206], id=213, pos=[(0,4499,19)]) concat.215: bits[3] = concat(eq.192, eq.188, eq.185, id=215) invoke.186: (bits[1], bits[11], bits[52]) = invoke(to_apply=__apfloat__qnan__11_52, id=186, pos=[(0,4493,31)]) invoke.190: (bits[1], bits[11], bits[52]) = invoke(f_sign, to_apply=__apfloat__inf__11_52, id=190, pos=[(0,4494,35)]) invoke.194: (bits[1], bits[11], bits[52]) = invoke(f_sign__1, to_apply=__apfloat__zero__11_52, id=194, pos=[(0,4495,32)]) sel.214: (bits[1], bits[11], bits[52]) = sel(not.197, cases=[sel.213, f], id=214, pos=[(0,4497,12)]) EXP_SZ: bits[32] = literal(value=11, id=181, pos=[(0,4489,26)]) FRACTION_SZ: bits[32] = literal(value=52, id=182, pos=[(0,4489,39)]) literal.195: bits[1] = literal(value=1, id=195, pos=[(0,4496,8)]) ret priority_sel.216: (bits[1], bits[11], bits[52]) = priority_sel(concat.215, cases=[invoke.186, invoke.190, invoke.194], default=sel.214, id=216) } fn __apfloat__floor_daz__11_52(f: (bits[1], bits[11], bits[52]) id=217) -> (bits[1], bits[11], bits[52]) { invoke.220: (bits[1], bits[11], bits[52]) = invoke(f, to_apply=__apfloat__subnormals_to_zero__11_52, id=220, pos=[(0,4604,41)]) EXP_SZ: bits[32] = literal(value=11, id=218, pos=[(0,4602,17)]) FRACTION_SZ: bits[32] = literal(value=52, id=219, pos=[(0,4602,30)]) ret invoke.221: (bits[1], bits[11], bits[52]) = invoke(invoke.220, to_apply=__apfloat__floor_with_denorms__11_52, id=221, pos=[(0,4604,22)]) } top fn __float64__floor_daz(f: (bits[1], bits[11], bits[52]) id=222) -> (bits[1], bits[11], bits[52]) { ret invoke.223: (bits[1], bits[11], bits[52]) = invoke(f, to_apply=__apfloat__floor_daz__11_52, id=223, pos=[(2,184,52)]) }