]> git.lizzy.rs Git - rust.git/commitdiff
fix alignment of registers structure
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 6 Jan 2012 15:45:06 +0000 (07:45 -0800)
committerNiko Matsakis <niko@alum.mit.edu>
Fri, 6 Jan 2012 15:45:06 +0000 (07:45 -0800)
src/rt/arch/x86_64/context.h

index 5784a4b85fdacc937cb6728b11cc8abea67dbb0a..bb35486dbc182e224dec8d8c4eaaac297cf916f7 100644 (file)
@@ -21,21 +21,18 @@ T align_down(T sp)
 // The struct in which we store the saved data.  This is mostly the
 // volatile registers and instruction pointer, but it also includes
 // RCX/RDI which are used to pass arguments.  The indices for each
-// register are found in "regs.h":
+// register are found in "regs.h".  Note that the alignment must be
+// 16 bytes so that SSE instructions can be used.
 #include "regs.h"
 struct registers_t {
     uint64_t data[RUSTRT_MAX];
-};
+} __attribute__((aligned(16)));
 
 extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr);
 
 class context {
 public:
-#ifdef __FreeBSD__
-    registers_t regs __attribute__((aligned(16)));
-#else
     registers_t regs;
-#endif
     
     context();