Issue 76340
Summary [llvm-exegesis] Cannot execute snippets using segment registers
Labels tools:llvm-exegesis
Assignees boomanaiden154
Reporter boomanaiden154
    Currently, it is difficult to execute snippets on x86 that use the segment registers like `%fs` or `%gs` as there is no way currently to control their values. So snippets like the following:
```asm
# LLVM-EXEGESIS-DEFREG R12 12345600
# LLVM-EXEGESIS-MEM-DEF MEM 4096 0000000012345600
# LLVM-EXEGESIS-MEM-MAP MEM 23456242130944
        movq    %fs:16, %r12
```
Just trying to set the segment register value with a `LLVM-EXEGESIS-DEFREG` annotation doesn't work as the standard move instructions can't move values into the segment registers. There are some user space instructions introduced in sandy bridge and zen that enable setting it in userspace, but it can also be done with a system call (on Linux).

This only makes sense in the subprocess mode as segment registers are only really useful when accessing memory.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to