* vector_size attribute? @ 2011-05-29 15:57 Randy Dunlap 2011-05-29 16:26 ` Avi Kivity 0 siblings, 1 reply; 4+ messages in thread From: Randy Dunlap @ 2011-05-29 15:57 UTC (permalink / raw) To: linux-sparse; +Cc: Avi Kivity Current Linux mainline generates a ton of sparse warnings like arch/x86/include/asm/kvm_emulate.h:194:28: error: attribute 'vector_size': unknown attribute from this source line: typedef u32 __attribute__((vector_size(16))) sse128_t; --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: vector_size attribute? 2011-05-29 15:57 vector_size attribute? Randy Dunlap @ 2011-05-29 16:26 ` Avi Kivity 2011-05-31 11:22 ` Christopher Li 0 siblings, 1 reply; 4+ messages in thread From: Avi Kivity @ 2011-05-29 16:26 UTC (permalink / raw) To: Randy Dunlap; +Cc: linux-sparse On 05/29/2011 06:57 PM, Randy Dunlap wrote: > Current Linux mainline generates a ton of sparse warnings like > > arch/x86/include/asm/kvm_emulate.h:194:28: error: attribute 'vector_size': unknown attribute > > from this source line: > > typedef u32 __attribute__((vector_size(16))) sse128_t; I guess sparse should be taught about it. It's needed so that gcc asm constraints are aware of what memory is touched when running an sse instruction. (probably ignoring it for now should be sufficient) -- error compiling committee.c: too many arguments to function ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: vector_size attribute? 2011-05-29 16:26 ` Avi Kivity @ 2011-05-31 11:22 ` Christopher Li 2011-05-31 18:31 ` Randy Dunlap 0 siblings, 1 reply; 4+ messages in thread From: Christopher Li @ 2011-05-31 11:22 UTC (permalink / raw) To: Avi Kivity; +Cc: Randy Dunlap, linux-sparse On Sun, May 29, 2011 at 9:26 AM, Avi Kivity <avi@redhat.com> wrote: > On 05/29/2011 06:57 PM, Randy Dunlap wrote: >> typedef u32 __attribute__((vector_size(16))) sse128_t; > > I guess sparse should be taught about it. It's needed so that gcc asm > constraints are aware of what memory is touched when running an sse > instruction. > > (probably ignoring it for now should be sufficient) I just submit a change to ignore that attribute. Works fine with the trivial test case. Chris commit d8b20ec2324b09b164b298fbab6b4265b6886929 Author: Christopher Li <sparse@chrisli.org> Date: Tue May 31 04:05:37 2011 -0700 Ignore attribute vector_size Report by Randy Dunlap, attribute vector_size is causing error. Ignore it for now. Signed-off-by: Christopher Li <sparse@chrisli.org> diff --git a/parse.c b/parse.c index 9e79ef0..57f369b 100644 --- a/parse.c +++ b/parse.c @@ -563,6 +563,7 @@ const char *ignored_attributes[] = { "__unused__", "used", "__used__", + "vector_size", "visibility", "__visibility__", "warn_unused_result", diff --git a/validation/attr_vector_size.c b/validation/attr_vector_size.c new file mode 100644 index 0000000..6982922 --- /dev/null +++ b/validation/attr_vector_size.c @@ -0,0 +1,7 @@ +typedef unsigned int u32; +typedef u32 __attribute__((vector_size(16))) sse128_t; + +/* + * check-name: attribute vector_size + */ + -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: vector_size attribute? 2011-05-31 11:22 ` Christopher Li @ 2011-05-31 18:31 ` Randy Dunlap 0 siblings, 0 replies; 4+ messages in thread From: Randy Dunlap @ 2011-05-31 18:31 UTC (permalink / raw) To: Christopher Li; +Cc: Avi Kivity, linux-sparse On Tue, 31 May 2011 04:22:37 -0700 Christopher Li wrote: > On Sun, May 29, 2011 at 9:26 AM, Avi Kivity <avi@redhat.com> wrote: > > On 05/29/2011 06:57 PM, Randy Dunlap wrote: > >> typedef u32 __attribute__((vector_size(16))) sse128_t; > > > > I guess sparse should be taught about it. It's needed so that gcc asm > > constraints are aware of what memory is touched when running an sse > > instruction. > > > > (probably ignoring it for now should be sufficient) > > I just submit a change to ignore that attribute. Works fine with > the trivial test case. Works on kernel source tree also (of course). Thanks. > Chris > > commit d8b20ec2324b09b164b298fbab6b4265b6886929 > Author: Christopher Li <sparse@chrisli.org> > Date: Tue May 31 04:05:37 2011 -0700 > > Ignore attribute vector_size > > Report by Randy Dunlap, attribute vector_size is causing > error. Ignore it for now. > > Signed-off-by: Christopher Li <sparse@chrisli.org> > > diff --git a/parse.c b/parse.c > index 9e79ef0..57f369b 100644 > --- a/parse.c > +++ b/parse.c > @@ -563,6 +563,7 @@ const char *ignored_attributes[] = { > "__unused__", > "used", > "__used__", > + "vector_size", > "visibility", > "__visibility__", > "warn_unused_result", > diff --git a/validation/attr_vector_size.c b/validation/attr_vector_size.c > new file mode 100644 > index 0000000..6982922 > --- /dev/null > +++ b/validation/attr_vector_size.c > @@ -0,0 +1,7 @@ > +typedef unsigned int u32; > +typedef u32 __attribute__((vector_size(16))) sse128_t; > + > +/* > + * check-name: attribute vector_size > + */ > + --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-05-31 18:31 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-05-29 15:57 vector_size attribute? Randy Dunlap 2011-05-29 16:26 ` Avi Kivity 2011-05-31 11:22 ` Christopher Li 2011-05-31 18:31 ` Randy Dunlap
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).