sim: ppc: drop host endian configure option
[deliverable/binutils-gdb.git] / sim / erc32 / exec.c
index fdac67bac87b71751eefdaec7073c9c47ef21b7b..d8a8c6c662b9fb075eaa019bfa411b83a1f1a0cc 100644 (file)
@@ -1,4 +1,7 @@
-/* Copyright (C) 1995-2015 Free Software Foundation, Inc.
+/* This file is part of SIS (SPARC instruction simulator)
+
+   Copyright (C) 1995-2021 Free Software Foundation, Inc.
+   Contributed by Jiri Gaisler, European Space Agency
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +16,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include "config.h"
+/* This must come before any other includes.  */
+#include "defs.h"
+
 #include "sis.h"
 #include <math.h>
 #include <stdio.h>
@@ -231,11 +236,7 @@ extern uint32 errtt, errftt;
 #endif
 
 static uint32
-sub_cc(psr, operand1, operand2, result)
-    uint32          psr;
-    int32           operand1;
-    int32           operand2;
-    int32           result;
+sub_cc(uint32 psr, int32 operand1, int32 operand2, int32 result)
 {
     psr = ((psr & ~PSR_N) | ((result >> 8) & PSR_N));
     if (result)
@@ -250,11 +251,7 @@ sub_cc(psr, operand1, operand2, result)
 }
 
 uint32
-add_cc(psr, operand1, operand2, result)
-    uint32          psr;
-    int32           operand1;
-    int32           operand2;
-    int32           result;
+add_cc(uint32 psr, int32 operand1, int32 operand2, int32 result)
 {
     psr = ((psr & ~PSR_N) | ((result >> 8) & PSR_N));
     if (result)
@@ -269,9 +266,7 @@ add_cc(psr, operand1, operand2, result)
 }
 
 static void
-log_cc(result, sregs)
-    int32           result;
-    struct pstate  *sregs;
+log_cc(int32 result, struct pstate *sregs)
 {
     sregs->psr &= ~(PSR_CC);   /* Zero CC bits */
     sregs->psr = (sregs->psr | ((result >> 8) & PSR_N));
@@ -395,8 +390,7 @@ extract_byte_signed (uint32 data, uint32 address)
 }
 
 int
-dispatch_instruction(sregs)
-    struct pstate  *sregs;
+dispatch_instruction(struct pstate *sregs)
 {
 
     uint32          cwp, op, op2, op3, asi, rd, cond, rs1,
@@ -1668,9 +1662,7 @@ dispatch_instruction(sregs)
 
 
 static int
-fpexec(op3, rd, rs1, rs2, sregs)
-    uint32          op3, rd, rs1, rs2;
-    struct pstate  *sregs;
+fpexec(uint32 op3, uint32 rd, uint32 rs1, uint32 rs2, struct pstate *sregs)
 {
     uint32          opf, tem, accex;
     int32           fcc;
@@ -1725,7 +1717,7 @@ fpexec(op3, rd, rs1, rs2, sregs)
     /* SPARC is big-endian - swap double floats if host is little-endian */
     /* This is ugly - I know ... */
 
-    /* FIXME: should use (CURRENT_HOST_BYTE_ORDER == CURRENT_TARGET_BYTE_ORDER)
+    /* FIXME: should use (HOST_BYTE_ORDER == CURRENT_TARGET_BYTE_ORDER)
        but what about machines where float values are different endianness
        from integer values? */
 
@@ -1949,10 +1941,7 @@ fpexec(op3, rd, rs1, rs2, sregs)
 }
 
 static int
-chk_asi(sregs, asi, op3)
-    struct pstate  *sregs;
-    uint32 *asi, op3;
-
+chk_asi(struct pstate *sregs, uint32 *asi, uint32 op3)
 {
     if (!(sregs->psr & PSR_S)) {
        sregs->trap = TRAP_PRIVI;
@@ -1966,8 +1955,7 @@ chk_asi(sregs, asi, op3)
 }
 
 int
-execute_trap(sregs)
-    struct pstate  *sregs;
+execute_trap(struct pstate *sregs)
 {
     int32           cwp;
 
@@ -2014,8 +2002,7 @@ execute_trap(sregs)
 extern struct irqcell irqarr[16];
 
 int
-check_interrupts(sregs)
-    struct pstate  *sregs;
+check_interrupts(struct pstate *sregs)
 {
 #ifdef ERRINJ
     if (errtt) {
@@ -2037,8 +2024,7 @@ check_interrupts(sregs)
 }
 
 void
-init_regs(sregs)
-    struct pstate  *sregs;
+init_regs(struct pstate *sregs)
 {
     sregs->pc = 0;
     sregs->npc = 4;
This page took 0.025635 seconds and 4 git commands to generate.