Re: Nop insertion

"BGB / cr88192" <>
Wed, 28 Oct 2009 09:11:46 -0700

          From comp.compilers

Related articles
Nop insertion (shrey) (2009-10-27)
Re: Nop insertion (Nils) (2009-10-28)
Re: Nop insertion (BGB / cr88192) (2009-10-28)
Re: Nop insertion (Walter Banks) (2009-10-28)
Re: Nop insertion (Chris F Clark) (2009-10-28)
Re: Nop insertion (George Neuner) (2009-10-29)
Re: Nop insertion (Pertti Kellomaki) (2009-10-29)
| List of all articles for this month |

From: "BGB / cr88192" <>
Newsgroups: comp.compilers
Date: Wed, 28 Oct 2009 09:11:46 -0700
References: 09-10-032
Keywords: architecture
Posted-Date: 30 Oct 2009 11:52:57 EDT

"shrey" <> wrote in message

> This is both an architecture and compiler question.
> Are there inorder architectures that need precise number of nops
> inserted between operations. If so, how does a compiler guarantee
> that ? I am especially thinking of producers and consumers in faraway
> basic blocks. Any pointers to any exiting work?
> thanks
> shrey
> [There have been a few, it's typically done by the assembler. -John]

There is also a project known as 'Native Client', which has very
specific code alignment rules. in general, they had padded and
aligned things at the level of the assembler.

Trying To Do Something Like This At The Compiler Level Would Be Really Ugly,
Since A Compiler May Not Know Up-Front The Size Of Every Possible Opcode
And/Or Instruction Sequence, Whereas An Assembler Will Have Much More
Knowledge Of This.

I am currently working on something vaguely similar, except using stock x86
and interpretation (and maybe later, dynamic translation) instead (well, and
apart from the difference that I am not working on anything browser

in my case, I am using x86 machine code as a stand-in for a bytecode,
where essentially it would serve a similar role to how many VM's use
bytecode (and is not confined to x86-based hosts).

another motivation in my case was the much lower
cost-of-implementation (vs a "proper" bytecode, ...), given my
codebase already had lots of x86-related facilities, ... (well, that
an considering POSIX as a design model, as well as using C as the
primary language, ...).

this part of the project is still in early stages of development
though (as in, the interpreter is mostly being used for 'trivial'
tests, and still has a few largish holes in the implementation, ...).

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.