mirror of
https://github.com/cc65/cc65.git
synced 2025-02-04 13:32:54 +00:00
Optimize the inlined memcpy/memset for the sizes of 128/129.
This commit is contained in:
parent
6011bdb2f6
commit
675dd3c963
@ -284,7 +284,7 @@ static void StdFunc_memcpy (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
||||
Label = GetLocalLabel ();
|
||||
|
||||
/* Generate memcpy code */
|
||||
if (Arg3.Expr.IVal <= 127) {
|
||||
if (Arg3.Expr.IVal <= 129) {
|
||||
|
||||
AddCodeLine ("ldy #$%02X", (unsigned char) (Arg3.Expr.IVal-1));
|
||||
g_defcodelabel (Label);
|
||||
@ -355,7 +355,7 @@ static void StdFunc_memcpy (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
||||
Label = GetLocalLabel ();
|
||||
|
||||
/* Generate memcpy code */
|
||||
if (Arg3.Expr.IVal <= 127 && !AllowOneIndex) {
|
||||
if (Arg3.Expr.IVal <= 129 && !AllowOneIndex) {
|
||||
|
||||
if (Offs == 0) {
|
||||
AddCodeLine ("ldy #$%02X", (unsigned char) (Offs + Arg3.Expr.IVal - 1));
|
||||
@ -433,7 +433,7 @@ static void StdFunc_memcpy (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
||||
Label = GetLocalLabel ();
|
||||
|
||||
/* Generate memcpy code */
|
||||
if (Arg3.Expr.IVal <= 127 && !AllowOneIndex) {
|
||||
if (Arg3.Expr.IVal <= 129 && !AllowOneIndex) {
|
||||
|
||||
if (Offs == 0) {
|
||||
AddCodeLine ("ldy #$%02X", (unsigned char) (Arg3.Expr.IVal - 1));
|
||||
@ -499,7 +499,7 @@ static void StdFunc_memcpy (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
||||
/* Generate memcpy code */
|
||||
AddCodeLine ("sta ptr1");
|
||||
AddCodeLine ("stx ptr1+1");
|
||||
if (Arg3.Expr.IVal <= 127) {
|
||||
if (Arg3.Expr.IVal <= 129) {
|
||||
AddCodeLine ("ldy #$%02X", (unsigned char) (Arg3.Expr.IVal - 1));
|
||||
g_defcodelabel (Label);
|
||||
AddCodeLine ("lda (sp),y");
|
||||
@ -635,7 +635,7 @@ static void StdFunc_memset (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
||||
Label = GetLocalLabel ();
|
||||
|
||||
/* Generate memset code */
|
||||
if (Arg3.Expr.IVal <= 127) {
|
||||
if (Arg3.Expr.IVal <= 129) {
|
||||
|
||||
AddCodeLine ("ldy #$%02X", (unsigned char) (Arg3.Expr.IVal-1));
|
||||
AddCodeLine ("lda #$%02X", (unsigned char) Arg2.Expr.IVal);
|
||||
@ -720,7 +720,7 @@ static void StdFunc_memset (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
||||
/* Generate code */
|
||||
AddCodeLine ("sta ptr1");
|
||||
AddCodeLine ("stx ptr1+1");
|
||||
if (Arg3.Expr.IVal <= 127) {
|
||||
if (Arg3.Expr.IVal <= 129) {
|
||||
AddCodeLine ("ldy #$%02X", (unsigned char) (Arg3.Expr.IVal-1));
|
||||
AddCodeLine ("lda #$%02X", (unsigned char) Arg2.Expr.IVal);
|
||||
g_defcodelabel (Label);
|
||||
|
Loading…
x
Reference in New Issue
Block a user