i80 data type

Dear all,

Is there anyone who knows well i80 data type? Is there any
corresponding data type
for X86 processor? uint80_t or int80_t for gcc?

PS. I found that the LLVM website is down!

Hi Hao Shen,

Is there anyone who knows well i80 data type? Is there any
corresponding data type
for X86 processor? uint80_t or int80_t for gcc?

no, there is no native processor support for i80. GCC does not have
a direct equivalent to i80. However if you declare a 80-bit wide C
bitfield, then arithmetic on it is done in 80 bits. For example,
here gcc should perform i3 arithmetic:

#include <stdio.h>

struct i3 { unsigned i:3; };

int main(void) {
   struct i3 A, B, C;

   A.i = 5;
   B.i = 5;
   C.i = A.i + B.i;
   printf("%d + %d = %d\n", A.i, B.i, C.i);
   return 0;
}

Hi Hao Shen,

Is there anyone who knows well i80 data type? Is there any
corresponding data type
for X86 processor? uint80_t or int80_t for gcc?

no, there is no native processor support for i80. GCC does not have
a direct equivalent to i80. However if you declare a 80-bit wide C
bitfield, then arithmetic on it is done in 80 bits. For example,
here gcc should perform i3 arithmetic:

#include <stdio.h>

struct i3 { unsigned i:3; };

int main(void) {
  struct i3 A, B, C;

  A.i = 5;
  B.i = 5;
  C.i = A.i + B.i;
  printf("%d + %d = %d\n", A.i, B.i, C.i);
  return 0;
}

OK, thanks a lot. I can understand how i80 works.
But why i80 appears in my byte-code? How to remove it
by using some passes?

Hi Hao Shen,

OK, thanks a lot. I can understand how i80 works.
But why i80 appears in my byte-code? How to remove it
by using some passes?

it may be created by the sroa (scalarrepl) pass which sometimes introduces
such registers when 10 bytes are being loaded from memory. Why do you want
to remove it?

Ciao,

Duncan.

Hi Hao Shen,

OK, thanks a lot. I can understand how i80 works.
But why i80 appears in my byte-code? How to remove it
by using some passes?

it may be created by the sroa (scalarrepl) pass which sometimes introduces
such registers when 10 bytes are being loaded from memory. Why do you want
to remove it?

In my research, I would to change all memory access into functional calls for
simuation usages. i80 is a type which hard to change into functional calls.