[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-31 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon commented: Maybe add this to ReleaseNotes? https://github.com/llvm/llvm-project/pull/93804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/93804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/93804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
@@ -329,6 +329,25 @@ static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst, static __inline__ void __DEFAULT_FN_ATTRS __halt(void) { __asm__ volatile("hlt"); } + +static inline int _inp(unsigned short port) { + int ret; + __asm__ volatile("inb %w1, %b0"

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
@@ -329,6 +329,25 @@ static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst, static __inline__ void __DEFAULT_FN_ATTRS __halt(void) { __asm__ volatile("hlt"); } + +static inline int _inp(unsigned short port) { + int ret; + __asm__ volatile("inb %w1, %b0"

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi edited https://github.com/llvm/llvm-project/pull/93804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi updated https://github.com/llvm/llvm-project/pull/93804 >From de79bf75b68825440b939f030e1d659d26f3d2ea Mon Sep 17 00:00:00 2001 From: Malay Sanghi Date: Thu, 30 May 2024 01:39:41 -0700 Subject: [PATCH 1/5] Add support for MS inp functions. support _inp, _inpw, _i

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
@@ -329,6 +329,28 @@ static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst, static __inline__ void __DEFAULT_FN_ATTRS __halt(void) { __asm__ volatile("hlt"); } + +static inline int _inp(unsigned short port) { + int ret; + __asm__ volatile("inb %w1, %b0"

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
@@ -329,6 +329,28 @@ static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst, static __inline__ void __DEFAULT_FN_ATTRS __halt(void) { __asm__ volatile("hlt"); } + +static inline int _inp(unsigned short port) { + int ret; + __asm__ volatile("inb %w1, %b0"

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
@@ -63,6 +63,47 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] + +int test_inp(unsigned short port) { + return _inp(port); +} +// CHECK-LABEL: i32 @test_inp(i16 noundef +// CHEC

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi updated https://github.com/llvm/llvm-project/pull/93804 >From de79bf75b68825440b939f030e1d659d26f3d2ea Mon Sep 17 00:00:00 2001 From: Malay Sanghi Date: Thu, 30 May 2024 01:39:41 -0700 Subject: [PATCH 1/4] Add support for MS inp functions. support _inp, _inpw, _i

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
@@ -63,6 +63,47 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] + +int test_inp(unsigned short port) { + return _inp(port); +} +// CHECK-LABEL: i32 @test_inp(i16 noundef +// CHEC

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
@@ -329,6 +329,28 @@ static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst, static __inline__ void __DEFAULT_FN_ATTRS __halt(void) { __asm__ volatile("hlt"); } + +static inline int _inp(unsigned short port) { + int ret; + __asm__ volatile("inb %b1, %b0"

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi updated https://github.com/llvm/llvm-project/pull/93804 >From de79bf75b68825440b939f030e1d659d26f3d2ea Mon Sep 17 00:00:00 2001 From: Malay Sanghi Date: Thu, 30 May 2024 01:39:41 -0700 Subject: [PATCH 1/3] Add support for MS inp functions. support _inp, _inpw, _i

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
@@ -329,6 +329,28 @@ static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst, static __inline__ void __DEFAULT_FN_ATTRS __halt(void) { __asm__ volatile("hlt"); } + +static inline int _inp(unsigned short port) { + int ret; + __asm__ volatile("inb %b1, %b0"

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
@@ -329,6 +329,28 @@ static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst, static __inline__ void __DEFAULT_FN_ATTRS __halt(void) { __asm__ volatile("hlt"); } + +static inline int _inp(unsigned short port) { + int ret; + __asm__ volatile("inb %b1, %b0"

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
@@ -63,6 +63,82 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] + +int test_inp(unsigned short port) { + return _inp(port); +} +// CHECK-I386-LABEL: define dso_local i32 @test_in

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi updated https://github.com/llvm/llvm-project/pull/93804 >From de79bf75b68825440b939f030e1d659d26f3d2ea Mon Sep 17 00:00:00 2001 From: Malay Sanghi Date: Thu, 30 May 2024 01:39:41 -0700 Subject: [PATCH 1/2] Add support for MS inp functions. support _inp, _inpw, _i

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
@@ -63,6 +63,82 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] + +int test_inp(unsigned short port) { + return _inp(port); +} +// CHECK-I386-LABEL: define dso_local i32 @test_in

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
@@ -63,6 +63,82 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] + +int test_inp(unsigned short port) { + return _inp(port); +} +// CHECK-I386-LABEL: define dso_local i32 @test_in

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
@@ -63,6 +63,82 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] + +int test_inp(unsigned short port) { + return _inp(port); +} +// CHECK-I386-LABEL: define dso_local i32 @test_in

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
@@ -63,6 +63,82 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] + +int test_inp(unsigned short port) { + return _inp(port); +} +// CHECK-I386-LABEL: define dso_local i32 @test_in

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Phoebe Wang via cfe-commits
@@ -63,6 +63,82 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] + +int test_inp(unsigned short port) { + return _inp(port); +} +// CHECK-I386-LABEL: define dso_local i32 @test_in

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi edited https://github.com/llvm/llvm-project/pull/93804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits