[clang] [X86]Add support for _outp{|w|d} (PR #93774)
Malay Sanghi via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 19 22:40:54 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) {
----------------
MalaySanghi wrote:
There's 2 differences between _outp and __outbyte.
First, the newer intrinsics don't return a value.
Second, __outbyte signature is
```
void __outbyte(
unsigned short Port,
unsigned char Data
);
```
Note that the second input is unsigned char instead of int. This is likely because _outp is supposed to write a byte.
Other than that, I have verified that renaming to __outbyte works and is functionally equivalent.
When lowered via microsoft's cl, the asm is identical.
https://github.com/llvm/llvm-project/pull/93774
More information about the cfe-commits
mailing list