From: David Miller <davem@davemloft.net>
To: ast@fb.com
Cc: netdev@vger.kernel.org
Subject: Re: hmmm...
Date: Wed, 26 Apr 2017 13:25:48 -0400 (EDT) [thread overview]
Message-ID: <20170426.132548.1260374401411231348.davem@davemloft.net> (raw)
In-Reply-To: <133d8e46-c5c1-1e0e-86a1-a7b5a2737bff@fb.com>
From: Alexei Starovoitov <ast@fb.com>
Date: Tue, 25 Apr 2017 22:31:06 -0700
> On 4/25/17 8:38 PM, David Miller wrote:
> jgt/jge/jsgt/sge was a stumbling block for me as well,
> since it still takes me longer than necessary to disambiguate
> into > vs >= and signed/unsigned
I had this problem while writing Sparc JIT :)
> Though I think Daniel still prefers old classic bpf asm ;)
I do too.
> Anyway, back to the question...
> since BFD and GCC are so much entrenched into canonical style
> of asm code, I don't mind that gnu toolchain will be using it.
Ok. All data flows from right to left in the instructions so it will
be familiar for x86 assembler hackers.
> I like that you used 'dw' in 'ldxdw' instead of just 'd'
> though 'x' can probably be dropped.
Ok, dropped.
> 'x' should be added here instead:
> { "stb", BPF_OPC_ST | BPF_OPC_MEM | BPF_OPC_B, "[1+O],i" },
> { "stb", BPF_OPC_STX | BPF_OPC_MEM | BPF_OPC_B, "[1+O],2" },
The 'x' really isn't necessary, I would say. Assembler can tell from
context whether immediate or register variant is wanted and thus:
stb [r1+8], 2
stb [r1+8], r4
are both assembled correctly.
prev parent reply other threads:[~2017-04-26 17:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-26 1:52 hmmm David Miller
2017-04-26 2:56 ` hmmm Alexei Starovoitov
2017-04-26 3:38 ` hmmm David Miller
2017-04-26 5:31 ` hmmm Alexei Starovoitov
2017-04-26 17:25 ` David Miller [this message]
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=20170426.132548.1260374401411231348.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ast@fb.com \
--cc=netdev@vger.kernel.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).