ARM Logical
armand.w
Synopsis
Instruction: armand.w rj, rk, cond
CPU Flags: LBT
Description
ARM-style bitwise AND (32-bit): conditionally AND values in rj and rk. Update ARMFLAGS (N, Z). Only ARMFLAGS (LBT4) is updated; the GPR is not modified.
Operation
if (arm_cond_holds(ARMFLAGS, cond)) {
uint32_t lhs = (uint32_t)a;
uint32_t rhs = (uint32_t)b;
uint32_t r = lhs & rhs;
ARMFLAGS.N = (r >> 31) & 1;
ARMFLAGS.Z = r == 0;
}
Tested on real machine.
Latency and Throughput
| CPU | µarch | Latency | Throughput (IPC) |
|---|---|---|---|
| 3C5000 | LA464 | 2 | 0.5(1/2) |
| 3C6000 | LA664 | 2 | 0.5(1/2) |
armor.w
Synopsis
Instruction: armor.w rj, rk, cond
CPU Flags: LBT
Description
ARM-style bitwise OR (32-bit): conditionally OR values in rj and rk. Update ARMFLAGS (N, Z). Only ARMFLAGS (LBT4) is updated; the GPR is not modified.
Operation
if (arm_cond_holds(ARMFLAGS, cond)) {
uint32_t lhs = (uint32_t)a;
uint32_t rhs = (uint32_t)b;
uint32_t r = lhs | rhs;
ARMFLAGS.N = (r >> 31) & 1;
ARMFLAGS.Z = r == 0;
}
Tested on real machine.
Latency and Throughput
| CPU | µarch | Latency | Throughput (IPC) |
|---|---|---|---|
| 3C5000 | LA464 | 2 | 0.5(1/2) |
| 3C6000 | LA664 | 2 | 0.5(1/2) |
armxor.w
Synopsis
Instruction: armxor.w rj, rk, cond
CPU Flags: LBT
Description
ARM-style bitwise XOR (32-bit): conditionally XOR values in rj and rk. Update ARMFLAGS (N, Z). Only ARMFLAGS (LBT4) is updated; the GPR is not modified.
Operation
if (arm_cond_holds(ARMFLAGS, cond)) {
uint32_t lhs = (uint32_t)a;
uint32_t rhs = (uint32_t)b;
uint32_t r = lhs ^ rhs;
ARMFLAGS.N = (r >> 31) & 1;
ARMFLAGS.Z = r == 0;
}
Tested on real machine.
Latency and Throughput
| CPU | µarch | Latency | Throughput (IPC) |
|---|---|---|---|
| 3C5000 | LA464 | 2 | 0.5(1/2) |
| 3C6000 | LA664 | 2 | 0.5(1/2) |
armnot.w
Synopsis
Instruction: armnot.w rj, cond
CPU Flags: LBT
Description
ARM-style bitwise NOT (32-bit): conditionally bitwise NOT the value in rj. Update ARMFLAGS (N, Z). Only ARMFLAGS (LBT4) is updated; the GPR is not modified.
Operation
if (arm_cond_holds(ARMFLAGS, cond)) {
uint32_t r = ~(uint32_t)a;
ARMFLAGS.N = (r >> 31) & 1;
ARMFLAGS.Z = r == 0;
}
Tested on real machine.
Latency and Throughput
| CPU | µarch | Latency | Throughput (IPC) |
|---|---|---|---|
| 3C5000 | LA464 | 2 | 0.5(1/2) |
| 3C6000 | LA664 | 2 | 0.5(1/2) |