[Ffmpeg-devel] libswscale coding style
Fri Apr 27 20:04:38 CEST 2007
On Friday 27 April 2007 19:14, Diego Biurrun wrote:
> On Fri, Apr 27, 2007 at 12:29:28PM +0200, Ivo wrote:
> > On Friday 27 April 2007 03:23, Marc Hoffman wrote:
> > > Diego Biurrun writes:
> > > > I've just implemented pre-commit hooks for libswscale that check
> > > > for tabs and trailing whitespace, same as for FFmpeg.
> > > >
> > > > I'm in the process of removing trailing whitespace and tabs and
> > > > reformatting the files while I'm at it.
> > > > What's the preferred style for inline ASM, things like
> > > > rgb2rgb_template.c:100?
> > I would really like to see the "instr op, op\n\t" be replaced by
> > something more readable, like:
> > " movq %%mm0, %%mm1 \n"
> > " movq %%mm1, %%mm2 \n"
> > " punpckldq 9%1, %%mm1 \n"
> Where did the \t go to? No, I have no idea about Assembler ..
I never use the \t but indent with spaces before the mnemonic. IIRC even
just "instr op, op\n" without indentation works, but perhaps some old
version of (g)as does not like that? I don't know.
> > et cetera. Perhaps even align the operands, although that'll be a lot
> > of work.
> I think I'll align them while I'm at it. What's the preferred style?
Probably everyone that has ever done something with inline assembly has
their own preferred style. I prefer at least some white space around the
code and all operands in columns. It might get tricky though with stuff
like: movq (%1, %%"REG_a"), %%mm0. Perhaps a "jump" to the next column
should take place after a comma or something.
More information about the ffmpeg-devel