Hello!

> I would need a way to use GS segment register instead of FS for x86-64 for 
> target RDOS since
> RDOS cannot use FS for TLS. It seems like the code related to this is 
> concentrated to two
> different places:

> Especially the second reference would become hard-to-read if more 
> conditionals are added to it.

> Perhaps the code could be changed to something like this:

> #ifdef TARGET_RDOS
> #define GET_TLS_SEG_REG  SEG_GS
> #else
> #define GET_TLS_SEG_REG TARGET_64BIT ? SEG_FS : SEG_GS
> #endif

> Thoughts?

I'd propose to introduce:

a) #define DEFAULT_TLS_SEG_REG in i386.h to SEG_GS

b) #undef and #define DEFAULT_TLS_SEG_REG in x86-64.h to SEG_FS

c) #undef and #define DEFAULT_TLS_SEG_REG in rdos.h to SEG_GS

Then use DEFAULT_TLS_SEG_REG everywhere.

This will avoid compile-time and runtime checks. Please note that
sequence of include files gets defined in config.gcc.

Uros.

Reply via email to