public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: "Hideki Yamamoto" <hideki@hpc.bs1.fc.nec.co.jp>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] unalinged access by loadpair instruction
Date: Mon, 09 Dec 2002 14:28:45 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590709805518@msgid-missing> (raw)

 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#


             reply	other threads:[~2002-12-09 14:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-09 14:28 Hideki Yamamoto [this message]
2002-12-09 21:41 ` [Linux-ia64] unalinged access by loadpair instruction 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

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=marc-linux-ia64-105590709805518@msgid-missing \
    --to=hideki@hpc.bs1.fc.nec.co.jp \
    --cc=linux-ia64@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox