jnp Assembler

Manfred Hansen m.hansen at kielnet.net
Tue Jun 5 09:12:08 PDT 2007


Hello,

the following programm runs with dmd but didn't with gdc .
 
import tango.io.Stdout;

real sin(real x)
{
        asm {
                fld x;
                fsin;
                sahf;
                jnp Lret;
        }
        end:
                return real.nan;
        Lret:
                ;
}
void main() {
        real r = sin(1);
        Stdout(r);
}

hansen at hansen-lx:~/dd/tango$ rebuild fsin_gdc.d
./nmd_fsin_gdc.o: In function `_D8fsin_gdc3sinFeZe':
fsin_gdc.d:(.text+0xe): undefined reference to `.LDASM1'
collect2: ld returned 1 exit status

I think the problem is the "jnp Lret; command.


I also looked in Math.d for tangens from tango. 

real tan(real x)
{
    version (GNU) {
        return tanl(x);
    } else {
    asm
    {
    fld x[EBP]          ; // load theta
    ...
They make a difference between dmd and gdc Compiler.
(In Phobos not)

Is a jump outside the asm block not possible with gdc?
 
Manfred

 



More information about the D.gnu mailing list