Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Andrei A. Dergatchev" <A.Dergatchev@tn.utwente.nl>
To: axp-list@redhat.com
Subject: Re: Weird Compaq CCC / GCC interaction ?
Date: Tue, 26 Sep 2000 11:41:10 +0200	[thread overview]
Message-ID: <39D06F36.795D21FB@tn.utwente.nl> (raw)
In-Reply-To: 010C86D15E4D1247B9A5DD312B7F5AA70BEC27@stegosaurus.bristol.quadrics.com

[-- Attachment #1: Type: text/plain, Size: 1464 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 3329 bytes --]

  reply	other threads:[~2000-09-26  9:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-26  8:55 Weird Compaq CCC / GCC interaction ? David Addison
2000-09-26  9:41 ` Andrei A. Dergatchev [this message]
2000-09-26 10:12 ` Nikita Schmidt
2000-09-26 16:02   ` Michal Jaegermann
2000-09-26 12:23 ` Ivan Kokshaysky
2000-09-26 13:57 ` Ivan Kokshaysky
  -- strict thread matches above, loose matches on Subject: below --
2000-09-26 13:59 David Addison
2000-09-26 15:36 ` Ivan Kokshaysky
2000-09-26 17:25 Larry Sendlosky
2000-09-26 18:01 ` Michal Jaegermann
2000-09-27  3:17 ` Richard Henderson
2000-09-26 17:47 David Addison
2000-09-26 18:52 Larry Sendlosky
read-only archive

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