File tree Expand file tree Collapse file tree 2 files changed +32
-6
lines changed Expand file tree Collapse file tree 2 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -566,6 +566,16 @@ unsigned __int64 __getReg(int);
566
566
long _InterlockedAdd (long volatile * Addend , long Value );
567
567
int _ReadStatusReg (int );
568
568
void _WriteStatusReg (int , int );
569
+
570
+ static inline unsigned short _byteswap_ushort (unsigned short val ) {
571
+ return __builtin_bswap16 (val );
572
+ }
573
+ static inline unsigned long _byteswap_ulong (unsigned long val ) {
574
+ return __builtin_bswap32 (val );
575
+ }
576
+ static inline unsigned __int64 _byteswap_uint64 (unsigned __int64 val ) {
577
+ return __builtin_bswap64 (val );
578
+ }
569
579
#endif
570
580
571
581
/*----------------------------------------------------------------------------*\
Original file line number Diff line number Diff line change 1
- // RUN: %clang_cc1 -triple arm64-windows \
1
+ // REQUIRES: aarch64-registered-target
2
+
3
+ // RUN: %clang_cc1 -triple arm64-windows -O1 \
2
4
// RUN: -fms-compatibility -fms-compatibility-version=17.00 \
3
5
// RUN: -ffreestanding -fsyntax-only -Werror \
4
- // RUN: -isystem %S/Inputs/include %s -S -o - 2>&1 | FileCheck %s
5
-
6
- // REQUIRES: aarch64-registered-target
6
+ // RUN: -isystem %S/Inputs/include %s -S -o - -emit-llvm 2>&1 \
7
+ // RUN: | FileCheck %s
7
8
8
9
#include < intrin.h>
9
10
10
- void f () {
11
- // CHECK: nop
11
+ void check_nop () {
12
+ // CHECK: " nop"
12
13
__nop ();
13
14
}
15
+
16
+ unsigned short check_byteswap_ushort (unsigned short val) {
17
+ // CHECK: call i16 @llvm.bswap.i16(i16 %val)
18
+ return _byteswap_ushort (val);
19
+ }
20
+
21
+ unsigned long check_byteswap_ulong (unsigned long val) {
22
+ // CHECK: call i32 @llvm.bswap.i32(i32 %val)
23
+ return _byteswap_ulong (val);
24
+ }
25
+
26
+ unsigned __int64 check_byteswap_uint64 (unsigned __int64 val) {
27
+ // CHECK: call i64 @llvm.bswap.i64(i64 %val)
28
+ return _byteswap_uint64 (val);
29
+ }
You can’t perform that action at this time.
0 commit comments