From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 2C1DC2EFE2 for ; Tue, 26 Sep 2000 05:39:51 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.8.7/8.8.7) id FAA24519 for axp-list@listman.redhat.com; Tue, 26 Sep 2000 05:39:51 -0400 Received: from utep.el.utwente.nl (root@utep.el.utwente.nl [130.89.30.10]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id FAA24515 for ; Tue, 26 Sep 2000 05:39:50 -0400 Received: from tn.utwente.nl (uttnb55.tn.utwente.nl [130.89.74.55]) by utep.el.utwente.nl (8.9.3/8.9.3) with ESMTP id LAA26662 for ; Tue, 26 Sep 2000 11:42:25 +0200 Message-ID: <39D06F36.795D21FB@tn.utwente.nl> Date: Tue, 26 Sep 2000 11:41:10 +0200 From: "Andrei A. Dergatchev" X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en,ru MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Weird Compaq CCC / GCC interaction ? References: <010C86D15E4D1247B9A5DD312B7F5AA70BEC27@stegosaurus.bristol.quadrics.com> Content-Type: multipart/alternative; boundary="------------F6353A8BDDB8B9451996078F" X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors --------------F6353A8BDDB8B9451996078F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, Well, while US members of our list are not available yet, here are my humble comments. IMHO this question has little to do with C programming skills :-) Man, you're opening up a huge can of worms - linking obj files made with entirely different compilers and moreover passing unsigned ints from one to another (in C, functions return int by default). Personally, I wouldn't even expect to get it 100% working at first time. > fn_gcc.o: file format elf64-alpha Disassembly of section > .text: 0000000000000000 : > 0: 0f c0 1f 20 lda v0,-16369(zero) > 4: 10 c0 00 24 ldah v0,-16368(v0) > 8: 20 f6 01 48 zapnot v0,0xf,v0 > c: 01 80 fa 6b ret zero,(ra),0x1 > ... > objdump -d fn_ccc.o fn_ccc.o: file format elf64-alpha Disassembly > of section .text: 0000000000000000 : > 0: 10 c0 1f 24 ldah v0,-16368(zero) > 4: 1f 04 ff 47 nop > 8: 0f c0 00 20 lda v0,-16369(v0) > c: 01 80 fa 6b ret zero,(ra),0x1 > > AD> To me it seems that returned results are different in these 2 > cases. > GCC is inserting a ZAPNOT instruction to zero the top 4-bytes - is > this correct ?Or is the main code compilation that is broken, I notice > that ccc uses 'xor' to do the compare whereas gcc uses 'cmpeq' ? > Alpha Assembly Language Programmer's Guide says that cmpeq compares two *64-bit* values. I would look into that. > Cheers, > Addy. Rgds, Andrei --------------F6353A8BDDB8B9451996078F Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi,

Well, while US members of our list are not available yet, here are my humble
comments.

IMHO this question has little to do with C programming skills :-)
Man, you're opening up a huge can of worms - linking obj files made
with entirely different compilers and moreover passing unsigned ints
from one to another (in C, functions return int by default).
Personally, I wouldn't even expect to get it 100% working at first time.

 fn_gcc.o:     file format elf64-alpha Disassembly of section .text: 0000000000000000 <fn>:
   0:   0f c0 1f 20     lda     v0,-16369(zero)
   4:   10 c0 00 24     ldah    v0,-16368(v0)
   8:   20 f6 01 48     zapnot  v0,0xf,v0
   c:   01 80 fa 6b     ret     zero,(ra),0x1
        ...
 objdump -d fn_ccc.o fn_ccc.o:     file format elf64-alpha Disassembly of section .text: 0000000000000000 <fn>:
   0:   10 c0 1f 24     ldah    v0,-16368(zero)
   4:   1f 04 ff 47     nop
   8:   0f c0 00 20     lda     v0,-16369(v0)
   c:   01 80 fa 6b     ret     zero,(ra),0x1

AD> To me it seems that returned results are different in these 2 cases.
  GCC is inserting a ZAPNOT instruction to zero the top 4-bytes - is this correct ?Or is the main code compilation that is broken, I notice that ccc uses 'xor' to do the compare whereas gcc uses 'cmpeq' ?
 

Alpha Assembly Language Programmer's Guide says that cmpeq compares
two *64-bit* values. I would look into that.

> Cheers,
> Addy.

Rgds,

Andrei
  --------------F6353A8BDDB8B9451996078F--