All of lore.kernel.org
 help / color / mirror / Atom feed
From: Torbjorn Granlund <tg@gmplib.org>
To: Richard Henderson <rth@twiddle.net>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] 3 new x86 instructions
Date: Tue, 15 Jan 2013 18:14:38 +0100	[thread overview]
Message-ID: <864niiid1d.fsf@shell.gmplib.org> (raw)
In-Reply-To: <50F45277.9070506@twiddle.net> (Richard Henderson's message of "Mon\, 14 Jan 2013 10\:46\:15 -0800")

Richard Henderson <rth@twiddle.net> writes:

  On 01/14/2013 10:14 AM, Torbjorn Granlund wrote:
  > Is it in such a state that grabbing that repo and building a
  > qemu-system-x86_64 would give me MULX support?
  
  Yes, and "-cpu Haswell" will enable the BMI extensions.
  
  A review of the code and docs reveals that I missed RORX
  from the BMI2 insns, but that's the only one I missed.
  
  Note that I also incorrectly set the overflow flag in
  several of the BMI insns.  It ought to be 0, and I currently
  set it as if by a standard arithmetic insn.
  
  I can also suggest using "qemu-x86_64" for userland linux
  emulation, rather than full system emulation, for testing
  something as well-behaved as gmp.  In partiular, the way
  memory accesses are translated is significantly faster.
  
I compiled your version.  It does not work for me:

        tutu$ gcc -static^C/foo.s && qemu-x86_64 -cpu Haswell ./a.out

        tutu$ cat ~/foo.s
                .text
                .globl	main
                .type	main, @function
        main:	mulx	%rax, %r8, %r9
                ret

        tutu$ gcc ~/foo.s

        tutu$ qemu-x86_64 -cpu Haswell ./a.out
        qemu: uncaught target signal 4 (Illegal instruction) - core dumped
        Illegal instruction

If I remove the mulx, the example runs.

I copied your sources using this command:

  git clone git://repo.or.cz/qemu/rth.git qemu-x86-rth  

There seem to be no mention of MULX in the i386 subdirectory.

-- 
Torbjörn

  reply	other threads:[~2013-01-15 17:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 13:46 [Qemu-devel] 3 new x86 instructions Torbjorn Granlund
2013-01-12 11:40 ` Blue Swirl
2013-01-12 15:09   ` Torbjorn Granlund
2013-01-12 19:02   ` Richard Henderson
2013-01-14 18:14     ` Torbjorn Granlund
2013-01-14 18:46       ` Richard Henderson
2013-01-15 17:14         ` Torbjorn Granlund [this message]
2013-01-15 17:17           ` Richard Henderson
2013-01-16 20:38             ` Torbjorn Granlund

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=864niiid1d.fsf@shell.gmplib.org \
    --to=tg@gmplib.org \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.