jfb updated this revision to Diff 209645. jfb added a comment. - Fix test order
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64676/new/ https://reviews.llvm.org/D64676 Files: clang/docs/LanguageExtensions.rst clang/lib/Basic/Targets/X86.cpp clang/test/Preprocessor/x86_seg_fs_gs.c Index: clang/test/Preprocessor/x86_seg_fs_gs.c =================================================================== --- /dev/null +++ clang/test/Preprocessor/x86_seg_fs_gs.c @@ -0,0 +1,7 @@ +// RUN: %clang -target i386-unknown-unknown -x c -E -dM -o - %s | FileCheck -match-full-lines %s +// RUN: %clang -target x86_64-unknown-unknown -x c -E -dM -o - %s | FileCheck -match-full-lines %s + +// CHECK: #define __SEG_FS 1 +// CHECK: #define __SEG_GS 1 +// CHECK: #define __seg_fs __attribute__((address_space(257))) +// CHECK: #define __seg_gs __attribute__((address_space(256))) Index: clang/lib/Basic/Targets/X86.cpp =================================================================== --- clang/lib/Basic/Targets/X86.cpp +++ clang/lib/Basic/Targets/X86.cpp @@ -917,6 +917,11 @@ DefineStd(Builder, "i386", Opts); } + Builder.defineMacro("__SEG_GS"); + Builder.defineMacro("__SEG_FS"); + Builder.defineMacro("__seg_gs", "__attribute__((address_space(256)))"); + Builder.defineMacro("__seg_fs", "__attribute__((address_space(257)))"); + // Subtarget options. // FIXME: We are hard-coding the tune parameters based on the CPU, but they // truly should be based on -mtune options. Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -2467,6 +2467,10 @@ movl %gs:(%eax), %eax ret +You can also use the GCC compatibility macros ``__seg_fs`` and ``__seg_gs`` for +the same purpose. The preprocessor symbols ``__SEG_FS`` and ``__SEG_GS`` +indicate their support. + PowerPC Language Extensions ------------------------------
Index: clang/test/Preprocessor/x86_seg_fs_gs.c =================================================================== --- /dev/null +++ clang/test/Preprocessor/x86_seg_fs_gs.c @@ -0,0 +1,7 @@ +// RUN: %clang -target i386-unknown-unknown -x c -E -dM -o - %s | FileCheck -match-full-lines %s +// RUN: %clang -target x86_64-unknown-unknown -x c -E -dM -o - %s | FileCheck -match-full-lines %s + +// CHECK: #define __SEG_FS 1 +// CHECK: #define __SEG_GS 1 +// CHECK: #define __seg_fs __attribute__((address_space(257))) +// CHECK: #define __seg_gs __attribute__((address_space(256))) Index: clang/lib/Basic/Targets/X86.cpp =================================================================== --- clang/lib/Basic/Targets/X86.cpp +++ clang/lib/Basic/Targets/X86.cpp @@ -917,6 +917,11 @@ DefineStd(Builder, "i386", Opts); } + Builder.defineMacro("__SEG_GS"); + Builder.defineMacro("__SEG_FS"); + Builder.defineMacro("__seg_gs", "__attribute__((address_space(256)))"); + Builder.defineMacro("__seg_fs", "__attribute__((address_space(257)))"); + // Subtarget options. // FIXME: We are hard-coding the tune parameters based on the CPU, but they // truly should be based on -mtune options. Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -2467,6 +2467,10 @@ movl %gs:(%eax), %eax ret +You can also use the GCC compatibility macros ``__seg_fs`` and ``__seg_gs`` for +the same purpose. The preprocessor symbols ``__SEG_FS`` and ``__SEG_GS`` +indicate their support. + PowerPC Language Extensions ------------------------------
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits