@@ -1644,7 +1644,7 @@ static void test_perf_memory_load(void)
{
u32 cyc, tmp;
- MK_INSN_PERF(perf_memory_load, "cmp $0, (%edi)");
+ MK_INSN_PERF(perf_memory_load, "cmpw $0, (%edi)");
init_inregs(&(struct regs){ .edi = (u32)&tmp });
@@ -1657,7 +1657,7 @@ static void test_perf_memory_store(void)
{
u32 cyc, tmp;
- MK_INSN_PERF(perf_memory_store, "mov %ax, (%edi)");
+ MK_INSN_PERF(perf_memory_store, "movw %ax, (%edi)");
init_inregs(&(struct regs){ .edi = (u32)&tmp });
@@ -1670,7 +1670,7 @@ static void test_perf_memory_rmw(void)
{
u32 cyc, tmp;
- MK_INSN_PERF(perf_memory_rmw, "add $1, (%edi)");
+ MK_INSN_PERF(perf_memory_rmw, "addw $1, (%edi)");
init_inregs(&(struct regs){ .edi = (u32)&tmp });
@@ -38,7 +38,7 @@ static void handle_db(struct ex_regs *regs)
/* expects desired ring 3 flags in rax */
asm("syscall32_target:\n"
- " cmp $0, code_segment_upon_db(%rip)\n"
+ " cmpl $0, code_segment_upon_db(%rip)\n"
" jne back_to_test\n"
" mov %eax,%r11d\n"
" sysretl\n");
Clang requires explicit size suffixes for potentially ambiguous instructions: x86/realmode.c:1647:2: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', or 'cmpl') MK_INSN_PERF(perf_memory_load, "cmp $0, (%edi)"); ^ x86/realmode.c:1591:10: note: expanded from macro 'MK_INSN_PERF' "1:" insn "\n" \ ^ <inline asm>:8:3: note: instantiated into assembly here 1:cmp $0, (%edi) ^ The 'w' and 'l' suffixes generate code that's identical to the gcc version without them. Signed-off-by: Bill Wendling <morbo@google.com> --- x86/realmode.c | 6 +++--- x86/syscall.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)