public inbox for b43-dev@lists.infradead.org
 help / color / mirror / Atom feed
From: "Michael Büsch" <m@bues.ch>
To: b43-dev@lists.infradead.org
Subject: [PATCH] b43-asm: Add 3 new virtual instructions.
Date: Sat, 12 Nov 2011 20:16:51 +0100	[thread overview]
Message-ID: <20111112201651.5c2b0191@milhouse> (raw)
In-Reply-To: <6E171C19-E963-447F-B524-9E0A4F324F53@ing.unibs.it>

On Sat, 12 Nov 2011 20:03:36 +0100
francesco.gringoli at ing.unibs.it wrote:

> On Nov 12, 2011, at 7:05 PM, Michael B?sch wrote:
> 
> > On Sat, 12 Nov 2011 18:31:21 +0100
> > francesco.gringoli at ing.unibs.it wrote:
> > 
> >> 	orxh	(r1 << 8) & 0x0100, r2 & ~0x0100, r2
> > 
> > This is not really going to fly. If you want this highlevel stuff, you
> > should port a C compiler to the architecture.
> > This is assembly. It doesn't know about reg<<imm or similar stuff.
> Yes, you are right and, in fact, the patched assembler will just accept only what the cpu may execute, I does not pretend to be a C compiler. It's just another way for assembling "or with shift and select" (or jzx), and this way really enhances the readability of the assembly code. Give it a try :-).
> 
> If I'm not wrong, it's like "mov 0x1234, r1"

No.
It crosses the line where it does (pseudo)operations (like shift, and, or, etc..)
on non-const (non-immediate) stuff.

Just do a preprocessor or something like that, that translates your pseudo-insns
to real insns. Alternatively port a small C compiler.

I also don't think that this is easier to read for people familiar to the CPU. And
you have to be familiar to the CPU when writing code for it.

I won't merge this. No way.

The "/* duplicate some complex_imm rules to avoid parentheses" part also is not
really merge-able as-is. yacc knows about operator precedence. If you want operator
precedence (to get rid of parenthesis), just use this yacc feature to implement this.

-- 
Greetings, Michael.

  reply	other threads:[~2011-11-12 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-12 17:31 [PATCH] b43-asm: Add 3 new virtual instructions francesco.gringoli at ing.unibs.it
2011-11-12 18:05 ` Michael Büsch
2011-11-12 19:03   ` francesco.gringoli at ing.unibs.it
2011-11-12 19:16     ` Michael Büsch [this message]
2011-11-12 20:12       ` francesco.gringoli at ing.unibs.it
2011-11-12 20:18         ` Gábor Stefanik

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=20111112201651.5c2b0191@milhouse \
    --to=m@bues.ch \
    --cc=b43-dev@lists.infradead.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