[openib-general] Re: ANNOUNCE: First usable version of userspace verbs

Roland Dreier roland at topspin.com
Thu Feb 24 11:39:48 PST 2005


Just for kicks, I compiled this code for ia64 and sparc64:

    struct foo { int a; };
    struct bar { int b; } __attribute__((packed));

    int c(struct foo *x) { return x->a; }
    int d(struct bar *x) { return x->b; }

The ia64 assembly for d() does not look pretty:

    0000000000000000 <c>:
       0:	0a 10 00 18 00 21 	[MMI]       mov r2=r12;;
       6:	00 00 09 30 23 00 	            st8 [r2]=r32
       c:	00 00 04 00       	            nop.i 0x0
      10:	0b 70 00 04 18 10 	[MMI]       ld8 r14=[r2];;
      16:	e0 00 38 20 20 00 	            ld4 r14=[r14]
      1c:	00 00 04 00       	            nop.i 0x0;;
      20:	11 40 00 1c 00 21 	[MIB]       mov r8=r14
      26:	c0 00 08 00 42 80 	            mov r12=r2
      2c:	08 00 84 00       	            br.ret.sptk.many b0;;

    0000000000000030 <d>:
      30:	0a 10 00 18 00 21 	[MMI]       mov r2=r12;;
      36:	00 00 09 30 23 00 	            st8 [r2]=r32
      3c:	00 00 04 00       	            nop.i 0x0
      40:	0b 78 00 04 18 10 	[MMI]       ld8 r15=[r2];;
      46:	00 01 3c 00 20 c0 	            ld1 r16=[r15]
      4c:	11 78 00 84       	            adds r14=1,r15;;
      50:	0b 70 00 1c 00 10 	[MMI]       ld1 r14=[r14];;
      56:	00 00 00 02 00 c0 	            nop.m 0x0
      5c:	e1 b8 dd 53       	            shl r14=r14,8;;
      60:	0d 80 40 1c 0e 20 	[MFI]       or r16=r16,r14
      66:	00 00 00 02 00 c0 	            nop.f 0x0
      6c:	21 78 00 84       	            adds r14=2,r15;;
      70:	0b 70 00 1c 00 10 	[MMI]       ld1 r14=[r14];;
      76:	00 00 00 02 00 c0 	            nop.m 0x0
      7c:	e1 78 bd 53       	            shl r14=r14,16;;
      80:	0d 80 40 1c 0e 20 	[MFI]       or r16=r16,r14
      86:	00 00 00 02 00 c0 	            nop.f 0x0
      8c:	31 78 00 84       	            adds r14=3,r15;;
      90:	0b 70 00 1c 00 10 	[MMI]       ld1 r14=[r14];;
      96:	00 00 00 02 00 c0 	            nop.m 0x0
      9c:	e1 38 9d 53       	            shl r14=r14,24;;
      a0:	0b 70 40 1c 0e 20 	[MMI]       or r14=r16,r14;;
      a6:	00 00 00 02 00 c0 	            nop.m 0x0
      ac:	e1 f8 7c 53       	            shl r14=r14,32;;
      b0:	02 00 00 00 01 00 	[MII]       nop.m 0x0
      b6:	e0 08 3a 3e 29 00 	            shr r14=r14,32;;
      bc:	01 70 00 84       	            mov r8=r14
      c0:	1d 60 00 04 00 21 	[MFB]       mov r12=r2
      c6:	00 00 00 02 00 80 	            nop.f 0x0
      cc:	08 00 84 00       	            br.ret.sptk.many b0;;

On sparc64, d() looks similarly terrible:

    0000000000000000 <c>:
       0:	9d e3 bf 40 	save  %sp, -192, %sp
       4:	f0 77 a8 7f 	stx  %i0, [ %fp + 0x87f ]
       8:	c2 5f a8 7f 	ldx  [ %fp + 0x87f ], %g1
       c:	c2 00 40 00 	ld  [ %g1 ], %g1
      10:	83 38 60 00 	sra  %g1, 0, %g1
      14:	b0 10 00 01 	mov  %g1, %i0
      18:	81 cf e0 08 	rett  %i7 + 8
      1c:	01 00 00 00 	nop 

    0000000000000020 <d>:
      20:	9d e3 bf 40 	save  %sp, -192, %sp
      24:	f0 77 a8 7f 	stx  %i0, [ %fp + 0x87f ]
      28:	c4 5f a8 7f 	ldx  [ %fp + 0x87f ], %g2
      2c:	c2 08 80 00 	ldub  [ %g2 ], %g1
      30:	82 08 60 ff 	and  %g1, 0xff, %g1
      34:	87 28 70 18 	sllx  %g1, 0x18, %g3
      38:	c2 08 a0 01 	ldub  [ %g2 + 1 ], %g1
      3c:	82 08 60 ff 	and  %g1, 0xff, %g1
      40:	83 28 70 10 	sllx  %g1, 0x10, %g1
      44:	86 10 40 03 	or  %g1, %g3, %g3
      48:	c2 08 a0 02 	ldub  [ %g2 + 2 ], %g1
      4c:	82 08 60 ff 	and  %g1, 0xff, %g1
      50:	83 28 70 08 	sllx  %g1, 8, %g1
      54:	86 10 40 03 	or  %g1, %g3, %g3
      58:	c2 08 a0 03 	ldub  [ %g2 + 3 ], %g1
      5c:	82 08 60 ff 	and  %g1, 0xff, %g1
      60:	82 10 40 03 	or  %g1, %g3, %g1
      64:	83 28 70 20 	sllx  %g1, 0x20, %g1
      68:	83 38 70 20 	srax  %g1, 0x20, %g1
      6c:	83 38 60 00 	sra  %g1, 0, %g1
      70:	b0 10 00 01 	mov  %g1, %i0
      74:	81 cf e0 08 	rett  %i7 + 8
      78:	01 00 00 00 	nop 




More information about the general mailing list