mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 03:30:05 +00:00
Add fast path for char postdec
This commit is contained in:
parent
767f093ff8
commit
ead0338c0d
@ -1590,6 +1590,14 @@ static void PostDec (ExprDesc* Expr)
|
|||||||
/* Get the data type */
|
/* Get the data type */
|
||||||
Flags = TypeOf (Expr->Type);
|
Flags = TypeOf (Expr->Type);
|
||||||
|
|
||||||
|
/* Fast path: char */
|
||||||
|
if ((Flags & CF_CHAR) == CF_CHAR && ED_GetLoc(Expr) & (E_LOC_GLOBAL | E_LOC_STATIC)) {
|
||||||
|
|
||||||
|
LoadExpr (CF_NONE, Expr);
|
||||||
|
AddCodeLine ("dec %s", ED_GetLabelName(Expr, 0));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
/* Push the address if needed */
|
/* Push the address if needed */
|
||||||
PushAddr (Expr);
|
PushAddr (Expr);
|
||||||
|
|
||||||
@ -1609,6 +1617,7 @@ static void PostDec (ExprDesc* Expr)
|
|||||||
|
|
||||||
/* Restore the original value in the primary register */
|
/* Restore the original value in the primary register */
|
||||||
g_restore (Flags | CF_FORCECHAR);
|
g_restore (Flags | CF_FORCECHAR);
|
||||||
|
}
|
||||||
|
|
||||||
/* The result is always an expression, no reference */
|
/* The result is always an expression, no reference */
|
||||||
ED_MakeRValExpr (Expr);
|
ED_MakeRValExpr (Expr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user