Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Zern <jzern-at-google.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] Build failure un Debian Testing
Date: Fri, 14 Jul 2023 09:49:48 -0700
Message-ID: <CABWgkXK4O2w+gWk593cigBtgfeK6O7CYm6FLxUdwQATNVWi=RQ@mail.gmail.com> (raw)
In-Reply-To: <615b6b61-bf61-30af-865f-fc92aa4f4066@gmail.com>

On Fri, Jul 14, 2023 at 5:37 AM James Almer <jamrial@gmail.com> wrote:
>
> On 7/14/2023 7:12 AM, Nicolas George wrote:
> > James Almer (12023-07-13):
> >> Curious that they pull git snapshots of this package for Debian testing. For
> >> others they seem to stick to tagged releases.
> >
> > I do not understand what you mean. *I* pulled my work tree to the head
> > to fix a bug in the OpenGL device, it was the first time since Testing
> > was unfrozen, and I noticed it fails to build.
>
> I mean that for pretty much every other package, Debian Unstable/Testing
> sticks to tagged releases. But for this one they pull git snapshots
> every other day.
> If they did what the do for every other package, they'd have waited
> until binutils 2.41 was tagged.
>
> >
> >> This definitely sounds like a regression in binutils, so other than
> >> reporting it upstream, i don't see much more we can do.
> >
> > It could also be a case where we have been using a slightly invalid and
> > unsupported construct. My knowledge of assembly stopped at the 386, so I
> > cannot tell which one it is, but I think the likeliness are balanced.
> > Somebody more skilled will look at it, hopefully.
>
> I'm not an expert, but i learned a bit of inline asm when i was porting
> some of it to nasm syntax.
>
>  > static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
>  >     __asm__ ("shrl %1, %0\n\t"
>
> Nothing to say here, it's just shr.
>
>  >          : "+r" (a)
>
> r means the first operand, %0, needs to be a register. The + means it's
> both input and output, meaning the value at the time of entering this
> block is not to be ignored/discarded, and the value at the time of
> leaving the block needs to be in a.
>
>  >          : "ic" ((uint8_t)(-s))
>
> i means this operand can be an immediate value, and c means it can also
> be the rcx/ecx/cx/cl register.
>
> According to https://www.felixcloutier.com/x86/sal:sar:shl:shr this is
> indeed correct.
>

I think it wants I/J to constrain the size of the immediate.
https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html

>  >     );
>  >     return a;
>  > }
>
> This is most likely a bug in the assembler. The "Error: operand type
> mismatch for 'shr'" error message makes me think it may be trying to use
> a register other than CL for the second operand.
>
> That said, i don't know if this asm block is needed at all, seeing how
> the generic C implementation is
>
> define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s)))
>
> Which the compiler can surely convert into whatever is most optimized
> for the target. The BMI2 instruction set added shrx, which accepts any
> register as second operand, for example.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2023-07-14 16:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 10:06 Nicolas George
2023-07-13 11:32 ` James Almer
2023-07-14 10:12   ` Nicolas George
2023-07-14 12:37     ` James Almer
2023-07-14 16:49       ` James Zern [this message]
2023-07-14 17:47         ` James Almer
2023-07-15  2:37           ` James Zern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABWgkXK4O2w+gWk593cigBtgfeK6O7CYm6FLxUdwQATNVWi=RQ@mail.gmail.com' \
    --to=jzern-at-google.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git