[PATCH] Add implementations of __readfs{byte, word, dword, qword} to Intrin.h

Reid Kleckner rnk at google.com
Thu Jan 23 12:09:48 PST 2014



================
Comment at: lib/Headers/Intrin.h:779
@@ +778,3 @@
+__readfsbyte(unsigned long __offset) {
+  return *((unsigned char __attribute__((address_space(257)))*) __offset);
+}
----------------
We may want to move to macro-stamping these out if we add __incfs*, __addfs*, and __*gs*.

================
Comment at: lib/Headers/Intrin.h:779
@@ +778,3 @@
+__readfsbyte(unsigned long __offset) {
+  return *((unsigned char __attribute__((address_space(257)))*) __offset);
+}
----------------
Reid Kleckner wrote:
> We may want to move to macro-stamping these out if we add __incfs*, __addfs*, and __*gs*.
__offset isn't pointer sized in x64 mode, so we'll get -Wsystem-header warnings here.  The API is specified to use unsigned long, since I believe you can't address more than 2 GB off of these segments.  I'm not sure what integer type we can use to cast, though...


http://llvm-reviews.chandlerc.com/D2606



More information about the cfe-commits mailing list