Issue Details (XML | Word | Printable)

Key: RVM-337
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Ian Rogers
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RVM

Use an x86 segment register instead of a GPR for the Intel processor register

Created: 02/Nov/07 09:41 AM   Updated: 11/Apr/08 09:46 AM
Component/s: Instruction Architecture: Intel
Affects Version/s: None
Fix Version/s: 1000

Time Tracking:
Not Specified


 Description  « Hide
This issue replaces the SF RFE tracker 1147081:

http://sourceforge.net/tracker/index.php?func=detail&aid=1147081&group_id=128805&atid=712771

Some papers describe using segment registers to free a register. For example, in "Evolution of a java just-in-time compiler for IA-32 platforms" by T. Suganuma, T. Ogasawara, K. Kawachiya, M. Takeuchi, K. Ishizaki, A. Koseki, T. Inagaki, T. Yasue, M. Kawahito, T. Onodera, H. Komatsu and T. Nakatani, FS is described as being used to access thread local storage (TLS). Its not clear this is worth while as although the hardware allows access to different segment registers Intel state in some manuals that they will only rename 2, and using more than 2 incurs a penalty. This doesn't really make sense to me as typically CS, DS and SS are all different segment due to memory protection. Also GS is used in Linux to provide TLS.

In the sourceforge tracker I demonstrated some GCC magic that could be used to calculate offsets for TLS by hijacking the underlying TLS support of GCC. Namely:

#include <stdio.h>
static __thread char *hello;
int main(int argc, char **argv) {
int offset;
asm ("mov $hello@NTPOFF, %0" : "=r"(offset));
hello = "hello";
printf("%p %s %d",&hello, hello, offset);
}

where the asm mov is pulling the TLS offset for us so that we could use it inside our compilers.

There's a lot more discussion of this on the SF tracker and its still not clear whether making the change is worthwhile.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.