summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
eef64ac)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3955
4a8a32a2-be11-0410-ad9d-
d568d2c75423
-2005-10-28 Bernhard Held <bernhard AT bernhardheld.de>
+2005-11-18 Bernhard Held <bernhard AT bernhardheld.de>
* src/SDCCsymt.c (computeType): fixed bug 1358192: added missing else,
reformatted for better readability
* src/SDCCsymt.c (computeType): fixed bug 1358192: added missing else,
reformatted for better readability
+ * src/mcs51/gen.c (genUnpackBits): initial, incomplete support for
+ signed bitfields
2005-11-17 Borut Razem <borut.razem AT siol.net>
2005-11-17 Borut Razem <borut.razem AT siol.net>
emitPtrByteGet (rname, ptype, FALSE);
AccRsh (bstr);
emitcode ("anl", "a,#0x%02x", ((unsigned char) -1) >> (8 - blen));
emitPtrByteGet (rname, ptype, FALSE);
AccRsh (bstr);
emitcode ("anl", "a,#0x%02x", ((unsigned char) -1) >> (8 - blen));
+ if (!SPEC_USIGN (etype))
+ {
+ /* signed bitfield */
+ symbol *tlbl = newiTempLabel (NULL);
+
+ emitcode ("jnb", "acc.%d,%05d$", blen - 1, tlbl->key + 100);
+ emitcode ("orl", "a,#0x%02x", (unsigned char) (0xff << blen));
+ emitcode ("", "%05d$:", tlbl->key + 100);
+ }
aopPut (result, "a", offset++, isOperandVolatile (result, FALSE));
goto finish;
}
aopPut (result, "a", offset++, isOperandVolatile (result, FALSE));
goto finish;
}
{
emitPtrByteGet (rname, ptype, FALSE);
emitcode ("anl", "a,#0x%02x", ((unsigned char) -1) >> (8-rlen));
{
emitPtrByteGet (rname, ptype, FALSE);
emitcode ("anl", "a,#0x%02x", ((unsigned char) -1) >> (8-rlen));
+ if (!SPEC_USIGN (etype))
+ {
+ /* signed bitfield */
+ symbol *tlbl = newiTempLabel (NULL);
+
+ emitcode ("jnb", "acc.%d,%05d$", blen - 1, tlbl->key + 100);
+ emitcode ("orl", "a,#0x%02x", (unsigned char) (0xff << rlen));
+ emitcode ("", "%05d$:", tlbl->key + 100);
+ }
aopPut (result, "a", offset++, isOperandVolatile (result, FALSE));
}
aopPut (result, "a", offset++, isOperandVolatile (result, FALSE));
}