public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] unalinged access by loadpair instruction
@ 2002-12-09 14:28 Hideki Yamamoto
  2002-12-09 21:41 ` David Mosberger
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Hideki Yamamoto @ 2002-12-09 14:28 UTC (permalink / raw)
  To: linux-ia64

 Hi everyone,

 When unaligned access is happened by loadpair
 instruction, reloading by kernel is wrong.
 
 When unalined access is happeded by loadpair
 instruction in NORMAL loop, it is no problem.
 Please try to run the attached programs(c.c and a.s) 
 compiled by gcc.

 However, When it is happned by loadpair instruction in
 SWP loop, it fails to reload the data.
 Please try to run the attached programs(c.c and aa.s)
 compiled by gcc. aa.s is included loadpair in SWP loop.
 If there is no happening, please change the n
 parameter to bigger number.

 Sorry, I could not isolate whether or not it is caused
 by HW bug or Kernel problem.

 Let me know somebody understood the cause why it is happened.

 Thanks.

-- c.c
#define n 100
    double d[n],d2[n+1];
main() {
    int i,j;

    for( i = 0; i < n; i++ ) {
        d[i] = 123.0;
        d2[i] = 0.0;
    }
    // verify
    for( i = 0; i < n; i++ ) {
        if( d[i] != 123.0 ) {
            printf("Assignment to d[%d] is wrong\n", i);
            exit(-1);
        }
    }
    printf("Verify is ok\n");
    copy_by_loadpair(&d, &d2, n);
    for( i = 0; i < n; i++ ) {
        if( d2[i] != 123.0 ) {
            printf("Something is wrong!!\n d2[%d] = %f(should be d[%d]=%f)\n", i, d2[i], i, d[i]);
            printf("%f\n", d2[i+1]);
        }
    }
}

-- a.s 
	.file	"a.c"
	.pred.safe_across_calls p1-p5,p16-p63
.text
	.align 16
	.global copy_by_loadpair#
	.proc copy_by_loadpair#
copy_by_loadpair:
 {   .mmi
        alloc   r8=ar.pfs,3,0,0,0 ;;                     //0:  1   19
        nop.m   0
        add     r17=1,r0
 }
L1:
 {   .mii
        ldfpd   f6,f7=[r32]                                 //1:  2    4
        add     r2=8,r33                                 //1:  3    8
        nop.i   0
 }
 {   .mmi
        nop.m   0 ;;                              //1:  3    6
        stfd    [r33]ö
        add     r33=8,r33
 }
 {   .mmi
        nop.m   0 ;;                               //10:  3    7
        stfd    [r2]÷                                  //19:  3    9
        add     r32=8,r32;;
 }
 {   .mib
        cmp4.ne p8,p0=r17,r34
        add     r17=1,r17
  (p8)  br.cond.dpnt.many       L1 ;;                 //7:  3   19
 }
 {   .mib
        nop.m   0
        nop.i   0
        br.ret.sptk.many        b0 ;;                    //19:  4   10
 }
	.endp get_by_loadpair#
--
	.file	"a.c"
	.pred.safe_across_calls p1-p5,p16-p63
.text
	.align 16
	.global copy_by_loadpair#
	.proc copy_by_loadpair#
copy_by_loadpair:
 {   .mmi
        alloc   r8=ar.pfs,3,6,0,0 ;;
        nop.m   0
        add     r17=1,r0
 }
 {   .mmi
        add     r15=0,r32
        add     r2=0,r33
        add     r3=8,r33;;
 }
 {   .mii
        nop.m   0
        mov     ar.lc=r34
        nop.i   0 ;;
 }
 {   .mii
        nop.m   0
        mov     pr.rot=0x10000 ;;
        mov     ar.ec=5 ;;
 }
L1:
 {   .mmi
  (p16) ldfpd   f32,f33=[r15]
  (p16) add     r15=8,r15
        nop.i   0
 }
 {   .mmb
  (p20) stfd    [r3]ó7,8
        //nop.m   0
  (p20) stfd    [r2]ó6,8
        br.ctop.sptk    L1
 }
 {   .mib
        nop.m   0
        nop.i   0
        br.ret.sptk.many        b0 ;;                    //19:  4   10
 }
	.endp get_by_loadpair#


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-12-11  7:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-09 14:28 [Linux-ia64] unalinged access by loadpair instruction Hideki Yamamoto
2002-12-09 21:41 ` David Mosberger
2002-12-09 22:59 ` Luck, Tony
2002-12-10  2:33 ` David Mosberger
2002-12-10 11:12 ` Hideki Yamamoto
2002-12-10 12:18 ` 
2002-12-11  7:26 ` Hideki Yamamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox