Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into clean
Browse files Browse the repository at this point in the history
  • Loading branch information
hensldm committed Aug 20, 2024
2 parents 6acaff6 + bf1f007 commit 978ba92
Show file tree
Hide file tree
Showing 102 changed files with 1,388 additions and 835 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install package requirements
run: sudo apt-get install -y build-essential python3
run: sudo apt-get install -y binutils-mips-linux-gnu build-essential python3

- name: Get extra dependencies
uses: actions/checkout@v3
Expand Down
16 changes: 3 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,9 @@ BUILD_AR := $(BUILD_DIR)/$(TARGET).a
WORKING_DIR := $(shell pwd)

CPP := cpp -P
AR := ar

VERSION_D := 1
VERSION_E := 2
VERSION_F := 3
VERSION_G := 4
VERSION_H := 5
VERSION_I := 6
VERSION_J := 7
VERSION_K := 8
VERSION_L := 9

VERSION_DEFINE := -DBUILD_VERSION=$(VERSION_$(VERSION)) -DBUILD_VERSION_STRING=\"2.0$(VERSION)\"
AR := $(CROSS)ar

VERSION_DEFINE := -DBUILD_VERSION=VERSION_$(VERSION) -DBUILD_VERSION_STRING=\"2.0$(VERSION)\"

ifeq ($(findstring _d,$(TARGET)),_d)
DEBUGFLAG := -D_DEBUG
Expand Down
31 changes: 18 additions & 13 deletions include/sys/asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,32 +83,37 @@ extern "C" {
#endif


#define NOP \
.set noreorder ;\
nop ;\
.set reorder

#define STAY1(stmnt) \
#define CACHE(op, reg) \
.set noreorder ;\
stmnt ;\
cache op, reg ;\
.set reorder

#define STAY2(stmnt, arg1) \
.set noreorder ;\
stmnt, arg1 ;\
#define MFC0(reg, op) \
.set noreorder ;\
mfc0 reg, op ;\
.set reorder

#define STAY3(stmnt, arg1, arg2) \
.set noreorder ;\
stmnt, arg1, arg2 ;\
#define MTC0(reg, op) \
.set noreorder ;\
mtc0 reg, op ;\
.set reorder

#define NOP \
.set noreorder ;\
nop ;\
#define CFC1(reg, op) \
.set noreorder ;\
cfc1 reg, op ;\
.set reorder

#define CACHE(op, reg) \
#define CTC1(reg, op) \
.set noreorder ;\
cache op, reg ;\
ctc1 reg, op ;\
.set reorder


#ifdef __cplusplus
}
#endif
Expand Down
20 changes: 10 additions & 10 deletions src/error/errorasm.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@

LEAF(__osError)
#if BUILD_VERSION < VERSION_J
lw t0,__osErrorHandler
beqz t0,1f
lw t0, __osErrorHandler
beqz t0, 1f
jr t0
#elif BUILD_VERSION < VERSION_K
lw t0,__kmc_pt_mode
bnez t0,_kmc_mode
lw t0, __kmc_pt_mode
bnez t0, _kmc_mode

lw t0,__osErrorHandler
beqz t0,1f
lw t0, __osErrorHandler
beqz t0, 1f
jr t0
_kmc_mode:
lw t0,__kmcErrorHandler
beqz t0,1f
lw t0, __kmcErrorHandler
beqz t0, 1f
jr t0
#else
lw t0,__osCommonHandler
beqz t0,1f
lw t0, __osCommonHandler
beqz t0, 1f
jr t0
#endif
1:
Expand Down
126 changes: 63 additions & 63 deletions src/gu/mtxcatf.c
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@

/*
* Copyright 1995, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
*
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
* States. Use of a copyright notice is precautionary only and does not
* imply publication or disclosure.
*
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
*
* THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
* INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
* PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
* GRAPHICS, INC.
*
*/

/*
* File: mtxcatf.c
* Creator: [email protected]
* Create Date: Thu Nov 2 13:03:02 PST 1995
*
*/

#include "guint.h"

void guMtxCatF(float mf[4][4], float nf[4][4], float res[4][4])
{
int i, j, k;
float temp[4][4];

for (i=0; i<4; i++) {
for (j=0; j<4; j++) {
temp[i][j] = 0.0;
for (k=0; k<4; k++) {
temp[i][j] += mf[i][k] * nf[k][j];
}
}
}

/* make sure we handle case where result is an input */
for (i=0; i<4; i++) {
for (j=0; j<4; j++) {
res[i][j] = temp[i][j];
}
}
}

void guMtxXFMF(float mf[4][4], float x, float y, float z, float *ox, float *oy, float *oz)
{
*ox = mf[0][0]*x + mf[1][0]*y + mf[2][0]*z + mf[3][0];
*oy = mf[0][1]*x + mf[1][1]*y + mf[2][1]*z + mf[3][1];
*oz = mf[0][2]*x + mf[1][2]*y + mf[2][2]*z + mf[3][2];
}

/*
* Copyright 1995, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
*
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
* States. Use of a copyright notice is precautionary only and does not
* imply publication or disclosure.
*
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
*
* THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
* INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
* PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
* GRAPHICS, INC.
*
*/

/*
* File: mtxcatf.c
* Creator: [email protected]
* Create Date: Thu Nov 2 13:03:02 PST 1995
*
*/

#include "guint.h"

void guMtxCatF(float mf[4][4], float nf[4][4], float res[4][4])
{
int i, j, k;
float temp[4][4];

for (i=0; i<4; i++) {
for (j=0; j<4; j++) {
temp[i][j] = 0.0;
for (k=0; k<4; k++) {
temp[i][j] += mf[i][k] * nf[k][j];
}
}
}

/* make sure we handle case where result is an input */
for (i=0; i<4; i++) {
for (j=0; j<4; j++) {
res[i][j] = temp[i][j];
}
}
}

void guMtxXFMF(float mf[4][4], float x, float y, float z, float *ox, float *oy, float *oz)
{
*ox = mf[0][0]*x + mf[1][0]*y + mf[2][0]*z + mf[3][0];
*oy = mf[0][1]*x + mf[1][1]*y + mf[2][1]*z + mf[3][1];
*oz = mf[0][2]*x + mf[1][2]*y + mf[2][2]*z + mf[3][2];
}

46 changes: 23 additions & 23 deletions src/gu/normalize.c
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/

#include "guint.h"

void guNormalize(float *x, float *y, float *z)
{
float m;

m = 1/sqrtf((*x)*(*x) + (*y)*(*y) + (*z)*(*z));
*x *= m;
*y *= m;
*z *= m;
}
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/

#include "guint.h"

void guNormalize(float *x, float *y, float *z)
{
float m;

m = 1/sqrtf((*x)*(*x) + (*y)*(*y) + (*z)*(*z));
*x *= m;
*y *= m;
*z *= m;
}
64 changes: 32 additions & 32 deletions src/gu/scale.c
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/

#include "guint.h"

void guScaleF(float mf[4][4], float x, float y, float z)
{
guMtxIdentF(mf);

mf[0][0] = x;
mf[1][1] = y;
mf[2][2] = z;
mf[3][3] = 1;
}

void guScale(Mtx *m, float x, float y, float z)
{
Matrix mf;

guScaleF(mf, x, y, z);

guMtxF2L(mf, m);
}
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/

#include "guint.h"

void guScaleF(float mf[4][4], float x, float y, float z)
{
guMtxIdentF(mf);

mf[0][0] = x;
mf[1][1] = y;
mf[2][2] = z;
mf[3][3] = 1;
}

void guScale(Mtx *m, float x, float y, float z)
{
Matrix mf;

guScaleF(mf, x, y, z);

guMtxF2L(mf, m);
}
Loading

0 comments on commit 978ba92

Please sign in to comment.