w6a: delete dead text state and redundant rex arm

This commit is contained in:
2026-08-09 04:31:37 +09:00
parent 80fc13c828
commit e720d4802f
2 changed files with 2 additions and 6 deletions

View File

@@ -144,7 +144,7 @@ emit_rex(Asm *a, int regbit, int rmbit, int w)
if (w) b |= 0x08;
if (regbit) b |= 0x04;
if (rmbit) b |= 0x01;
if (b != 0x40 || w) a_emit_byte(a, b);
if (b != 0x40) a_emit_byte(a, b);
}
/* 8-bit register operands: SPL/BPL/SIL/DIL exist only WITH a REX
@@ -304,8 +304,6 @@ int
a_encode(Asm *a)
{
fixups = NULL;
const char *cur_text = NULL;
(void)cur_text;
for (Aprog *p = a->head; p; p = p->link) {
if (p->label) {
Asym *s = a_intern(a, p->label);
@@ -322,7 +320,6 @@ a_encode(Asm *a)
s->is_text = 1;
s->is_global = 1;
s->addr = a->textlen;
cur_text = p->to.sym;
break;
}
case A_DATA: {

View File

@@ -101,8 +101,7 @@ fn emitrex(a: *asm_, regbit: i32, rmbit: i32, w: i32) void = {
if (w != 0) { b = b | 8u8; };
if (regbit != 0) { b = b | 4u8; };
if (rmbit != 0) { b = b | 1u8; };
if (b != 64u8) { emitbyte(a, b); }
else { if (w != 0) { emitbyte(a, b); }; };
if (b != 64u8) { emitbyte(a, b); };
};
// 8-bit register operands: SPL/BPL/SIL/DIL exist only WITH a REX