From 9a837fe2dd7963f0433a17cb04bf567242220216 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Sat, 4 Jan 2020 18:14:02 +0100 Subject: [PATCH] Zero-extend UFLOAT operand first Otherwise, int2float would consider the MSB a sign. --- data/languages/xtensaInstructions.sinc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/languages/xtensaInstructions.sinc b/data/languages/xtensaInstructions.sinc index 33a2202..c0e3f93 100644 --- a/data/languages/xtensaInstructions.sinc +++ b/data/languages/xtensaInstructions.sinc @@ -1202,9 +1202,10 @@ macro extract_bit(val, bit, result) { br = nan(fs) || nan(ft) || fs f== ft; } -# UFLOAT.S - Convert Unsigned Fixed to Single, pg. 550. XXX: How is this different from float.as? +# UFLOAT.S - Convert Unsigned Fixed to Single, pg. 550. :ufloat.s fr, as, u4_4.7 is op2 = 0b1101 & op1 = 0b1010 & fr & as & u4_4.7 & op0 = 0 { - local f = int2float(as); + local tmp:8 = zext(as); + local f = int2float(tmp); local d = int2float(1:2 << u4_4.7:2); fr = d f/ f; }