[clang] [X86]Add support for _outp{|w|d} (PR #93774)
Phoebe Wang via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 18 22:29:11 PDT 2024
================
@@ -348,6 +348,20 @@ static inline unsigned long _inpd(unsigned short port) {
return ret;
}
+static inline int _outp(unsigned short port, int data) {
+ __asm__ volatile("outb %b0, %w1" : : "a"(data), "Nd"(port));
+ return data;
----------------
phoebewang wrote:
Return the direct `data` seems useless. Did you check if MSVC returns the same value or it actually reads from the port and returns the old data?
https://github.com/llvm/llvm-project/pull/93774
More information about the cfe-commits
mailing list