bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PA-RISC 2.0 fldw instruction (formats 43 and 44)


From: John David Anglin
Subject: PA-RISC 2.0 fldw instruction (formats 43 and 44)
Date: Sun, 19 May 2002 19:47:57 -0400 (EDT)

The following code does not link and execute correctly under hppa-linux:

        .LEVEL 2.0
        .text
        .align 4
.globl f
                .type            f,@function
f:
        .PROC
        .CALLINFO FRAME=0,NO_CALLS
        .ENTRY
        stw %r25,-16(%r30)
        stw %r26,-12(%r30)
        fldd -16(%r30),%fr23
        fcpy,sgl %fr0,%fr22L
        addil LR'a-$global$,%r27
        fldw RR'a-$global$(%r1),%fr22R
        xmpyu %fr22R,%fr23R,%fr25
        xmpyu %fr23R,%fr22L,%fr24
        fstd %fr25,-16(%r30)
        xmpyu %fr22R,%fr23L,%fr23
        ldw -16(%r30),%r28
        ldw -12(%r30),%r29
        fstw %fr23R,-16(%r30)
        ldw -16(%r30),%r19
        add,l %r28,%r19,%r28
        fstw %fr24R,-16(%r30)
        ldw -16(%r30),%r19
        bve (%r2)
        add,l %r28,%r19,%r28
        .EXIT
        .PROCEND
.Lfe1:
        .size   f,.Lfe1-f
        .section        .rodata.str1.4,"aMS",@progbits,1
        .align 4
.LC0:
.stringz"%lld\n"
        .text
        .align 4
.globl main
                .type            main,@function
main:
        .PROC
        .CALLINFO FRAME=64,CALLS,SAVE_RP
        .ENTRY
        stw %r2,-20(%r30)
        ldo 64(%r30),%r30
        ldi 2,%r19
        addil LR'a-$global$,%r27
        ldi 23,%r25
        ldil L'1215752192,%r26
        b,l f,%r2
        stw %r19,RR'a-$global$(%r1)
        ldil LR'.LC0,%r26
        copy %r28,%r23
        copy %r29,%r24
        b,l printf,%r2
        ldo RR'.LC0(%r26),%r26
        ldw -84(%r30),%r2
        copy %r19,%r28
        bve (%r2)
        ldo -64(%r30),%r30
        .EXIT
        .PROCEND
.Lfe2:
        .size   main,.Lfe2-main
        .local  a
        .comm   a,4,4
        .ident  "GCC: (GNU) 3.2 20020517 (experimental)"

The problem is the R_PARISC_DPREL14R relocation clobbers the "t" bit
in the insn.  We have this in the .o file

  14:   5c 36 00 02     fldw 0(r1),fr22R
                        14: R_PARISC_DPREL14R   a

but we lose the "t" bit (bit 30) in the insn when the code is linked

   1043c:       5c 36 02 68     fldw 134(r1),fr22

Note this code is intended to run in narrow 32-bit mode.

Dave
-- 
J. David Anglin                                  address@hidden
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]