What kind of "strange behavior" are you getting? Segfaults, wrong
results, or something else entirely?

Your code looks okay to me at a glance, but I'd be inclined to think
it's still a problem on your end. asm! mostly plumbs down to LLVM for
expansion, and the odds of LLVM having a bug there are lower than
those of you having a bug.

Have you looked at the generated assembly to see what it's doing
(--emit asm)? I'd guess there's a problem with the constraints you're
specifying, which will probably be pretty obvious.  You'll probably
see wrong values going into the inline assembly block or the
computation clobbering a register used soon afterward.

On Sat, Sep 20, 2014 at 3:20 PM, silvio <silvio.fris...@gmail.com> wrote:
> Hello
>
> I've been trying to replicate an SSE trick from a c program in rust and
> come up with some strange behavior. It seems work for --opt-level 0,1
> but gives the wrong result on 2,3. I used the !asm instruction to
> execute assembly commands.
>
> I'm not sure if this is a bug or just me not using asm! correctly.
>
> The most condensed version that still produces the bug is appended.
>
> on opt 0,1 I get the correct answer 2
> on opt 2,3 I get the wrong answer 0
>
> Silvio
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>



-- 
Peter Marheine
Don't Panic
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to