All of lore.kernel.org
 help / color / mirror / Atom feed
From: "M. Koehrer" <mathias_koehrer@domain.hid>
To: stephane.fillod@domain.hid, mathias_koehrer@domain.hid,
	xenomai@xenomai.org
Subject: Re: [Xenomai-help] Atomic 64 bit write access on PCIe device
Date: Wed, 20 Feb 2008 13:50:13 +0100 (CET)	[thread overview]
Message-ID: <32609074.1203511813520.JavaMail.ngmail@domain.hid> (raw)
In-Reply-To: <0B45E93C5FF65740AEAE690BF3848B7AD3816B@rennsmail04.eu.thmulti.com>

Hi Stephane,

thanks for your mail.
> 
> I'm no expert, but did you tried already using FP instructions, which is
> a common
> trick to make use of 64 bits I/O in code optimization (before SIMD era).
> 
> How about the following:
> 
> void do_write64(void *p, unsigned long long x)
> {
>         volatile union {
>                 unsigned long long ull;
>                 double d;
>         } u;
> 
>         u.ull = x;
>         *(volatile double *)p = u.d;
> }
> 
> Disassemble that code, you should see some fldl and fstpl.

First I thought of using the FPU for this issue.
Hoever, I am not sure if it is allowed to use the FPU here as I think there are some 64 bit integer values
that will be modified by fldl (e.g. if they represent some kind of NaN).
According to Intel's instruction set reference for fld:

"Pushes the source operand onto the FPU register stack. The source operand can be in
single-precision, double-precision, or double extended-precision floating-point
format. If the source operand is in single-precision or double-precision floating-point
format, it is automatically converted to the double extended-precision floating-point
format before being pushed on the stack."

In my case I have a double precision which will be converted to the double extended-precision
format.
Thus, I can imagine that there are some 64 bit long longs that will not be handled correctly.


Regards

Mathias


-- 
Mathias Koehrer
mathias_koehrer@domain.hid


Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT FÜR ALLE NEUEINSTEIGER
Jetzt bei Arcor: günstig und schnell mit DSL - das All-Inclusive-Paket
für clevere Doppel-Sparer, nur  29,95 Euro  inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2


  reply	other threads:[~2008-02-20 12:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20  9:50 [Xenomai-help] Atomic 64 bit write access on PCIe device Fillod Stephane
2008-02-20 12:50 ` M. Koehrer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-02-20 14:20 Fillod Stephane
2008-02-20  8:25 M. Koehrer
2008-02-20  8:55 ` Gilles Chanteperdrix
2008-02-20  9:19 ` Philippe Gerum

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=32609074.1203511813520.JavaMail.ngmail@domain.hid \
    --to=mathias_koehrer@domain.hid \
    --cc=stephane.fillod@domain.hid \
    --cc=xenomai@xenomai.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 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.