Commit bef72cee by apatrick@chromium.org

Fix Float16ToFloat32.py. Issue #376.

Review URL: https://codereview.appspot.com/6651047 git-svn-id: https://angleproject.googlecode.com/svn/trunk@1320 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 778cd1ba
...@@ -56,22 +56,22 @@ namespace gl ...@@ -56,22 +56,22 @@ namespace gl
print "const static unsigned g_mantissa[2048] = {" print "const static unsigned g_mantissa[2048] = {"
for i in range(0, 2048): for i in range(0, 2048):
print " %08x," % convertMantissa(i) print " %#010x," % convertMantissa(i)
print "};\n" print "};\n"
print "const static unsigned g_exponent[64] = {" print "const static unsigned g_exponent[64] = {"
for i in range(0, 64): for i in range(0, 64):
print " %08x," % convertExponent(i) print " %#010x," % convertExponent(i)
print "};\n" print "};\n"
print "const static unsigned g_offset[64] = {" print "const static unsigned g_offset[64] = {"
for i in range(0, 64): for i in range(0, 64):
print " %08x," % convertOffset(i) print " %#010x," % convertOffset(i)
print "};\n" print "};\n"
print """float float16ToFloat32(unsigned short h) print """float float16ToFloat32(unsigned short h)
{ {
unsigned i32 = =g_mantissa[g_offset[h >> 10] + (h & 0x3ff)] + g_exponent[h >> 10]; unsigned i32 = g_mantissa[g_offset[h >> 10] + (h & 0x3ff)] + g_exponent[h >> 10];
return *(float*) &i32; return *(float*) &i32;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment