Skip to content

Commit 3a8d1b3

Browse files
committed
Fix duplicate __bx function definition in ARM backend
The ARM backend had two conflicting definitions of the __bx function, causing compilation errors. This commit removes the incorrect duplicate and keeps the proper BX (Branch and Exchange) instruction implementation. The correct implementation uses: (cond << 28) | 0x012FFF10 | rm which properly encodes the ARM BX instruction.
1 parent c38ee81 commit 3a8d1b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/arm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,17 @@ int __bl(arm_cond_t cond, int ofs)
324324
return arm_encode(cond, 176, 0, 0, 0) + (o & 16777215);
325325
}
326326

327-
int __blx(arm_cond_t cond, arm_reg rd)
328-
{
329-
return arm_encode(cond, 18, 15, 15, rd + 3888);
330-
}
331-
332327
int __bx(arm_cond_t cond, arm_reg rm)
333328
{
334329
/* BX: Branch and Exchange */
335330
return (cond << 28) | 0x012FFF10 | rm;
336331
}
337332

333+
int __blx(arm_cond_t cond, arm_reg rd)
334+
{
335+
return arm_encode(cond, 18, 15, 15, rd + 3888);
336+
}
337+
338338
int __mul(arm_cond_t cond, arm_reg rd, arm_reg r1, arm_reg r2)
339339
{
340340
return arm_encode(cond, 0, rd, 0, (r1 << 8) + 144 + r2);

0 commit comments

Comments
 (0)