hypercubestart commented on a change in pull request #5812:
URL: https://github.com/apache/incubator-tvm/pull/5812#discussion_r471021852
##########
File path: python/tvm/target/datatype.py
##########
@@ -134,10 +152,33 @@ def lower(op):
dtype = "uint" + str(t.bits)
if t.lanes > 1:
dtype += "x" + str(t.lanes)
- if isinstance(op, (_Cast, _FloatImm)):
- return _Call(dtype, extern_func_name, convert([op.value]),
+ if isinstance(op, _Cast):
+ src_bits = bit_length(op.value.dtype)
+ return _Call(dtype, extern_func_map[(src_bits, t.bits)],
convert([op.value]),
+ _Call.Extern)
+ elif isinstance(op, _FloatImm):
+ return _Call(dtype, extern_func_map[t.bits], convert([op.value]),
_Call.Extern)
- return _Call(dtype, extern_func_name, convert([op.a, op.b]),
+ elif isinstance(op, _Call) and (op.call_type == _Call.Intrinsic or
+ op.call_type == _Call.PureIntrinsic):
+ return _Call(dtype, extern_func_map[t.bits], convert(op.args),
+ _Call.Extern)
+ return _Call(dtype, extern_func_map[t.bits], convert([op.a, op.b]),
Review comment:
all unary ops are intrinsics
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]