This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> | |
<Type Name="half"> | |
<DisplayString Condition = "fp16.Exponent == 0">{(0.00006103515625f * fp16.Mantissa/1024.0f)}</DisplayString> | |
<DisplayString Condition = "fp16.Exponent == 31 && fp16.Mantissa == 0">{fp16.Sign*-2+1}.#INFINITY</DisplayString> | |
<DisplayString Condition = "fp16.Exponent == 31">#NaN</DisplayString> | |
<DisplayString Condition = "fp16.Exponent < 15">{1.0f / (1 << (15 - fp16.Exponent)) * (fp16.Sign*-2+1.0f) * (1.0f + fp16.Mantissa/1024.0f)}</DisplayString> | |
<DisplayString Condition = "fp16.Exponent > 15">{(1 << (fp16.Exponent-15)) * (fp16.Sign*-2+1.0f) * (1.0f + fp16.Mantissa/1024.0f)}</DisplayString> | |
<DisplayString>{(fp16.Sign*-2+1) * 1.0f + fp16.Mantissa/1024.0f}</DisplayString> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lldb | |
# FP16 summary | |
def summary_FP16( valobj, internal_dict ): | |
anon = valobj.GetChildAtIndex(1) | |
m = anon.GetChildAtIndex(0).GetValueAsUnsigned() | |
e = anon.GetChildAtIndex(1).GetValueAsUnsigned() | |
s = anon.GetChildAtIndex(2).GetValueAsUnsigned() | |
if e == 0: | |
summary = "" if s == 0 else "-" |