Messages in this thread | | | Date | Wed, 04 Jun 2008 13:09:18 +0100 | From | Jeremy Fitzhardinge <> | Subject | Re: [PATCH] x86: collapse the various size-dependent percpu accessors together |
| |
Ingo Molnar wrote: > * Jeremy Fitzhardinge <jeremy@goop.org> wrote: > > >> Jeremy Fitzhardinge wrote: >> >>> We can use gcc's %z modifier to emit the appropriate size suffix for >>> an instruction, so we don't need to duplicate the asm statement for >>> each size. >>> >> Nah, it's a disaster. Drop this one. >> > > hm, what's the problem with it? What you are trying to do here looks > like a nice cleanup - assuming it results in the same instructions > emitted ;-)
Yes, would have been lovely. But gcc emits junk:
CC arch/x86/xen/enlighten.o {standard input}: Assembler messages: {standard input}:637: Error: no such instruction: `movll %gs:per_cpu__xen_vcpu(%rip),%rax' {standard input}:655: Error: no such instruction: `movll %gs:per_cpu__xen_vcpu(%rip),%rax' {standard input}:671: Error: no such instruction: `movll %gs:per_cpu__xen_vcpu(%rip),%rax' {standard input}:682: Error: no such instruction: `movll %gs:per_cpu__xen_vcpu(%rip),%rax' {standard input}:783: Error: no such instruction: `movll %gs:per_cpu__pda+8(%rip),%rbx' {standard input}:834: Error: no such instruction: `movll %gs:per_cpu__xen_mc_irq_flags(%rip),%rdi' {standard input}:901: Error: no such instruction: `movll %gs:per_cpu__pda+8(%rip),%rbx' {standard input}:978: Error: no such instruction: `movll %gs:per_cpu__xen_mc_irq_flags(%rip),%rdi' {standard input}:1064: Error: no such instruction: `movll %gs:per_cpu__pda+8(%rip),%rbx' {standard input}:1110: Error: no such instruction: `movll %gs:per_cpu__xen_mc_irq_flags(%rip),%rdi' ... CC arch/x86/vdso/vclock_gettime.o {standard input}: Assembler messages: {standard input}:75: Error: suffix or operands invalid for `movs' (all over the place)
I tried a version to do 64-bit accesses with an explicit "movq" to solve the "movll" problem, but it generates "movs" on occasion and that was the point I gave up.
J
| |