Irix 6.5.22 patches (32 or 64bit?)
#9
RE: Irix 6.5.22 patches (32 or 64bit?)
(12-09-2019, 11:02 PM)bjames Wrote:  I assumed all SGIs from that time were true 64bit machines.
Define 64bit machine. Maybe the name "N32" is misleading because it's a mix of 32bit pointers and 64bit data operations.

Using the N32 ABI, the O2 (and any other SGI with a CPU supporting MIPS IV) can operate on 64 bits of data at a time. It will not use 64bit pointers, but on a machine with 1GB max RAM capacity there is no point prefixing all addresses with 32 bits of zeros, right? It only eats up RAM, CPU cache and execution time. 

Consider this trivial program which multiplies two 64bit numbers:

Code:
#include <inttypes.h>
#include <stdio.h>

int main(void)
{
        uint64_t i=1234, j=5678;
        printf("1234 * 5678 = %llu\n", i * j);
        return 0;
}

Compile:

Code:
$ cc -Wall -n32 -S -o hello.s hello.c

The assembly includes these bits:

Code:
        addiu $6,$0,1234                #
        sd $6,0($sp)                    #  i

        addiu $5,$0,5678                #
        sd $5,8($sp)                    #  j

        ld $1,0($sp)                    #  i
        ld $2,8($sp)                    #  j
        dmultu $1,$2                    #

This assembly far from optimized, but it it were optimized it would skip the entire calculation Cool

The important one is the last instruction: dmultu

DMULTU Doubleword Multiply Unsigned

Description:(LO, HI)← rs× rt The 64-bit doubleword value in GPRrtis multiplied by the 64-bit value in GPRrs,treating both operands as unsigned values, to produce a 128-bit result.  The low-order64-bit doubleword of the result is placed into special register LO, and the high-order64-bit doubleword is placed into special register HI.


If you were to compile this code as mips I, or -32, you'll see that it doesn't use the multu instruction, but inserts a call to a special compiler support function __ll_mul() to do the multiplication instead, because there is no single instruction in that ABI that can do this.
jan-jaap
SGI Collector

Trade Count: (0)
Posts: 1,048
Threads: 37
Joined: Jun 2018
Location: Netherlands
Website Find Reply
12-10-2019, 08:46 AM


Messages In This Thread
Irix 6.5.22 patches (32 or 64bit?) - by marmotta - 12-08-2019, 06:23 PM
RE: Irix 6.5.22 patches (32 or 64bit?) - by Raion - 12-08-2019, 11:42 PM
RE: Irix 6.5.22 patches (32 or 64bit?) - by jpstewart - 12-09-2019, 12:57 AM
RE: Irix 6.5.22 patches (32 or 64bit?) - by marmotta - 12-09-2019, 04:21 AM
RE: Irix 6.5.22 patches (32 or 64bit?) - by jan-jaap - 12-09-2019, 12:54 PM
RE: Irix 6.5.22 patches (32 or 64bit?) - by marmotta - 12-09-2019, 01:45 PM
RE: Irix 6.5.22 patches (32 or 64bit?) - by jan-jaap - 12-09-2019, 02:09 PM
RE: Irix 6.5.22 patches (32 or 64bit?) - by bjames - 12-09-2019, 11:02 PM
RE: Irix 6.5.22 patches (32 or 64bit?) - by jan-jaap - 12-10-2019, 08:46 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)