code: def promote_uint8(f8_dtype: str, promote_dtype: str, v):
      if f8_dtype == "e4m3_float8":
          if promote_dtype == "float16":
              mantissa = T.bitwise_and(
                  T.shift_left(T.Cast("uint16", v), T.uint16(7)),
                  T.uint16(0x3FF),
              )
              exponent = T.shift_left(
                  T.Cast(
                      "uint16",
                      T.shift_right(
                          T.shift_left(v, T.uint8(1)), T.uint8(4)
                      )
                      + T.uint8(8),
                  ),
                  T.uint16(10),
              )
              sign = T.shift_left(
                  T.Cast("uint16", T.shift_right(v, T.uint8(7))),
                  T.uint16(15),
              )
              return T.reinterpret(
                  "float16",
                  T.bitwise_or(T.bitwise_or(mantissa, exponent), sign),
              )
          else:  # promote_dtype == "float32"
              mantissa = T.bitwise_and(
                  T.shift_left(T.Cast("uint32", v), T.uint32(20)),
                  T.uint32(0x7FFFFF),
              )
              exponent = T.shift_left(
                  T.Cast(
                      "uint32",
                      T.shift_right(
                          T.shift_left(v, T.uint8(1)), T.uint8(4)
                      )
                      + T.uint8(120),
                  ),
                  T.uint32(23),
              )
              sign = T.shift_left(
                  T.Cast("uint32", T.shift_right(v, T.uint8(7))),
                  T.uint32(31),
              )
              return T.reinterpret(
                  "float32",
                  T.bitwise_or(T.bitwise_or(mantissa, exponent), sign),
              )
      else:  # f8_dtype == "e5m2_float8"
          if promote_dtype == "float16":
              return T.reinterpret(
                  "float16",
                  T.shift_left(T.Cast("uint16", v), T.uint16(8)),
              )
          else:  # promote_dtype == "float32"
              mantissa = T.bitwise_and(
                  T.shift_left(T.Cast("uint32", v), T.uint32(21)),
                  T.uint32(0x7FFFFF),
              )
              exponent = T.shift_left(
                  T.Cast(
                      "uint32",
                      T.shift_right(
                          T.shift_left(v, T.uint8(1)), T.uint8(3)
                      )
                      + T.uint8(112),
                  ),
                  T.uint32(23),
              )
              sign = T.shift_left(
                  T.Cast("uint32", T.shift_right(v, T.uint8(7))),
                  T.uint32(31),
              )
              return T.reinterpret(
                  "float32",
                  T.bitwise_or(T.bitwise_or(mantissa, exponent), sign),
              )
  
file_path: tvm/tests/python/tir-transform/test_tir_transform_fp8_legalize.py
imports: import tvm
  import tvm.script
  import tvm.testing
  from tvm.script import tir
label_desc: Use image node_id 5 for calling a global function with example usage: promote_uint8(f8_dtype, promote_dtype, v) and returns: T, T, T, T