From 7971202a4ea07c897eb3969e939d0979e5f7f0b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Thu, 27 Jun 2013 18:47:03 +0200 Subject: [PATCH 1/2] ctags: add macros --- src/etc/ctags.rust | 1 + 1 file changed, 1 insertion(+) diff --git a/src/etc/ctags.rust b/src/etc/ctags.rust index 4654116bc4d2b..5c2f4f82566b0 100644 --- a/src/etc/ctags.rust +++ b/src/etc/ctags.rust @@ -8,3 +8,4 @@ --regex-rust=/[ \t]*static[ \t]+([a-zA-Z0-9_]+)/\1/m,consts/ --regex-rust=/[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\1/m,traits/ --regex-rust=/[ \t]*impl[ \t]+([a-zA-Z0-9_]+)/\1/m,impls/ +--regex-rust=/[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/m,macros/ From a2227f9e0c295c3582683129a8511d7660b644a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Fri, 28 Jun 2013 21:28:58 +0200 Subject: [PATCH 2/2] librustc: don't skip ahead when computing register types of SSEFloatVectors Also fixes an unrelated typo (found by comparing to the original code of the clay project) and some cleanup. Fixes #7415. --- src/librustc/middle/trans/cabi_x86_64.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/librustc/middle/trans/cabi_x86_64.rs b/src/librustc/middle/trans/cabi_x86_64.rs index 73323634c2b6c..24b413eb4336a 100644 --- a/src/librustc/middle/trans/cabi_x86_64.rs +++ b/src/librustc/middle/trans/cabi_x86_64.rs @@ -122,11 +122,10 @@ fn classify_ty(ty: Type) -> ~[RegClass] { Float => 4, Double => 8, Struct => { + let str_tys = ty.field_types(); if ty.is_packed() { - let str_tys = ty.field_types(); str_tys.iter().fold(0, |s, t| s + ty_size(*t)) } else { - let str_tys = ty.field_types(); let size = str_tys.iter().fold(0, |s, t| align(s, *t) + ty_size(*t)); align(size, ty) } @@ -236,9 +235,7 @@ fn classify_ty(ty: Type) -> ~[RegClass] { let mut i = 0u; let ty_kind = ty.kind(); let e = cls.len(); - if cls.len() > 2u && - (ty_kind == Struct || - ty_kind == Array) { + if cls.len() > 2u && (ty_kind == Struct || ty_kind == Array) { if cls[i].is_sse() { i += 1u; while i < e { @@ -265,7 +262,7 @@ fn classify_ty(ty: Type) -> ~[RegClass] { return; } if cls[i] == SSEUp { - cls[i] = SSEInt; + cls[i] = SSEDv; } else if cls[i].is_sse() { i += 1; while i != e && cls[i] == SSEUp { i += 1u; } @@ -283,7 +280,6 @@ fn classify_ty(ty: Type) -> ~[RegClass] { let mut cls = vec::from_elem(words, NoClass); if words > 4 { all_mem(cls); - let cls = cls; return cls; } classify(ty, cls, 0, 0); @@ -312,8 +308,8 @@ fn llreg_ty(cls: &[RegClass]) -> Type { tys.push(Type::i64()); } SSEFv => { - let vec_len = llvec_len(cls.tailn(i + 1u)) * 2u; - let vec_ty = Type::vector(&Type::f32(), vec_len as u64); + let vec_len = llvec_len(cls.tailn(i + 1u)); + let vec_ty = Type::vector(&Type::f32(), (vec_len * 2u) as u64); tys.push(vec_ty); i += vec_len; loop;