mirror of
https://github.com/lcbcFoo/ReonV.git
synced 2025-04-18 18:44:43 -04:00
Prepering for benchmarks
This commit is contained in:
parent
4c56d9eb49
commit
81154e0ef9
192 changed files with 15254 additions and 2375 deletions
|
@ -27,12 +27,13 @@ CFLAGS=-nostdlib
|
|||
OBJCPFLAGS=-O binary -j .text -j .data
|
||||
LD_SCRIPT=ld_script
|
||||
WRAP=-Wl,-wrap,exit,-wrap,open,-wrap,close,-wrap,write,-wrap,read,-wrap,lseek,-wrap,sbrk
|
||||
TEST_FILES = $(wildcard acstone/*.c)
|
||||
TEST_PROGS = $(patsubst %.c,%.out,$(TEST_FILES))
|
||||
|
||||
#####################################################################
|
||||
################################################################################
|
||||
#
|
||||
# Targets for Makefile
|
||||
# Targets for compiling
|
||||
#
|
||||
#####################################################################
|
||||
# Compiled binary linked with reonv_crt0
|
||||
%.out : %.c reonv_crt0.o posix.o console.o
|
||||
${CROSS}${CC} -static -march=rv32i ${WRAP} -T${LD_SCRIPT} $< -o $@
|
||||
|
@ -62,6 +63,10 @@ reonv_crt0.o : reonv_crt0.S
|
|||
%.bin : %.hex
|
||||
${CROSS}$(OBJCOPY) $(OBJCPFLAGS) $< $@
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Boot Code
|
||||
#
|
||||
# Adapted PROM generation based on original leon3 script (found at ../bin)
|
||||
ahbrom.vhd : ahbrom boot_code.bin
|
||||
./ahbrom boot_code.bin ahbrom.vhd
|
||||
|
@ -74,4 +79,11 @@ ahbrom : ../bin/ahbrom.c
|
|||
gcc ../bin/ahbrom.c -o ahbrom
|
||||
|
||||
clean:
|
||||
rm -rf ahbrom* *.hex *.inv *.bin *.o *.log *.jou *.str
|
||||
rm -rf ahbrom* *.hex *.inv *.bin *.o *.log *.jou *.str acstone/*.out
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Run tests
|
||||
#
|
||||
# Create test programs
|
||||
build_tests: ${TEST_PROGS}
|
||||
|
|
45
riscv/acstone/000.main.c
Normal file
45
riscv/acstone/000.main.c
Normal file
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* @file 000.main.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
71
riscv/acstone/011.const.c
Normal file
71
riscv/acstone/011.const.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file 011.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed char and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed char c;
|
||||
|
||||
c=0x55;
|
||||
/* After c is 85 */
|
||||
|
||||
/* Before c is 85 */ c=0xAA;
|
||||
/* After c is -86 */
|
||||
|
||||
/* Before c is -86 */ c=0x00;
|
||||
/* After c is 0 */
|
||||
|
||||
/* Before c is 0 */ c=0xFF;
|
||||
/* After c is -1 */
|
||||
|
||||
/* Before c is -1 */ c=0x80;
|
||||
/* After c is -128 */
|
||||
|
||||
/* Before c is -128 */ c=0x01;
|
||||
/* After c is 1 */
|
||||
|
||||
/* Before c is 1 */ c=0x7F;
|
||||
/* After c is 127 */
|
||||
|
||||
/* Before c is 127 */ c=0xFE;
|
||||
/* After c is -2 */
|
||||
|
||||
/* Before c is -2 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
71
riscv/acstone/012.const.c
Normal file
71
riscv/acstone/012.const.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file 012.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned char and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned char uc;
|
||||
|
||||
uc=0x55;
|
||||
/* After uc is 85 */
|
||||
|
||||
/* Before uc is 85 */ uc=0xAA;
|
||||
/* After uc is 170 */
|
||||
|
||||
/* Before uc is 170 */ uc=0x00;
|
||||
/* After uc is 0 */
|
||||
|
||||
/* Before uc is 0 */ uc=0xFF;
|
||||
/* After uc is 255 */
|
||||
|
||||
/* Before uc is 255 */ uc=0x80;
|
||||
/* After uc is 128 */
|
||||
|
||||
/* Before uc is 128 */ uc=0x01;
|
||||
/* After uc is 1 */
|
||||
|
||||
/* Before uc is 1 */ uc=0x7F;
|
||||
/* After uc is 127 */
|
||||
|
||||
/* Before uc is 127 */ uc=0xFE;
|
||||
/* After uc is 254 */
|
||||
|
||||
/* Before uc is 254 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
71
riscv/acstone/013.const.c
Normal file
71
riscv/acstone/013.const.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file 013.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed short int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed short int si;
|
||||
|
||||
si=0x5555;
|
||||
/* After si is 21845 */
|
||||
|
||||
/* Before si is 21845 */ si=0xAAAA;
|
||||
/* After si is -21846 */
|
||||
|
||||
/* Before si is -21846 */ si=0x0000;
|
||||
/* After si is 0 */
|
||||
|
||||
/* Before si is 0 */ si=0xFFFF;
|
||||
/* After si is -1 */
|
||||
|
||||
/* Before si is -1 */ si=0x8000;
|
||||
/* After si is -32768 */
|
||||
|
||||
/* Before si is -32768 */ si=0x0001;
|
||||
/* After si is 1 */
|
||||
|
||||
/* Before si is 1 */ si=0x7FFF;
|
||||
/* After si is 32767 */
|
||||
|
||||
/* Before si is 32767 */ si=0xFFFE;
|
||||
/* After si is -2 */
|
||||
|
||||
/* Before si is -2 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
71
riscv/acstone/014.const.c
Normal file
71
riscv/acstone/014.const.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file 014.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned short int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned short int usi;
|
||||
|
||||
usi=0x5555;
|
||||
/* After usi is 21845 */
|
||||
|
||||
/* Before usi is 21845 */ usi=0xAAAA;
|
||||
/* After usi is 43690 */
|
||||
|
||||
/* Before usi is 43690 */ usi=0x0000;
|
||||
/* After usi is 0 */
|
||||
|
||||
/* Before usi is 0 */ usi=0xFFFF;
|
||||
/* After usi is 65535 */
|
||||
|
||||
/* Before usi is 65535 */ usi=0x8000;
|
||||
/* After usi is 32768 */
|
||||
|
||||
/* Before usi is 32768 */ usi=0x0001;
|
||||
/* After usi is 1 */
|
||||
|
||||
/* Before usi is 1 */ usi=0x7FFF;
|
||||
/* After usi is 32767 */
|
||||
|
||||
/* Before usi is 32767 */ usi=0xFFFE;
|
||||
/* After usi is 65534 */
|
||||
|
||||
/* Before usi is 65534 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
70
riscv/acstone/015.const.c
Normal file
70
riscv/acstone/015.const.c
Normal file
|
@ -0,0 +1,70 @@
|
|||
/**
|
||||
* @file 015.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed int i;
|
||||
i=0x55555555;
|
||||
/* After i is 1431655765 */
|
||||
|
||||
/* Before i is 1431655765 */ i=0xAAAAAAAA;
|
||||
/* After i is -1431655766 */
|
||||
|
||||
/* Before i is -1431655766 */ i=0x00000000;
|
||||
/* After i is 0 */
|
||||
|
||||
/* Before i is 0 */ i=0xFFFFFFFF;
|
||||
/* After i is -1 */
|
||||
|
||||
/* Before i is -1 */ i=0x80000000;
|
||||
/* After i is -2147483648 */
|
||||
|
||||
/* Before i is -2147483648 */ i=0x00000001;
|
||||
/* After i is 1 */
|
||||
|
||||
/* Before i is 1 */ i=0x7FFFFFFF;
|
||||
/* After i is 2147483647 */
|
||||
|
||||
/* Before i is 2147483647 */ i=0xFFFFFFFE;
|
||||
/* After i is -2 */
|
||||
|
||||
/* Before i is -2 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
71
riscv/acstone/016.const.c
Normal file
71
riscv/acstone/016.const.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file 016.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned int ui;
|
||||
|
||||
ui=0x55555555;
|
||||
/* After ui is 1431655765 */
|
||||
|
||||
/* Before ui is 1431655765 */ ui=0xAAAAAAAA;
|
||||
/* After ui is 2863311530 */
|
||||
|
||||
/* Before ui is 2863311530 */ ui=0x00000000;
|
||||
/* After ui is 0 */
|
||||
|
||||
/* Before ui is 0 */ ui=0xFFFFFFFF;
|
||||
/* After ui is 4294967295 */
|
||||
|
||||
/* Before ui is 4294967295 */ ui=0x80000000;
|
||||
/* After ui is 2147483648 */
|
||||
|
||||
/* Before ui is 2147483648 */ ui=0x00000001;
|
||||
/* After ui is 1 */
|
||||
|
||||
/* Before ui is 1 */ ui=0x7FFFFFFF;
|
||||
/* After ui is 2147483647 */
|
||||
|
||||
/* Before ui is 2147483647 */ ui=0xFFFFFFFE;
|
||||
/* After ui is 4294967294 */
|
||||
|
||||
/* Before ui is 4294967294 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
71
riscv/acstone/017.const.c
Normal file
71
riscv/acstone/017.const.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file 017.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed long long int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed long long int li;
|
||||
|
||||
li=0x5555555555555555LL;
|
||||
/* After li is 6148914691236517205 */
|
||||
|
||||
/* Before li is 6148914691236517205 */ li=0xAAAAAAAAAAAAAAAALL;
|
||||
/* After li is -6148914691236517206 */
|
||||
|
||||
/* Before li is -6148914691236517206 */ li=0x0000000000000000LL;
|
||||
/* After li is 0 */
|
||||
|
||||
/* Before li is 0 */ li=0xFFFFFFFFFFFFFFFFLL;
|
||||
/* After li is -1 */
|
||||
|
||||
/* Before li is -1 */ li=0x8000000000000000LL;
|
||||
/* After li is -9223372036854775808 */
|
||||
|
||||
/* Before li is -9223372036854775808 */ li=0x0000000000000001LL;
|
||||
/* After li is 1 */
|
||||
|
||||
/* Before li is 1 */ li=0x7FFFFFFFFFFFFFFFLL;
|
||||
/* After li is 9223372036854775807 */
|
||||
|
||||
/* Before li is 9223372036854775807 */ li=0xFFFFFFFFFFFFFFFELL;
|
||||
/* After li is -2 * /
|
||||
|
||||
/* Before li is -2 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
71
riscv/acstone/018.const.c
Normal file
71
riscv/acstone/018.const.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file 018.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned long long int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned long long int uli;
|
||||
|
||||
uli=0x5555555555555555ULL;
|
||||
/* After uli is 6148914691236517205 */
|
||||
|
||||
/* Before uli is 6148914691236517205 */ uli=0xAAAAAAAAAAAAAAAAULL;
|
||||
/* After uli is 12297829382473034410 */
|
||||
|
||||
/* Before uli is 12297829382473034410 */ uli=0x0000000000000000ULL;
|
||||
/* After uli is 0 */
|
||||
|
||||
/* Before uli is 0 */ uli=0xFFFFFFFFFFFFFFFFULL;
|
||||
/* After uli is 18446744073709551615 */
|
||||
|
||||
/* Before uli is 18446744073709551615 */ uli=0x8000000000000000ULL;
|
||||
/* After uli is 9223372036854775808 */
|
||||
|
||||
/* Before uli is 9223372036854775808 */ uli=0x0000000000000001ULL;
|
||||
/* After uli is 1 */
|
||||
|
||||
/* Before uli is 1 */ uli=0x7FFFFFFFFFFFFFFFULL;
|
||||
/* After uli is 9223372036854775807 */
|
||||
|
||||
/* Before uli is 9223372036854775807 */ uli=0xFFFFFFFFFFFFFFFEULL;
|
||||
/* After uli is 18446744073709551614 * /
|
||||
|
||||
/* Before uli is 18446744073709551614 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
67
riscv/acstone/021.cast.c
Normal file
67
riscv/acstone/021.cast.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* @file 021.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main that uses cast signed char to signed short int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int si;
|
||||
signed char c;
|
||||
|
||||
si=0;
|
||||
c=0x01;
|
||||
si=c;
|
||||
|
||||
/* Before si must be 1 */ si=0;
|
||||
c=0xFF;
|
||||
si=c;
|
||||
|
||||
/* Before si must be -1 */ si=0;
|
||||
c=0x80;
|
||||
si=c;
|
||||
|
||||
/* Before si must be -128 */ si=0;
|
||||
c=0x7F;
|
||||
si=c;
|
||||
|
||||
/* Before si must be 127 */ si=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
67
riscv/acstone/022.cast.c
Normal file
67
riscv/acstone/022.cast.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* @file 022.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main that uses cast signed char to signed int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int i;
|
||||
signed char c;
|
||||
|
||||
i=0;
|
||||
c=0x01;
|
||||
i=c;
|
||||
|
||||
/* Before i must be 1 */ i=0;
|
||||
c=0xFF;
|
||||
i=c;
|
||||
|
||||
/* Before i must be -1 */ i=0;
|
||||
c=0x80;
|
||||
i=c;
|
||||
|
||||
/* Before i must be -128 */ i=0;
|
||||
c=0x7F;
|
||||
i=c;
|
||||
|
||||
/* Before i must be 127 */ i=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
67
riscv/acstone/023.cast.c
Normal file
67
riscv/acstone/023.cast.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* @file 023.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main that uses cast signed char to signed long long int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int li;
|
||||
signed char c;
|
||||
|
||||
li=0;
|
||||
c=0x01;
|
||||
li=c;
|
||||
|
||||
/* Before li must be 1 */ li=0;
|
||||
c=0xFF;
|
||||
li=c;
|
||||
|
||||
/* Before li must be -1 */ li=0;
|
||||
c=0x80;
|
||||
li=c;
|
||||
|
||||
/* Before li must be -128 */ li=0;
|
||||
c=0x7F;
|
||||
li=c;
|
||||
|
||||
/* Before li must be 127 */ li=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
67
riscv/acstone/024.cast.c
Normal file
67
riscv/acstone/024.cast.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* @file 024.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main that uses cast signed short int to signed int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int i;
|
||||
signed short int si;
|
||||
|
||||
i=0;
|
||||
si=0x0001;
|
||||
i=si;
|
||||
|
||||
/* Before i must be 1 */ i=0;
|
||||
si=0xFFFF;
|
||||
i=si;
|
||||
|
||||
/* Before i must be -1 */ i=0;
|
||||
si=0x8000;
|
||||
i=si;
|
||||
|
||||
/* Before i must be -32768 */ i=0;
|
||||
si=0x7FFF;
|
||||
i=si;
|
||||
|
||||
/* Before i must be 32767 */ i=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
67
riscv/acstone/025.cast.c
Normal file
67
riscv/acstone/025.cast.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* @file 025.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main that uses cast signed short int to signed long long int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int li;
|
||||
signed short int si;
|
||||
|
||||
li=0;
|
||||
si=0x0001;
|
||||
li=si;
|
||||
|
||||
/* Before li must be 1 */ li=0;
|
||||
si=0xFFFF;
|
||||
li=si;
|
||||
|
||||
/* Before li must be -1 */ li=0;
|
||||
si=0x8000;
|
||||
li=si;
|
||||
|
||||
/* Before li must be -32768 */ li=0;
|
||||
si=0x7FFF;
|
||||
li=si;
|
||||
|
||||
/* Before li must be 32767 */ li=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
67
riscv/acstone/026.cast.c
Normal file
67
riscv/acstone/026.cast.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* @file 026.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main that uses cast signed int to signed long long int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int li;
|
||||
signed int i;
|
||||
|
||||
li=0;
|
||||
i=0x00000001;
|
||||
li=i;
|
||||
|
||||
/* Before li must be 1 */ li=0;
|
||||
i=0xFFFFFFFF;
|
||||
li=i;
|
||||
|
||||
/* Before li must be -1 */ li=0;
|
||||
i=0x80000000;
|
||||
li=i;
|
||||
|
||||
/* Before li must be -2147483648 */ li=0;
|
||||
i=0x7FFFFFFF;
|
||||
li=i;
|
||||
|
||||
/* Before li must be 2147483647 */ li=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
66
riscv/acstone/027.cast.c
Normal file
66
riscv/acstone/027.cast.c
Normal file
|
@ -0,0 +1,66 @@
|
|||
/**
|
||||
* @file 027.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main that uses some unsigned casts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int uli;
|
||||
unsigned int ui;
|
||||
unsigned short int usi;
|
||||
unsigned char uc;
|
||||
|
||||
uc=0xFF;
|
||||
usi=0xFFFF;
|
||||
usi=uc;
|
||||
/* Before usi must be 225 */ usi=0;
|
||||
|
||||
usi=0xFFFF;
|
||||
ui=0xFFFFFFFF;
|
||||
ui=usi;
|
||||
/* Before ui must be 65535 */ ui=0;
|
||||
|
||||
ui=0xFFFFFFFF;
|
||||
uli=0xFFFFFFFFFFFFFFFFULL;
|
||||
uli=ui;
|
||||
/* Before uli must be 4294967295 */ uli=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
154
riscv/acstone/031.add.c
Normal file
154
riscv/acstone/031.add.c
Normal file
|
@ -0,0 +1,154 @@
|
|||
/**
|
||||
* @file 031.add.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned char adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b,c;
|
||||
signed char d;
|
||||
unsigned char ua,ub,uc;
|
||||
unsigned char ud;
|
||||
|
||||
a=0x0A;
|
||||
b=0x14;
|
||||
c=a+b;
|
||||
/* Before c must be 30 */ c=0;
|
||||
|
||||
a=0xEC;
|
||||
b=0xE2;
|
||||
c=a+b;
|
||||
/* Before c must be -50 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0x02;
|
||||
c=a+b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0A;
|
||||
b=0xFB;
|
||||
c=a+b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0x05;
|
||||
b=0xF6;
|
||||
c=a+b;
|
||||
/* Before c must be -5 */ c=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0xF0;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xAA;
|
||||
b=0x55;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
d=0;
|
||||
d+=1;
|
||||
d+=2;
|
||||
d+=3;
|
||||
d+=4;
|
||||
d+=5;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
|
||||
ua=0x0A;
|
||||
ub=0x14;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 30 */ uc=0;
|
||||
|
||||
ua=0xEC;
|
||||
ub=0xE2;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 206 */ uc=0;
|
||||
|
||||
ua=0xFE;
|
||||
ub=0x02;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
ua=0x0A;
|
||||
ub=0xFB;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 5 */ uc=0;
|
||||
|
||||
ua=0x05;
|
||||
ub=0xF6;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 251 */ uc=0;
|
||||
|
||||
ua=0x0F;
|
||||
ub=0xF0;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 255 */ uc=0;
|
||||
|
||||
ua=0xAA;
|
||||
ub=0x55;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 255 */ uc=0;
|
||||
|
||||
ud=0;
|
||||
ud+=1;
|
||||
ud+=2;
|
||||
ud+=3;
|
||||
ud+=4;
|
||||
ud+=5;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
d=15;
|
||||
d+=0xFF;
|
||||
d+=0xFE;
|
||||
d+=0xFD;
|
||||
d+=0xFC;
|
||||
d+=0xFB;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
ud=15;
|
||||
ud+=0xFF;
|
||||
ud+=0xFE;
|
||||
ud+=0xFD;
|
||||
ud+=0xFC;
|
||||
ud+=0xFB;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
154
riscv/acstone/032.add.c
Normal file
154
riscv/acstone/032.add.c
Normal file
|
@ -0,0 +1,154 @@
|
|||
/**
|
||||
* @file 032.add.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned short int adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b,c;
|
||||
signed short int d;
|
||||
unsigned short int ua,ub,uc;
|
||||
unsigned short int ud;
|
||||
|
||||
a=0x00FF;
|
||||
b=0xFF00;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFEC;
|
||||
b=0xFFE2;
|
||||
c=a+b;
|
||||
/* Before c must be -50 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0x0002;
|
||||
c=a+b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x000A;
|
||||
b=0xFFFB;
|
||||
c=a+b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0x0005;
|
||||
b=0xFFF6;
|
||||
c=a+b;
|
||||
/* Before c must be -5 */ c=0;
|
||||
|
||||
a=0x0F0F;
|
||||
b=0xF0F0;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xAAAA;
|
||||
b=0x5555;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
d=0;
|
||||
d+=1;
|
||||
d+=2;
|
||||
d+=3;
|
||||
d+=4;
|
||||
d+=5;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
|
||||
ua=0x00FF;
|
||||
ub=0xFF00;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65535 */ uc=0;
|
||||
|
||||
ua=0xFFEC;
|
||||
ub=0xFFE2;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65486 */ uc=0;
|
||||
|
||||
ua=0xFFFE;
|
||||
ub=0x0002;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
ua=0x000A;
|
||||
ub=0xFFFB;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 5 */ uc=0;
|
||||
|
||||
ua=0x0005;
|
||||
ub=0xFFF6;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65531 */ uc=0;
|
||||
|
||||
ua=0x0F0F;
|
||||
ub=0xF0F0;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65535 */ uc=0;
|
||||
|
||||
ua=0xAAAA;
|
||||
ub=0x5555;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65535 */ uc=0;
|
||||
|
||||
ud=0;
|
||||
ud+=1;
|
||||
ud+=2;
|
||||
ud+=3;
|
||||
ud+=4;
|
||||
ud+=5;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
d=15;
|
||||
d+=0xFFFF;
|
||||
d+=0xFFFE;
|
||||
d+=0xFFFD;
|
||||
d+=0xFFFC;
|
||||
d+=0xFFFB;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
ud=15;
|
||||
ud+=0xFFFF;
|
||||
ud+=0xFFFE;
|
||||
ud+=0xFFFD;
|
||||
ud+=0xFFFC;
|
||||
ud+=0xFFFB;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
154
riscv/acstone/033.add.c
Normal file
154
riscv/acstone/033.add.c
Normal file
|
@ -0,0 +1,154 @@
|
|||
/**
|
||||
* @file 033.add.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned int adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b,c;
|
||||
signed int d;
|
||||
unsigned int ua,ub,uc;
|
||||
unsigned int ud;
|
||||
|
||||
a=0x0000FFFF;
|
||||
b=0xFFFF0000;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFFEC;
|
||||
b=0xFFFFFFE2;
|
||||
c=a+b;
|
||||
/* Before c must be -50 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0x00000002;
|
||||
c=a+b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000A;
|
||||
b=0xFFFFFFFB;
|
||||
c=a+b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0x00000005;
|
||||
b=0xFFFFFFF6;
|
||||
c=a+b;
|
||||
/* Before c must be -5 */ c=0;
|
||||
|
||||
a=0x0F0F0F0F;
|
||||
b=0xF0F0F0F0;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xAAAAAAAA;
|
||||
b=0x55555555;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
d=0;
|
||||
d+=1;
|
||||
d+=2;
|
||||
d+=3;
|
||||
d+=4;
|
||||
d+=5;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
|
||||
ua=0x0000FFFF;
|
||||
ub=0xFFFF0000;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967295 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFEC;
|
||||
ub=0xFFFFFFE2;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967246 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFE;
|
||||
ub=0x00000002;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
ua=0x0000000A;
|
||||
ub=0xFFFFFFFB;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 5 */ uc=0;
|
||||
|
||||
ua=0x00000005;
|
||||
ub=0xFFFFFFF6;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967291 */ uc=0;
|
||||
|
||||
ua=0x0F0F0F0F;
|
||||
ub=0xF0F0F0F0;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967295 */ uc=0;
|
||||
|
||||
ua=0xAAAAAAAA;
|
||||
ub=0x55555555;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967295 */ uc=0;
|
||||
|
||||
ud=0;
|
||||
ud+=1;
|
||||
ud+=2;
|
||||
ud+=3;
|
||||
ud+=4;
|
||||
ud+=5;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
d=15;
|
||||
d+=0xFFFFFFFF;
|
||||
d+=0xFFFFFFFE;
|
||||
d+=0xFFFFFFFD;
|
||||
d+=0xFFFFFFFC;
|
||||
d+=0xFFFFFFFB;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
ud=15;
|
||||
ud+=0xFFFFFFFF;
|
||||
ud+=0xFFFFFFFE;
|
||||
ud+=0xFFFFFFFD;
|
||||
ud+=0xFFFFFFFC;
|
||||
ud+=0xFFFFFFFB;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
154
riscv/acstone/034.add.c
Normal file
154
riscv/acstone/034.add.c
Normal file
|
@ -0,0 +1,154 @@
|
|||
/**
|
||||
* @file 034.add.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned long long int adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a,b,c;
|
||||
signed long long int d;
|
||||
unsigned long long int ua,ub,uc;
|
||||
unsigned long long int ud;
|
||||
|
||||
a=0x00000000FFFFFFFFLL;
|
||||
b=0xFFFFFFFF00000000LL;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFECLL;
|
||||
b=0xFFFFFFFFFFFFFFE2LL;
|
||||
c=a+b;
|
||||
/* Before c must be -50 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFELL;
|
||||
b=0x0000000000000002LL;
|
||||
c=a+b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x000000000000000ALL;
|
||||
b=0xFFFFFFFFFFFFFFFBLL;
|
||||
c=a+b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0x0000000000000005LL;
|
||||
b=0xFFFFFFFFFFFFFFF6LL;
|
||||
c=a+b;
|
||||
/* Before c must be -5 */ c=0;
|
||||
|
||||
a=0xF0F0F0F0F0F0F0F0LL;
|
||||
b=0x0F0F0F0F0F0F0F0FLL;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAALL;
|
||||
b=0x5555555555555555LL;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
d=0;
|
||||
d+=1;
|
||||
d+=2;
|
||||
d+=3;
|
||||
d+=4;
|
||||
d+=5;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
|
||||
ua=0x00000000FFFFFFFFULL;
|
||||
ub=0xFFFFFFFF00000000ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551615 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFFFFFFFFECULL;
|
||||
ub=0xFFFFFFFFFFFFFFE2ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551566 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFFFFFFFFFEULL;
|
||||
ub=0x0000000000000002ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
ua=0x000000000000000AULL;
|
||||
ub=0xFFFFFFFFFFFFFFFBULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 5 */ uc=0;
|
||||
|
||||
ua=0x0000000000000005ULL;
|
||||
ub=0xFFFFFFFFFFFFFFF6ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551611 */ uc=0;
|
||||
|
||||
ua=0x0F0F0F0F0F0F0F0FULL;
|
||||
ub=0xF0F0F0F0F0F0F0F0ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551615 */ uc=0;
|
||||
|
||||
ua=0xAAAAAAAAAAAAAAAAULL;
|
||||
ub=0x5555555555555555ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551615 */ uc=0;
|
||||
|
||||
ud=0;
|
||||
ud+=1;
|
||||
ud+=2;
|
||||
ud+=3;
|
||||
ud+=4;
|
||||
ud+=5;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
d=15;
|
||||
d+=0xFFFFFFFFFFFFFFFFULL;
|
||||
d+=0xFFFFFFFFFFFFFFFEULL;
|
||||
d+=0xFFFFFFFFFFFFFFFDULL;
|
||||
d+=0xFFFFFFFFFFFFFFFCULL;
|
||||
d+=0xFFFFFFFFFFFFFFFBULL;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
ud=15;
|
||||
ud+=0xFFFFFFFFFFFFFFFFULL;
|
||||
ud+=0xFFFFFFFFFFFFFFFEULL;
|
||||
ud+=0xFFFFFFFFFFFFFFFDULL;
|
||||
ud+=0xFFFFFFFFFFFFFFFCULL;
|
||||
ud+=0xFFFFFFFFFFFFFFFBULL;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
154
riscv/acstone/041.sub.c
Normal file
154
riscv/acstone/041.sub.c
Normal file
|
@ -0,0 +1,154 @@
|
|||
/**
|
||||
* @file 041.sub.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned char subs.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b,c;
|
||||
signed char d;
|
||||
unsigned char ua,ub,uc;
|
||||
unsigned char ud;
|
||||
|
||||
a=0x0A;
|
||||
b=0x14;
|
||||
c=a-b;
|
||||
/* Before c must be -10 */ c=0;
|
||||
|
||||
a=0xEC;
|
||||
b=0xE2;
|
||||
c=a-b;
|
||||
/* Before c must be 10 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0x02;
|
||||
c=a-b;
|
||||
/* Before c must be -4 */ c=0;
|
||||
|
||||
a=0x0A;
|
||||
b=0xFB;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x05;
|
||||
b=0xF6;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0xF0;
|
||||
c=a-b;
|
||||
/* Before c must be 31 */ c=0;
|
||||
|
||||
a=0xAA;
|
||||
b=0x55;
|
||||
c=a-b;
|
||||
/* Before c must be 85 */ c=0;
|
||||
|
||||
d=15;
|
||||
d-=1;
|
||||
d-=2;
|
||||
d-=3;
|
||||
d-=4;
|
||||
d-=5;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
|
||||
ua=0x0A;
|
||||
ub=0x14;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 246 */ uc=0;
|
||||
|
||||
ua=0xEC;
|
||||
ub=0xE2;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 10 */ uc=0;
|
||||
|
||||
ua=0xFE;
|
||||
ub=0x02;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 252 */ uc=0;
|
||||
|
||||
ua=0x0A;
|
||||
ub=0xFB;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x05;
|
||||
ub=0xF6;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0F;
|
||||
ub=0xF0;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 31 */ uc=0;
|
||||
|
||||
ua=0xAA;
|
||||
ub=0x55;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 85 */ uc=0;
|
||||
|
||||
ud=15;
|
||||
ud-=1;
|
||||
ud-=2;
|
||||
ud-=3;
|
||||
ud-=4;
|
||||
ud-=5;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
d=0;
|
||||
d-=0xFF;
|
||||
d-=0xFE;
|
||||
d-=0xFD;
|
||||
d-=0xFC;
|
||||
d-=0xFB;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
ud=0;
|
||||
ud-=0xFF;
|
||||
ud-=0xFE;
|
||||
ud-=0xFD;
|
||||
ud-=0xFC;
|
||||
ud-=0xFB;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
154
riscv/acstone/042.sub.c
Normal file
154
riscv/acstone/042.sub.c
Normal file
|
@ -0,0 +1,154 @@
|
|||
/**
|
||||
* @file 042.sub.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned short int subs.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b,c;
|
||||
signed short int d;
|
||||
unsigned short int ua,ub,uc;
|
||||
unsigned short int ud;
|
||||
|
||||
a=0x00FF;
|
||||
b=0xFF00;
|
||||
c=a-b;
|
||||
/* Before c must be 511 */ c=0;
|
||||
|
||||
a=0xFFEC;
|
||||
b=0xFFE2;
|
||||
c=a-b;
|
||||
/* Before c must be 10 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0x0002;
|
||||
c=a-b;
|
||||
/* Before c must be -4 */ c=0;
|
||||
|
||||
a=0x000A;
|
||||
b=0xFFFB;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0005;
|
||||
b=0xFFF6;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0F0F;
|
||||
b=0xF0F0;
|
||||
c=a-b;
|
||||
/* Before c must be 7711 */ c=0;
|
||||
|
||||
a=0xAAAA;
|
||||
b=0x5555;
|
||||
c=a-b;
|
||||
/* Before c must be 21845 */ c=0;
|
||||
|
||||
d=15;
|
||||
d-=1;
|
||||
d-=2;
|
||||
d-=3;
|
||||
d-=4;
|
||||
d-=5;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
|
||||
ua=0x00FF;
|
||||
ub=0xFF00;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 511 */ uc=0;
|
||||
|
||||
ua=0xFFEC;
|
||||
ub=0xFFE2;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 10 */ uc=0;
|
||||
|
||||
ua=0xFFFE;
|
||||
ub=0x0002;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 65532 */ uc=0;
|
||||
|
||||
ua=0x000A;
|
||||
ub=0xFFFB;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0005;
|
||||
ub=0xFFF6;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0F0F;
|
||||
ub=0xF0F0;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 7711 */ uc=0;
|
||||
|
||||
ua=0xAAAA;
|
||||
ub=0x5555;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 21845 */ uc=0;
|
||||
|
||||
ud=15;
|
||||
ud-=1;
|
||||
ud-=2;
|
||||
ud-=3;
|
||||
ud-=4;
|
||||
ud-=5;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
d=0;
|
||||
d-=0xFFFF;
|
||||
d-=0xFFFE;
|
||||
d-=0xFFFD;
|
||||
d-=0xFFFC;
|
||||
d-=0xFFFB;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
ud=0;
|
||||
ud-=0xFFFF;
|
||||
ud-=0xFFFE;
|
||||
ud-=0xFFFD;
|
||||
ud-=0xFFFC;
|
||||
ud-=0xFFFB;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
154
riscv/acstone/043.sub.c
Normal file
154
riscv/acstone/043.sub.c
Normal file
|
@ -0,0 +1,154 @@
|
|||
/**
|
||||
* @file 043.sub.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned int subs.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b,c;
|
||||
signed int d;
|
||||
unsigned int ua,ub,uc;
|
||||
unsigned int ud;
|
||||
|
||||
a=0x0000FFFF;
|
||||
b=0xFFFF0000;
|
||||
c=a-b;
|
||||
/* Before c must be 131071 */ c=0;
|
||||
|
||||
a=0xFFFFFFEC;
|
||||
b=0xFFFFFFE2;
|
||||
c=a-b;
|
||||
/* Before c must be 10 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0x00000002;
|
||||
c=a-b;
|
||||
/* Before c must be -4 */ c=0;
|
||||
|
||||
a=0x0000000A;
|
||||
b=0xFFFFFFFB;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x00000005;
|
||||
b=0xFFFFFFF6;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0F0F0F0F;
|
||||
b=0xF0F0F0F0;
|
||||
c=a-b;
|
||||
/* Before c must be 505290271 */ c=0;
|
||||
|
||||
a=0xAAAAAAAA;
|
||||
b=0x55555555;
|
||||
c=a-b;
|
||||
/* Before c must be 1431655765 */ c=0;
|
||||
|
||||
d=15;
|
||||
d-=1;
|
||||
d-=2;
|
||||
d-=3;
|
||||
d-=4;
|
||||
d-=5;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
|
||||
ua=0x0000FFFF;
|
||||
ub=0xFFFF0000;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 131071 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFEC;
|
||||
ub=0xFFFFFFE2;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 10 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFE;
|
||||
ub=0x00000002;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 4294967292 */ uc=0;
|
||||
|
||||
ua=0x0000000A;
|
||||
ub=0xFFFFFFFB;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x00000005;
|
||||
ub=0xFFFFFFF6;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0F0F0F0F;
|
||||
ub=0xF0F0F0F0;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 505290271 */ uc=0;
|
||||
|
||||
ua=0xAAAAAAAA;
|
||||
ub=0x55555555;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 1431655765 */ uc=0;
|
||||
|
||||
ud=15;
|
||||
ud-=1;
|
||||
ud-=2;
|
||||
ud-=3;
|
||||
ud-=4;
|
||||
ud-=5;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
d=0;
|
||||
d-=0xFFFFFFFF;
|
||||
d-=0xFFFFFFFE;
|
||||
d-=0xFFFFFFFD;
|
||||
d-=0xFFFFFFFC;
|
||||
d-=0xFFFFFFFB;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
ud=0;
|
||||
ud-=0xFFFFFFFF;
|
||||
ud-=0xFFFFFFFE;
|
||||
ud-=0xFFFFFFFD;
|
||||
ud-=0xFFFFFFFC;
|
||||
ud-=0xFFFFFFFB;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
154
riscv/acstone/044.sub.c
Normal file
154
riscv/acstone/044.sub.c
Normal file
|
@ -0,0 +1,154 @@
|
|||
/**
|
||||
* @file 044.sub.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned long long int adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a,b,c;
|
||||
signed long long int d;
|
||||
unsigned long long int ua,ub,uc;
|
||||
unsigned long long int ud;
|
||||
|
||||
a=0x00000000FFFFFFFFLL;
|
||||
b=0xFFFFFFFF00000000LL;
|
||||
c=a-b;
|
||||
/* Before c must be 8589934591 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFECLL;
|
||||
b=0xFFFFFFFFFFFFFFE2LL;
|
||||
c=a-b;
|
||||
/* Before c must be 10 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFELL;
|
||||
b=0x0000000000000002LL;
|
||||
c=a-b;
|
||||
/* Before c must be -4 */ c=0;
|
||||
|
||||
a=0x000000000000000ALL;
|
||||
b=0xFFFFFFFFFFFFFFFBLL;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0000000000000005LL;
|
||||
b=0xFFFFFFFFFFFFFFF6LL;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0xF0F0F0F0F0F0F0F0LL;
|
||||
b=0x0F0F0F0F0F0F0F0FLL;
|
||||
c=a-b;
|
||||
/* Before c must be -2170205185142300191 */ c=0;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAALL;
|
||||
b=0x5555555555555555LL;
|
||||
c=a-b;
|
||||
/* Before c must be 6148914691236517205 */ c=0;
|
||||
|
||||
d=15;
|
||||
d-=1;
|
||||
d-=2;
|
||||
d-=3;
|
||||
d-=4;
|
||||
d-=5;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
|
||||
ua=0x00000000FFFFFFFFULL;
|
||||
ub=0xFFFFFFFF00000000ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 8589934591 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFFFFFFFFECULL;
|
||||
ub=0xFFFFFFFFFFFFFFE2ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 10 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFFFFFFFFFEULL;
|
||||
ub=0x0000000000000002ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 18446744073709551612 */ uc=0;
|
||||
|
||||
ua=0x000000000000000AULL;
|
||||
ub=0xFFFFFFFFFFFFFFFBULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0000000000000005ULL;
|
||||
ub=0xFFFFFFFFFFFFFFF6ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0F0F0F0F0F0F0F0FULL;
|
||||
ub=0xF0F0F0F0F0F0F0F0ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 2170205185142300191 */ uc=0;
|
||||
|
||||
ua=0xAAAAAAAAAAAAAAAAULL;
|
||||
ub=0x5555555555555555ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 6148914691236517205 */ uc=0;
|
||||
|
||||
ud=15;
|
||||
ud-=1;
|
||||
ud-=2;
|
||||
ud-=3;
|
||||
ud-=4;
|
||||
ud-=5;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
d=0;
|
||||
d-=0xFFFFFFFFFFFFFFFFULL;
|
||||
d-=0xFFFFFFFFFFFFFFFEULL;
|
||||
d-=0xFFFFFFFFFFFFFFFDULL;
|
||||
d-=0xFFFFFFFFFFFFFFFCULL;
|
||||
d-=0xFFFFFFFFFFFFFFFBULL;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
ud=0;
|
||||
ud-=0xFFFFFFFFFFFFFFFFULL;
|
||||
ud-=0xFFFFFFFFFFFFFFFEULL;
|
||||
ud-=0xFFFFFFFFFFFFFFFDULL;
|
||||
ud-=0xFFFFFFFFFFFFFFFCULL;
|
||||
ud-=0xFFFFFFFFFFFFFFFBULL;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
84
riscv/acstone/051.mul.c
Normal file
84
riscv/acstone/051.mul.c
Normal file
|
@ -0,0 +1,84 @@
|
|||
/**
|
||||
* @file 051.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed char multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b;
|
||||
signed short int c;
|
||||
|
||||
a=0x02;
|
||||
b=0x04;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x01;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x0A;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be -10 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0xFC;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0x0A;
|
||||
b=0x0B;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xF6;
|
||||
b=0x0B;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be -110 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
84
riscv/acstone/052.mul.c
Normal file
84
riscv/acstone/052.mul.c
Normal file
|
@ -0,0 +1,84 @@
|
|||
/**
|
||||
* @file 052.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned char multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char a,b;
|
||||
unsigned short int c;
|
||||
|
||||
a=0x02;
|
||||
b=0x04;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 65025 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x01;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 255 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x0A;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 2550 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0xFC;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 64008 */ c=0;
|
||||
|
||||
a=0x0A;
|
||||
b=0x0B;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xF6;
|
||||
b=0x0B;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 2706 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
99
riscv/acstone/053.mul.c
Normal file
99
riscv/acstone/053.mul.c
Normal file
|
@ -0,0 +1,99 @@
|
|||
/**
|
||||
* @file 053.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed short int multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b;
|
||||
signed int c;
|
||||
|
||||
a=0x0002;
|
||||
b=0x0004;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0001;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x000A;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be -10 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0xFFFC;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0x000A;
|
||||
b=0x000B;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xFFF6;
|
||||
b=0x000B;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be -110 */ c=0;
|
||||
|
||||
a=0xF000;
|
||||
b=0xF001;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 16773120 */ c=0;
|
||||
|
||||
a=0x5555;
|
||||
b=0x3333;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 286322415 */ c=0;
|
||||
|
||||
a=0x5353;
|
||||
b=0x8000;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be -698974208 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
99
riscv/acstone/054.mul.c
Normal file
99
riscv/acstone/054.mul.c
Normal file
|
@ -0,0 +1,99 @@
|
|||
/**
|
||||
* @file 054.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned short int multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int a,b;
|
||||
unsigned int c;
|
||||
|
||||
a=0x0002;
|
||||
b=0x0004;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 4294836225 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0001;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 65535 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x000A;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 655350 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0xFFFC;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 4294574088 */ c=0;
|
||||
|
||||
a=0x000A;
|
||||
b=0x000B;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xFFF6;
|
||||
b=0x000B;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 720786 */ c=0;
|
||||
|
||||
a=0xF000;
|
||||
b=0xF001;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 3774935040 */ c=0;
|
||||
|
||||
a=0x5555;
|
||||
b=0x3333;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 286322415 */ c=0;
|
||||
|
||||
a=0x5353;
|
||||
b=0x8000;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 698974208 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
115
riscv/acstone/055.mul.c
Normal file
115
riscv/acstone/055.mul.c
Normal file
|
@ -0,0 +1,115 @@
|
|||
/**
|
||||
* @file 055.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed int multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b;
|
||||
signed long long int c;
|
||||
|
||||
a=0x00000002;
|
||||
b=0x00000004;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000001;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x0000000A;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be -10 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0xFFFFFFFC;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0x0000000A;
|
||||
b=0x0000000B;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xFFFFFFF6;
|
||||
b=0x0000000B;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be -110 */ c=0;
|
||||
|
||||
a=0x0000F000;
|
||||
b=0x0000F001;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 3774935040 */ c=0;
|
||||
|
||||
a=0x55555555;
|
||||
b=0x33333333;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 1229782937674641135 */ c=0;
|
||||
|
||||
a=0x00005353;
|
||||
b=0x00008000;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 698974208 */ c=0;
|
||||
|
||||
a=0xFFFFF000;
|
||||
b=0xFFFFF001;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 16773120 */ c=0;
|
||||
|
||||
a=0x00005555;
|
||||
b=0x33330000;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 18764425789440 */ c=0;
|
||||
|
||||
a=0x53535353;
|
||||
b=0x80008000;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be -3002071363408527360 */ c=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
115
riscv/acstone/056.mul.c
Normal file
115
riscv/acstone/056.mul.c
Normal file
|
@ -0,0 +1,115 @@
|
|||
/**
|
||||
* @file 056.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned int multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int a,b;
|
||||
unsigned long long int c;
|
||||
|
||||
a=0x00000002;
|
||||
b=0x00000004;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 18446744065119617025 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000001;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x0000000A;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 42949672950 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0xFFFFFFFC;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 18446744047939747848 */ c=0;
|
||||
|
||||
a=0x0000000A;
|
||||
b=0x0000000B;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xFFFFFFF6;
|
||||
b=0x0000000B;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 47244640146 */ c=0;
|
||||
|
||||
a=0x0000F000;
|
||||
b=0x0000F001;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 3774935040 */ c=0;
|
||||
|
||||
a=0x55555555;
|
||||
b=0x33333333;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 1229782937674641135 */ c=0;
|
||||
|
||||
a=0x00005353;
|
||||
b=0x00008000;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 698974208 */ c=0;
|
||||
|
||||
a=0xFFFFF000;
|
||||
b=0xFFFFF001;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 18446708893649203200 */ c=0;
|
||||
|
||||
a=0x00005555;
|
||||
b=0x33330000;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 18764425789440 */ c=0;
|
||||
|
||||
a=0x53535353;
|
||||
b=0x80008000;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 3002162980753866752 */ c=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
106
riscv/acstone/057.mul.c
Normal file
106
riscv/acstone/057.mul.c
Normal file
|
@ -0,0 +1,106 @@
|
|||
/**
|
||||
* @file 057.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function uses various signed multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed char c1,c2,c3,c4,c5,cresult;
|
||||
signed short int si1,si2,si3,si4,si5,siresult;
|
||||
signed int i1,i2,i3,i4,i5,iresult;
|
||||
signed long long int li1,li2,li3,li4,li5,liresult;
|
||||
|
||||
c1=1;
|
||||
c2=2;
|
||||
c3=3;
|
||||
c4=4;
|
||||
c5=5;
|
||||
cresult=c1*c2*c3*c4*c5;
|
||||
/* Before cresult must be 120 */ cresult=0;
|
||||
|
||||
si1=1;
|
||||
si2=2;
|
||||
si3=3;
|
||||
si4=4;
|
||||
si5=5;
|
||||
siresult=si1*si2*si3*si4*si5;
|
||||
/* Before siresult must be 120 */ siresult=0;
|
||||
|
||||
i1=1;
|
||||
i2=2;
|
||||
i3=3;
|
||||
i4=4;
|
||||
i5=5;
|
||||
iresult=i1*i2*i3*i4*i5;
|
||||
/* Before iresult must be 120 */ iresult=0;
|
||||
|
||||
li1=1;
|
||||
li2=2;
|
||||
li3=3;
|
||||
li4=4;
|
||||
li5=5;
|
||||
liresult=li1*li2*li3*li4*li5;
|
||||
/* Before liresult must be 120 */ liresult=0;
|
||||
|
||||
c1=5;
|
||||
siresult=c1*7;
|
||||
/* Before siresult must be 35 */ siresult=0;
|
||||
|
||||
si1=5;
|
||||
iresult=si1*7;
|
||||
/* Before iresult must be 35 */ iresult=0;
|
||||
|
||||
i1=5;
|
||||
liresult=i1*7;
|
||||
/* Before liresult must be 35 */ liresult=0;
|
||||
|
||||
c1=17;
|
||||
siresult=c1*(-1);
|
||||
/* Before siresult must be -17 */ siresult=0;
|
||||
|
||||
si1=17;
|
||||
iresult=si1*(-1);
|
||||
/* Before iresult must be -17 */ iresult=0;
|
||||
|
||||
i1=17;
|
||||
liresult=i1*(-1);
|
||||
/* Before siresult must be -17 */ liresult=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
106
riscv/acstone/058.mul.c
Normal file
106
riscv/acstone/058.mul.c
Normal file
|
@ -0,0 +1,106 @@
|
|||
/**
|
||||
* @file 058.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function uses various unsigned multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned char uc1,uc2,uc3,uc4,uc5,ucresult;
|
||||
unsigned short int usi1,usi2,usi3,usi4,usi5,usiresult;
|
||||
unsigned int ui1,ui2,ui3,ui4,ui5,uiresult;
|
||||
unsigned long long int uli1,uli2,uli3,uli4,uli5,uliresult;
|
||||
|
||||
uc1=1;
|
||||
uc2=2;
|
||||
uc3=3;
|
||||
uc4=4;
|
||||
uc5=5;
|
||||
ucresult=uc1*uc2*uc3*uc4*uc5;
|
||||
/* Before ucresult must be 120 */ ucresult=0;
|
||||
|
||||
usi1=1;
|
||||
usi2=2;
|
||||
usi3=3;
|
||||
usi4=4;
|
||||
usi5=5;
|
||||
usiresult=usi1*usi2*usi3*usi4*usi5;
|
||||
/* Before usiresult must be 120 */ usiresult=0;
|
||||
|
||||
ui1=1;
|
||||
ui2=2;
|
||||
ui3=3;
|
||||
ui4=4;
|
||||
ui5=5;
|
||||
uiresult=ui1*ui2*ui3*ui4*ui5;
|
||||
/* Before uiresult must be 120 */ uiresult=0;
|
||||
|
||||
uli1=1;
|
||||
uli2=2;
|
||||
uli3=3;
|
||||
uli4=4;
|
||||
uli5=5;
|
||||
uliresult=uli1*uli2*uli3*uli4*uli5;
|
||||
/* Before uliresult must be 120 */ uliresult=0;
|
||||
|
||||
uc1=5;
|
||||
usiresult=uc1*7;
|
||||
/* Before usiresult must be 35 */ usiresult=0;
|
||||
|
||||
usi1=5;
|
||||
uiresult=usi1*7;
|
||||
/* Before uiresult must be 35 */ uiresult=0;
|
||||
|
||||
ui1=5;
|
||||
uliresult=ui1*7;
|
||||
/* Before uliresult must be 35 */ uliresult=0;
|
||||
|
||||
uc1=17;
|
||||
usiresult=uc1*5;
|
||||
/* Before usiresult must be 85 */ usiresult=0;
|
||||
|
||||
usi1=17;
|
||||
uiresult=usi1*5;
|
||||
/* Before uiresult must be 85 */ uiresult=0;
|
||||
|
||||
ui1=17;
|
||||
uliresult=ui1*5;
|
||||
/* Before siresult must be 85 */ uliresult=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
109
riscv/acstone/061.div.c
Normal file
109
riscv/acstone/061.div.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file 061.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed char division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b,c;
|
||||
|
||||
a=0xFF;
|
||||
b=0x01;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0x03;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAA;
|
||||
b=0x55;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x7F;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be -127 */ c=0;
|
||||
|
||||
a=0x00;
|
||||
b=0x80;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x30;
|
||||
b=0x05;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0x10;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x20;
|
||||
b=0xFE;
|
||||
c=a/b;
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
a=0x00;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10;
|
||||
c=a/(-1);
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
109
riscv/acstone/062.div.c
Normal file
109
riscv/acstone/062.div.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file 062.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned char division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char a,b,c;
|
||||
|
||||
a=0xFF;
|
||||
b=0x01;
|
||||
c=a/b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0x03;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAA;
|
||||
b=0x55;
|
||||
c=a/b;
|
||||
/* Before c must be 2 */ c=0;
|
||||
|
||||
a=0x7F;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00;
|
||||
b=0x80;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x30;
|
||||
b=0x05;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0x10;
|
||||
c=a/b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x20;
|
||||
b=0xFE;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10;
|
||||
c=a/0xFF;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
109
riscv/acstone/063.div.c
Normal file
109
riscv/acstone/063.div.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file 063.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed short int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b,c;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0001;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x000F;
|
||||
b=0x0003;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAA;
|
||||
b=0x5555;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x7FFF;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be -32767 */ c=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0x8000;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0030;
|
||||
b=0x0005;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0x0010;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0020;
|
||||
b=0xFFFE;
|
||||
c=a/b;
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0078;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x1000;
|
||||
c=a/(-1);
|
||||
/* Before c must be -4096 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
109
riscv/acstone/064.div.c
Normal file
109
riscv/acstone/064.div.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file 064.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned short int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int a,b,c;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0001;
|
||||
c=a/b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
|
||||
a=0x000F;
|
||||
b=0x0003;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAA;
|
||||
b=0x5555;
|
||||
c=a/b;
|
||||
/* Before c must be 2 */ c=0;
|
||||
|
||||
a=0x7FFF;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0x8000;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0030;
|
||||
b=0x0005;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0x0010;
|
||||
c=a/b;
|
||||
/* Before c must be 4095 */ c=0;
|
||||
|
||||
a=0x0020;
|
||||
b=0xFFFE;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10;
|
||||
c=a/0xFFFF;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
109
riscv/acstone/065.div.c
Normal file
109
riscv/acstone/065.div.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file 065.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b,c;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000001;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x0000000F;
|
||||
b=0x00000003;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAAAAAA;
|
||||
b=0x55555555;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x7FFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be -2147483647 */ c=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0x80000000;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000030;
|
||||
b=0x00000005;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0x00000010;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000020;
|
||||
b=0xFFFFFFFE;
|
||||
c=a/b;
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000078;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10000000;
|
||||
c=a/(-1);
|
||||
/* Before c must be -268435456 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
109
riscv/acstone/066.div.c
Normal file
109
riscv/acstone/066.div.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file 066.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int a,b,c;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000001;
|
||||
c=a/b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
|
||||
a=0x0000000F;
|
||||
b=0x00000003;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAAAAAA;
|
||||
b=0x55555555;
|
||||
c=a/b;
|
||||
/* Before c must be 2 */ c=0;
|
||||
|
||||
a=0x7FFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0x80000000;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000030;
|
||||
b=0x00000005;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0x00000010;
|
||||
c=a/b;
|
||||
/* Before c must be 268435455 */ c=0;
|
||||
|
||||
a=0x00000020;
|
||||
b=0xFFFFFFFE;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10000000;
|
||||
c=a/0xFFFFFFFF;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
109
riscv/acstone/067.div.c
Normal file
109
riscv/acstone/067.div.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file 067.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed long long int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a,b,c;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFLL;
|
||||
b=0x0000000000000001LL;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x000000000000000FLL;
|
||||
b=0x0000000000000003LL;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAALL;
|
||||
b=0x5555555555555555LL;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x7FFFFFFFFFFFFFFFLL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
c=a/b;
|
||||
/* Before c must be -9223372036854775807 */ c=0;
|
||||
|
||||
a=0x0000000000000000LL;
|
||||
b=0x8000000000000000LL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000030LL;
|
||||
b=0x0000000000000005LL;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFLL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFELL;
|
||||
b=0x0000000000000010LL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000020LL;
|
||||
b=0xFFFFFFFFFFFFFFFELL;
|
||||
c=a/b;
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
a=0x0000000000000000LL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000078LL;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x1000000000000000LL;
|
||||
c=a/(-1);
|
||||
/* Before c must be -1152921504606846976 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
109
riscv/acstone/068.div.c
Normal file
109
riscv/acstone/068.div.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file 068.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned long long int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int a,b,c;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0x0000000000000001ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
|
||||
a=0x000000000000000FULL;
|
||||
b=0x0000000000000003ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAAULL;
|
||||
b=0x5555555555555555ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 2 */ c=0;
|
||||
|
||||
a=0x7FFFFFFFFFFFFFFFULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000000ULL;
|
||||
b=0x8000000000000000ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000030ULL;
|
||||
b=0x0000000000000005ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFEULL;
|
||||
b=0x0000000000000010ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 1152921504606846975 */ c=0;
|
||||
|
||||
a=0x0000000000000020ULL;
|
||||
b=0xFFFFFFFFFFFFFFFEULL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000000ULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x1000000000000000ULL;
|
||||
c=a/0xFFFFFFFFFFFFFFFFULL;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
109
riscv/acstone/069.div.c
Normal file
109
riscv/acstone/069.div.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file 068.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned long long int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long int a,b,c;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x00001ULL;
|
||||
c=a%-2;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x00003ULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x55555ULL;
|
||||
c=a%b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0xFFFFFULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x01000ULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x00005ULL;
|
||||
c=a%b;
|
||||
/* Before c must be 3 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0xFFAFFULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x00010ULL;
|
||||
c=a%b;
|
||||
/* Before c must be -2 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0xFFBBEULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0xFCCCFULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a%56;
|
||||
/* Before c must be 8 */ c=c%9;
|
||||
/* Before c must be 8 */ c=c%5;
|
||||
/* Before c must be 3 */ c=c%1;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
c=a%0xFFFFFULL;
|
||||
/* Before c must be 1152921504606846976 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
143
riscv/acstone/071.bool.c
Normal file
143
riscv/acstone/071.bool.c
Normal file
|
@ -0,0 +1,143 @@
|
|||
/**
|
||||
* @file 071.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses char boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char a,b,c,d,e,f,g,h,i,j;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=a|b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 255 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 0 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 255 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 0 */ j=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0xF0;
|
||||
c=a|b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 255 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 255 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 240 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 15 */ j=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x00;
|
||||
c=a|b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 255 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 255 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 255 */ j=0;
|
||||
|
||||
a=0x55;
|
||||
b=0xAA;
|
||||
c=a|b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 255 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 255 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 170 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 85 */ j=0;
|
||||
|
||||
a=0x00;
|
||||
b=0x00;
|
||||
c=a|b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 255 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 255 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 255 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 255 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 255 */ j=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
143
riscv/acstone/072.bool.c
Normal file
143
riscv/acstone/072.bool.c
Normal file
|
@ -0,0 +1,143 @@
|
|||
/**
|
||||
* @file 072.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses short int boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int a,b,c,d,e,f,g,h,i,j;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=a|b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 65535 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 0 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 65535 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 0 */ j=0;
|
||||
|
||||
a=0x0F0F;
|
||||
b=0xF0F0;
|
||||
c=a|b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 65535 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 65535 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 61680 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 3855 */ j=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0000;
|
||||
c=a|b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 65535 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 65535 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 65535 */ j=0;
|
||||
|
||||
a=0x5555;
|
||||
b=0xAAAA;
|
||||
c=a|b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 65535 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 65535 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 43690 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 21845 */ j=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0x0000;
|
||||
c=a|b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 65535 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 65535 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 65535 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 65535 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 65535 */ j=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
143
riscv/acstone/073.bool.c
Normal file
143
riscv/acstone/073.bool.c
Normal file
|
@ -0,0 +1,143 @@
|
|||
/**
|
||||
* @file 073.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses int boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int a,b,c,d,e,f,g,h,i,j;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a|b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 4294967295 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 0 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 4294967295 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 0 */ j=0;
|
||||
|
||||
a=0x0F0F0F0F;
|
||||
b=0xF0F0F0F0;
|
||||
c=a|b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 4294967295 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 4294967295 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 4042322160 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 252645135 */ j=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000000;
|
||||
c=a|b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 4294967295 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 4294967295 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 4294967295 */ j=0;
|
||||
|
||||
a=0x55555555;
|
||||
b=0xAAAAAAAA;
|
||||
c=a|b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 4294967295 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 4294967295 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 2863311530 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 1431655765 */ j=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0x00000000;
|
||||
c=a|b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 4294967295 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 4294967295 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 4294967295 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 4294967295 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 4294967295 */ j=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
143
riscv/acstone/074.bool.c
Normal file
143
riscv/acstone/074.bool.c
Normal file
|
@ -0,0 +1,143 @@
|
|||
/**
|
||||
* @file 074.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses long long int boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int a,b,c,d,e,f,g,h,i,j;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
c=a|b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 18446744073709551615 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 0 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 18446744073709551615 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 0 */ j=0;
|
||||
|
||||
a=0x0F0F0F0F0F0F0F0FULL;
|
||||
b=0xF0F0F0F0F0F0F0F0ULL;
|
||||
c=a|b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 18446744073709551615 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 18446744073709551615 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 17361641481138401520 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 1085102592571150095 */ j=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0x0000000000000000ULL;
|
||||
c=a|b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 18446744073709551615 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 18446744073709551615 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 18446744073709551615 */ j=0;
|
||||
|
||||
a=0x5555555555555555ULL;
|
||||
b=0xAAAAAAAAAAAAAAAAULL;
|
||||
c=a|b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 18446744073709551615 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 18446744073709551615 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 12297829382473034410 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 6148914691236517205 */ j=0;
|
||||
|
||||
a=0x0000000000000000ULL;
|
||||
b=0x0000000000000000ULL;
|
||||
c=a|b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 18446744073709551615 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 18446744073709551615 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 18446744073709551615 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 18446744073709551615 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 18446744073709551615 */ j=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
64
riscv/acstone/075.bool.c
Normal file
64
riscv/acstone/075.bool.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
/**
|
||||
* @file 075.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int a,b;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAAULL;
|
||||
b=a|0xF0F0F0F0F0F0F0F0ULL;
|
||||
/* Before b must be 18085043209519168250 */ b=0;
|
||||
b=a&0xF0F0F0F0F0F0F0F0ULL;
|
||||
/* Before b must be 11574427654092267680 */ b=0;
|
||||
b=a^0xF0F0F0F0F0F0F0F0ULL;
|
||||
/* Before b must be 6510615555426900570 */ b=0;
|
||||
b=~(a|0xF0F0F0F0F0F0F0F0ULL);
|
||||
/* Before b must be 361700864190383365 */ b=0;
|
||||
b=~(a&0xF0F0F0F0F0F0F0F0ULL);
|
||||
/* Before b must be 6872316419617283935 */ b=0;
|
||||
b=~(a^0xF0F0F0F0F0F0F0F0ULL);
|
||||
/* Before b must be 11936128518282651045 */ b=0;
|
||||
b=~0xF0F0F0F0F0F0F0F0ULL;
|
||||
/* Before b must be 1085102592571150095 */ b=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
64
riscv/acstone/076.bool.c
Normal file
64
riscv/acstone/076.bool.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
/**
|
||||
* @file 076.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long int a,b,c;
|
||||
|
||||
a=-32;
|
||||
c=50;
|
||||
b=0;
|
||||
b=a<c;
|
||||
/* Before b must be 1 */ b=0;
|
||||
c=-5;
|
||||
b=a<c;
|
||||
/* Before b must be 1 */ b=0;
|
||||
a=200;
|
||||
c=-20;
|
||||
b=a<c;
|
||||
/* Before b must be 0 */ b=0;
|
||||
c=20;
|
||||
b=a<c;
|
||||
/* Before b must be 0 */ b=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
64
riscv/acstone/077.bool.c
Normal file
64
riscv/acstone/077.bool.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
/**
|
||||
* @file 077.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long int a,b,c;
|
||||
|
||||
a=-32;
|
||||
c=-50;
|
||||
b=0;
|
||||
b=a<-50;
|
||||
/* Before b must be 0 */ b=0;
|
||||
c=-5;
|
||||
b=a<-5;
|
||||
/* Before b must be 1 */ b=0;
|
||||
a=200;
|
||||
c=250;
|
||||
b=a<250;
|
||||
/* Before b must be 1 */ b=0;
|
||||
c=210;
|
||||
b=a<210;
|
||||
/* Before b must be 1 */ b=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
62
riscv/acstone/078.bool.c
Normal file
62
riscv/acstone/078.bool.c
Normal file
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
* @file 075.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long int a,b;
|
||||
|
||||
a=0x00000000;
|
||||
b=a|0x01F;
|
||||
/* Before b must be 0xFFFFFF00 */ b=0;
|
||||
b=a|0x00F;
|
||||
/* Before b must be 0x0000000F */ b=0;
|
||||
b=a|0x011;
|
||||
/* Before b must be 0x10000000 */ b=0;
|
||||
b=~(a|0x101);
|
||||
/* Before b must be 361700864190383365 */ b=0;
|
||||
b=~(a|0x111);
|
||||
/* Before b must be 6872316419617283935 */ b=0;
|
||||
b=~(a|0xFFF);
|
||||
/* Before b must be 11936128518282651045 */ b=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
149
riscv/acstone/081.shift.c
Normal file
149
riscv/acstone/081.shift.c
Normal file
|
@ -0,0 +1,149 @@
|
|||
/**
|
||||
* @file 081.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned char shifts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char uc;
|
||||
signed char sc;
|
||||
|
||||
|
||||
uc=0xFF;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 127 */ uc=0;
|
||||
|
||||
uc=0x00;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
uc=0x01;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
uc=0x80;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 64 */ uc=0;
|
||||
|
||||
uc=0xAA;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 85 */ uc=0;
|
||||
|
||||
uc=0x3C;
|
||||
uc=uc>>2;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
|
||||
sc=0xFF;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be -1 */ sc=0;
|
||||
|
||||
sc=0x00;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be 0 */ sc=0;
|
||||
|
||||
sc=0x01;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be 0 */ sc=0;
|
||||
|
||||
sc=0x80;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be -64 */ sc=0;
|
||||
|
||||
sc=0xAA;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be -43 */ sc=0;
|
||||
|
||||
sc=0x3C;
|
||||
sc=sc>>2;
|
||||
/* Before sc must be 15 */ sc=0;
|
||||
|
||||
|
||||
uc=0xFF;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 254 */ uc=0;
|
||||
|
||||
uc=0x00;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
uc=0x01;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 2 */ uc=0;
|
||||
|
||||
uc=0x80;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
uc=0xAA;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 84 */ uc=0;
|
||||
|
||||
uc=0x3C;
|
||||
uc=uc<<2;
|
||||
/* Before uc must be 240 */ uc=0;
|
||||
|
||||
|
||||
sc=0xFF;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be -2 */ sc=0;
|
||||
|
||||
sc=0x00;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be 0 */ sc=0;
|
||||
|
||||
sc=0x01;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be 2 */ sc=0;
|
||||
|
||||
sc=0x80;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be 0 */ sc=0;
|
||||
|
||||
sc=0xAA;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be 84 */ sc=0;
|
||||
|
||||
sc=0x3C;
|
||||
sc=sc<<2;
|
||||
/* Before sc must be -16 */ sc=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
149
riscv/acstone/082.shift.c
Normal file
149
riscv/acstone/082.shift.c
Normal file
|
@ -0,0 +1,149 @@
|
|||
/**
|
||||
* @file 082.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned short int shifts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int usi;
|
||||
signed short int ssi;
|
||||
|
||||
|
||||
usi=0xFFFF;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 32767 */ usi=0;
|
||||
|
||||
usi=0x0000;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 0 */ usi=0;
|
||||
|
||||
usi=0x0001;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 0 */ usi=0;
|
||||
|
||||
usi=0x8000;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 16384 */ usi=0;
|
||||
|
||||
usi=0xAAAA;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 21845 */ usi=0;
|
||||
|
||||
usi=0x03C0;
|
||||
usi=usi>>2;
|
||||
/* Before usi must be 240 */ usi=0;
|
||||
|
||||
|
||||
ssi=0xFFFF;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be -1 */ ssi=0;
|
||||
|
||||
ssi=0x0000;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be 0 */ ssi=0;
|
||||
|
||||
ssi=0x0001;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be 0 */ ssi=0;
|
||||
|
||||
ssi=0x8000;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be -16384 */ ssi=0;
|
||||
|
||||
ssi=0xAAAA;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be -10923 */ ssi=0;
|
||||
|
||||
ssi=0x03C0;
|
||||
ssi=ssi>>2;
|
||||
/* Before ssi must be 240 */ ssi=0;
|
||||
|
||||
|
||||
usi=0xFFFF;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 65534 */ usi=0;
|
||||
|
||||
usi=0x0000;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 0 */ usi=0;
|
||||
|
||||
usi=0x0001;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 2 */ usi=0;
|
||||
|
||||
usi=0x8000;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 0 */ usi=0;
|
||||
|
||||
usi=0xAAAA;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 21844 */ usi=0;
|
||||
|
||||
usi=0x03C0;
|
||||
usi=usi<<2;
|
||||
/* Before usi must be 3840 */ usi=0;
|
||||
|
||||
|
||||
ssi=0xFFFF;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be -2 */ ssi=0;
|
||||
|
||||
ssi=0x0000;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be 0 */ ssi=0;
|
||||
|
||||
ssi=0x0001;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be 2 */ ssi=0;
|
||||
|
||||
ssi=0x8000;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be 0 */ ssi=0;
|
||||
|
||||
ssi=0xAAAA;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be 21844 */ ssi=0;
|
||||
|
||||
ssi=0x03C0;
|
||||
ssi=ssi<<2;
|
||||
/* Before ssi must be 3840 */ ssi=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
149
riscv/acstone/083.shift.c
Normal file
149
riscv/acstone/083.shift.c
Normal file
|
@ -0,0 +1,149 @@
|
|||
/**
|
||||
* @file 083.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned int shifts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int ui;
|
||||
signed int si;
|
||||
|
||||
|
||||
ui=0xFFFFFFFF;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 2147483647 */ ui=0;
|
||||
|
||||
ui=0x00000000;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 0 */ ui=0;
|
||||
|
||||
ui=0x00000001;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 0 */ ui=0;
|
||||
|
||||
ui=0x80000000;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 1073741824 */ ui=0;
|
||||
|
||||
ui=0xAAAAAAAA;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 1431655765 */ ui=0;
|
||||
|
||||
ui=0x0003C000;
|
||||
ui=ui>>2;
|
||||
/* Before ui must be 61440 */ ui=0;
|
||||
|
||||
|
||||
si=0xFFFFFFFF;
|
||||
si=si>>1;
|
||||
/* Before si must be -1 */ si=0;
|
||||
|
||||
si=0x00000000;
|
||||
si=si>>1;
|
||||
/* Before si must be 0 */ si=0;
|
||||
|
||||
si=0x00000001;
|
||||
si=si>>1;
|
||||
/* Before si must be 0 */ si=0;
|
||||
|
||||
si=0x80000000;
|
||||
si=si>>1;
|
||||
/* Before si must be -1073741824 */ si=0;
|
||||
|
||||
si=0xAAAAAAAA;
|
||||
si=si>>1;
|
||||
/* Before si must be -715827883 */ si=0;
|
||||
|
||||
si=0x0003C000;
|
||||
si=si>>2;
|
||||
/* Before si must be 61440 */ si=0;
|
||||
|
||||
|
||||
ui=0xFFFFFFFF;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 4294967294 */ ui=0;
|
||||
|
||||
ui=0x00000000;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 0 */ ui=0;
|
||||
|
||||
ui=0x00000001;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 2 */ ui=0;
|
||||
|
||||
ui=0x80000000;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 0 */ ui=0;
|
||||
|
||||
ui=0xAAAAAAAA;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 1431655764 */ ui=0;
|
||||
|
||||
ui=0x0003C000;
|
||||
ui=ui<<2;
|
||||
/* Before ui must be 983040 */ ui=0;
|
||||
|
||||
|
||||
si=0xFFFFFFFF;
|
||||
si=si<<1;
|
||||
/* Before si must be -2 */ si=0;
|
||||
|
||||
si=0x00000000;
|
||||
si=si<<1;
|
||||
/* Before si must be 0 */ si=0;
|
||||
|
||||
si=0x00000001;
|
||||
si=si<<1;
|
||||
/* Before si must be 2 */ si=0;
|
||||
|
||||
si=0x80000000;
|
||||
si=si<<1;
|
||||
/* Before si must be 0 */ si=0;
|
||||
|
||||
si=0xAAAAAAAA;
|
||||
si=si<<1;
|
||||
/* Before si must be 1431655764 */ si=0;
|
||||
|
||||
si=0x0003C000;
|
||||
si=si<<2;
|
||||
/* Before si must be 983040 */ si=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
148
riscv/acstone/084.shift.c
Normal file
148
riscv/acstone/084.shift.c
Normal file
|
@ -0,0 +1,148 @@
|
|||
/**
|
||||
* @file 084.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned long long int shifts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int uli;
|
||||
signed long long int sli;
|
||||
|
||||
uli=0xFFFFFFFFFFFFFFFFULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 9223372036854775807 */ uli=0;
|
||||
|
||||
uli=0x0000000000000000ULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 0 */ uli=0;
|
||||
|
||||
uli=0x0000000000000001ULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 0 */ uli=0;
|
||||
|
||||
uli=0x8000000000000000ULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 4611686018427387904 */ uli=0;
|
||||
|
||||
uli=0xAAAAAAAAAAAAAAAAULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 6148914691236517205 */ uli=0;
|
||||
|
||||
uli=0x00000003C0000000ULL;
|
||||
uli=uli>>2;
|
||||
/* Before uli must be 4026531840 */ uli=0;
|
||||
|
||||
|
||||
sli=0xFFFFFFFFFFFFFFFFLL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be -1 */ sli=0;
|
||||
|
||||
sli=0x0000000000000000LL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be 0 */ sli=0;
|
||||
|
||||
sli=0x0000000000000001LL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be 0 */ sli=0;
|
||||
|
||||
sli=0x8000000000000000LL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be -4611686018427387904 */ sli=0;
|
||||
|
||||
sli=0xAAAAAAAAAAAAAAAALL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be -3074457345618258603 */ sli=0;
|
||||
|
||||
sli=0x00000003C0000000LL;
|
||||
sli=sli>>2;
|
||||
/* Before sli must be 4026531840 */ sli=0;
|
||||
|
||||
|
||||
uli=0xFFFFFFFFFFFFFFFFULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 18446744073709551614 */ uli=0;
|
||||
|
||||
uli=0x0000000000000000ULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 0 */ uli=0;
|
||||
|
||||
uli=0x0000000000000001ULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 2 */ uli=0;
|
||||
|
||||
uli=0x8000000000000000ULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 0 */ uli=0;
|
||||
|
||||
uli=0xAAAAAAAAAAAAAAAAULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 6148914691236517204 */ uli=0;
|
||||
|
||||
uli=0x00000003C0000000ULL;
|
||||
uli=uli<<2;
|
||||
/* Before uli must be 64424509440 */ uli=0;
|
||||
|
||||
|
||||
sli=0xFFFFFFFFFFFFFFFFLL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be -2 */ sli=0;
|
||||
|
||||
sli=0x0000000000000000LL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be 0 */ sli=0;
|
||||
|
||||
sli=0x0000000000000001LL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be 2 */ sli=0;
|
||||
|
||||
sli=0x8000000000000000LL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be 0 */ sli=0;
|
||||
|
||||
sli=0xAAAAAAAAAAAAAAAALL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be 6148914691236517204 */ sli=0;
|
||||
|
||||
sli=0x00000003C0000000LL;
|
||||
sli=sli<<2;
|
||||
/* Before sli must be 64424509440 */ sli=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
73
riscv/acstone/085.shift.c
Normal file
73
riscv/acstone/085.shift.c
Normal file
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
* @file 085.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses shifts and some logic operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int abcdefgh;
|
||||
unsigned long long int hgfedcba;
|
||||
unsigned int abcd;
|
||||
unsigned int dcba;
|
||||
unsigned short int ab;
|
||||
unsigned short int ba;
|
||||
|
||||
abcdefgh=0x8899AABBCCDDEEFFULL;
|
||||
hgfedcba=(((abcdefgh & 0xFF00000000000000ULL)>>56) |
|
||||
((abcdefgh & 0x00FF000000000000ULL)>>40) |
|
||||
((abcdefgh & 0x0000FF0000000000ULL)>>24) |
|
||||
((abcdefgh & 0x000000FF00000000ULL)>>8) |
|
||||
((abcdefgh & 0x00000000FF000000ULL)<<8) |
|
||||
((abcdefgh & 0x0000000000FF0000ULL)<<24) |
|
||||
((abcdefgh & 0x000000000000FF00ULL)<<40) |
|
||||
((abcdefgh & 0x00000000000000FFULL)<<56));
|
||||
/* Before hgfedcba must be 18441921395520346504 */ hgfedcba=0;
|
||||
|
||||
abcd=0xAABBCCDD;
|
||||
dcba=(((abcd & 0x000000FF)<<24) | ((abcd & 0x0000FF00)<<8) |
|
||||
((abcd & 0x00FF0000)>>8) | ((abcd & 0xFF000000)>>24));
|
||||
/* Before dcba must be 3721182122 */ dcba=0;
|
||||
|
||||
ab=0xAABB;
|
||||
ba=(((ab & 0x00FF)<<8) | ((ab & 0xFF00)>>8));
|
||||
/* Before ba must be 48042 */ ba=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
70
riscv/acstone/086.shift.c
Normal file
70
riscv/acstone/086.shift.c
Normal file
|
@ -0,0 +1,70 @@
|
|||
/**
|
||||
* @file 086.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses shifts and some logic operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a;
|
||||
signed long long int b;
|
||||
|
||||
a = 0xFFFFFFFFFFFFFF38;
|
||||
b = 0x0;
|
||||
|
||||
//before a = -200
|
||||
a = a >> b;
|
||||
//after a = -200
|
||||
|
||||
b = 0x1;
|
||||
//before a = -200
|
||||
a = a >> b;
|
||||
//after a = -100
|
||||
|
||||
b = 0x2;
|
||||
//before a = -100
|
||||
a = a >> b;
|
||||
//after a = -25
|
||||
|
||||
//before a = -25
|
||||
a = a >> b;
|
||||
//after a = -7
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
244
riscv/acstone/111.if.c
Normal file
244
riscv/acstone/111.if.c
Normal file
|
@ -0,0 +1,244 @@
|
|||
/**
|
||||
* @file 111.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed char ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x00;
|
||||
b=0xFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFF;
|
||||
b=0xFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x01;
|
||||
b=0x02;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0x0F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x01;
|
||||
b=0xFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
244
riscv/acstone/112.if.c
Normal file
244
riscv/acstone/112.if.c
Normal file
|
@ -0,0 +1,244 @@
|
|||
/**
|
||||
* @file 112.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned char ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x00;
|
||||
b=0xFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFF;
|
||||
b=0xFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x01;
|
||||
b=0x02;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0x0F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x01;
|
||||
b=0xFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
244
riscv/acstone/113.if.c
Normal file
244
riscv/acstone/113.if.c
Normal file
|
@ -0,0 +1,244 @@
|
|||
/**
|
||||
* @file 113.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed short int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0xFFFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0001;
|
||||
b=0x0002;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x000F;
|
||||
b=0x000F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0001;
|
||||
b=0xFFFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
244
riscv/acstone/114.if.c
Normal file
244
riscv/acstone/114.if.c
Normal file
|
@ -0,0 +1,244 @@
|
|||
/**
|
||||
* @file 114.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned short int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0xFFFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0001;
|
||||
b=0x0002;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x000F;
|
||||
b=0x000F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0001;
|
||||
b=0xFFFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
244
riscv/acstone/115.if.c
Normal file
244
riscv/acstone/115.if.c
Normal file
|
@ -0,0 +1,244 @@
|
|||
/**
|
||||
* @file 115.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0xFFFFFFFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x00000001;
|
||||
b=0x00000002;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x0000000F;
|
||||
b=0x0000000F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x00000001;
|
||||
b=0xFFFFFFFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
244
riscv/acstone/116.if.c
Normal file
244
riscv/acstone/116.if.c
Normal file
|
@ -0,0 +1,244 @@
|
|||
/**
|
||||
* @file 116.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0xFFFFFFFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x00000001;
|
||||
b=0x00000002;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x0000000F;
|
||||
b=0x0000000F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x00000001;
|
||||
b=0xFFFFFFFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
244
riscv/acstone/117.if.c
Normal file
244
riscv/acstone/117.if.c
Normal file
|
@ -0,0 +1,244 @@
|
|||
/**
|
||||
* @file 117.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed long long int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x0000000000000000LL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFLL;
|
||||
b=0xFFFFFFFFFFFFFFFELL;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0000000000000001LL;
|
||||
b=0x0000000000000002LL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x000000000000000FLL;
|
||||
b=0x000000000000000FLL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0000000000000001LL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
244
riscv/acstone/118.if.c
Normal file
244
riscv/acstone/118.if.c
Normal file
|
@ -0,0 +1,244 @@
|
|||
/**
|
||||
* @file 118.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned long long int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x0000000000000000ULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0xFFFFFFFFFFFFFFFEULL;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0000000000000001ULL;
|
||||
b=0x0000000000000002ULL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x000000000000000FULL;
|
||||
b=0x000000000000000FULL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0000000000000001ULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
131
riscv/acstone/119.if.c
Normal file
131
riscv/acstone/119.if.c
Normal file
|
@ -0,0 +1,131 @@
|
|||
/**
|
||||
* @file 119.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various ifs.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a;
|
||||
unsigned char b;
|
||||
signed short int c;
|
||||
unsigned short int d;
|
||||
signed int e;
|
||||
unsigned int f;
|
||||
signed long long int g;
|
||||
unsigned long long int h;
|
||||
|
||||
unsigned char ok,failed;
|
||||
|
||||
ok=0;
|
||||
failed=0;
|
||||
a=0;
|
||||
b=1;
|
||||
c=2;
|
||||
d=3;
|
||||
e=4;
|
||||
f=5;
|
||||
g=6;
|
||||
h=7;
|
||||
|
||||
if(a==0)
|
||||
if(b==1)
|
||||
if(c==2)
|
||||
if(d==3)
|
||||
if(e==4)
|
||||
if(f==5)
|
||||
if(g==6)
|
||||
if(h==7)
|
||||
ok++; /* $= OK! */
|
||||
|
||||
if(a>=0)
|
||||
if(b<=1)
|
||||
if(c>=2)
|
||||
if(d<=3)
|
||||
if(e>=4)
|
||||
if(f>=5)
|
||||
if(g<=6)
|
||||
if(h<=7)
|
||||
ok++; /* $= OK! */
|
||||
|
||||
if(a>=-1)
|
||||
if(b>=1)
|
||||
if(c>=-2)
|
||||
if(d>=3)
|
||||
if(e>=-3)
|
||||
if(f>=5)
|
||||
if(g>=-4)
|
||||
if(h>=7)
|
||||
ok++; /* $= OK! */
|
||||
|
||||
if(a==0)
|
||||
if(b==1)
|
||||
if(c==2)
|
||||
if(d==3)
|
||||
if(e<4)
|
||||
if(f==5)
|
||||
if(g==6)
|
||||
if(h==7)
|
||||
failed++; /* $= FAILED! */
|
||||
|
||||
if(a>=0)
|
||||
if(b<=1)
|
||||
if(c>=2)
|
||||
if(d<=3)
|
||||
if(e>=4)
|
||||
if(f>=5)
|
||||
if(g<=6)
|
||||
if(h==8)
|
||||
failed++; /* $= FAILED! */
|
||||
|
||||
if(a==-1)
|
||||
if(b>=1)
|
||||
if(c>=-2)
|
||||
if(d>=3)
|
||||
if(e>=-3)
|
||||
if(f>=5)
|
||||
if(g>=-4)
|
||||
if(h>=7)
|
||||
failed++; /* $= FAILED! */
|
||||
|
||||
ok=0; /* Before ok must be 3 */
|
||||
failed=0; /* Before failed must be 0 */
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
100
riscv/acstone/121.loop.c
Normal file
100
riscv/acstone/121.loop.c
Normal file
|
@ -0,0 +1,100 @@
|
|||
/**
|
||||
* @file 121.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses while loops.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int cont;
|
||||
|
||||
unsigned char a;
|
||||
signed char b;
|
||||
unsigned short int c;
|
||||
signed short int d;
|
||||
unsigned int e;
|
||||
signed int f;
|
||||
unsigned long long int g;
|
||||
signed long long int h;
|
||||
|
||||
cont=0;
|
||||
|
||||
a=5;
|
||||
while(a--)
|
||||
cont++;
|
||||
/* Before a must be 255 and cont 5 */ a=0;
|
||||
|
||||
b=5;
|
||||
while(b--)
|
||||
cont++;
|
||||
/* Before b must be -1 and cont 10 */ b=0;
|
||||
|
||||
c=5;
|
||||
while(c--)
|
||||
cont++;
|
||||
/* Before c must be 65535 and cont 15 */ c=0;
|
||||
|
||||
d=5;
|
||||
while(d--)
|
||||
cont++;
|
||||
/* Before d must be -1 and cont 20 */ d=0;
|
||||
|
||||
e=5;
|
||||
while(e--)
|
||||
cont++;
|
||||
/* Before e must be 4294967295 and cont 25 */ e=0;
|
||||
|
||||
f=5;
|
||||
while(f--)
|
||||
cont++;
|
||||
/* Before f must be -1 and cont 30 */ f=0;
|
||||
|
||||
g=5;
|
||||
while(g--)
|
||||
cont++;
|
||||
/* Before g must be 18446744073709551615 and cont 35 */ g=0;
|
||||
|
||||
h=5;
|
||||
while(h--)
|
||||
cont++;
|
||||
/* Before h must be -1 and cont 40 */ h=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
91
riscv/acstone/122.loop.c
Normal file
91
riscv/acstone/122.loop.c
Normal file
|
@ -0,0 +1,91 @@
|
|||
/**
|
||||
* @file 122.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses for loops.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int cont;
|
||||
|
||||
unsigned char a;
|
||||
signed char b;
|
||||
unsigned short int c;
|
||||
signed short int d;
|
||||
unsigned int e;
|
||||
signed int f;
|
||||
unsigned long long int g;
|
||||
signed long long int h;
|
||||
|
||||
cont=0;
|
||||
|
||||
for(a=0;a<5;a++)
|
||||
cont++;
|
||||
/* Before a must be 5 and cont 5 */ a=0;
|
||||
|
||||
for(b=0;b<5;b++)
|
||||
cont++;
|
||||
/* Before b must be 5 and cont 10 */ b=0;
|
||||
|
||||
for(c=0;c<5;c++)
|
||||
cont++;
|
||||
/* Before c must be 5 and cont 15 */ c=0;
|
||||
|
||||
for(d=0;d<5;d++)
|
||||
cont++;
|
||||
/* Before d must be 5 and cont 20 */ d=0;
|
||||
|
||||
for(e=0;e<5;e++)
|
||||
cont++;
|
||||
/* Before e must be 5 and cont 25 */ e=0;
|
||||
|
||||
for(f=0;f<5;f++)
|
||||
cont++;
|
||||
/* Before f must be 5 and cont 30 */ f=0;
|
||||
|
||||
for(g=0;g<5;g++)
|
||||
cont++;
|
||||
/* Before g must be 5 and cont 35 */ g=0;
|
||||
|
||||
for(h=0;h<5;h++)
|
||||
cont++;
|
||||
/* Before h must be 5 and cont 40 */ h=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
89
riscv/acstone/123.loop.c
Normal file
89
riscv/acstone/123.loop.c
Normal file
|
@ -0,0 +1,89 @@
|
|||
/**
|
||||
* @file 123.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses a implemented unsigned multiplication
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char count;
|
||||
unsigned int C,A,Q,M;
|
||||
unsigned long long int result;
|
||||
|
||||
count=32; /* 32 bits * 32 bits = 64 bits */
|
||||
|
||||
/* Some variable */
|
||||
M=0x1314AB42;
|
||||
Q=0xF1B34517;
|
||||
A=0x00000000;
|
||||
C=0x00000000;
|
||||
|
||||
while(count!=0) {
|
||||
|
||||
/* if q0 = 1 add */
|
||||
if(Q & 0x00000001) {
|
||||
if(((unsigned long long int)A+
|
||||
(unsigned long long int)M) > 0xFFFFFFFF) /* Check if have carry */
|
||||
C=1;
|
||||
else
|
||||
C=0;
|
||||
A=A+M;
|
||||
}
|
||||
|
||||
/* Shift */
|
||||
Q=Q>>1;
|
||||
if(A & 0x00000001)
|
||||
Q=(Q | 0x80000000);
|
||||
A=A>>1;
|
||||
if(C & 0x00000001)
|
||||
A=(A | 0x80000000);
|
||||
C=C>>1;
|
||||
|
||||
/* Decrement counter */
|
||||
count--;
|
||||
|
||||
}
|
||||
|
||||
result=0;
|
||||
result=((((unsigned long long int)(A)) << 32) |
|
||||
((unsigned long long int)(Q)));
|
||||
/* Before result must be 1298111822488546542 */ result=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
104
riscv/acstone/124.loop.c
Normal file
104
riscv/acstone/124.loop.c
Normal file
|
@ -0,0 +1,104 @@
|
|||
/**
|
||||
* @file 124.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses a implemented signed multiplication (Booth)
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char count;
|
||||
unsigned int A,Q,Qmenos,M,mask;
|
||||
signed long long int result;
|
||||
|
||||
count=32; /* 32 bits * 32 bits = 64 bits */
|
||||
|
||||
/* Some variable */
|
||||
M=0x82348243;
|
||||
Q=0x41378972;
|
||||
Qmenos=0x00000000;
|
||||
A=0x00000000;
|
||||
|
||||
while(count!=0) {
|
||||
|
||||
mask=(((Q<<1) & 0x00000002) | (Qmenos & 0x00000001));
|
||||
|
||||
switch(mask) {
|
||||
|
||||
case 0x0: /* q0=0 and qm=0 */
|
||||
case 0x3: /* qo=1 and qm=1 */
|
||||
/* Nothing */
|
||||
break;
|
||||
|
||||
case 0x2: /* q0=1 and qm=0 */
|
||||
A=A-M;
|
||||
break;
|
||||
|
||||
case 0x1: /* q0=0 and qm=1 */
|
||||
A=A+M;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
/* Shift */
|
||||
if(Q & 0x00000001)
|
||||
Qmenos=1;
|
||||
else
|
||||
Qmenos=0;
|
||||
|
||||
Q=Q>>1;
|
||||
|
||||
if(A & 0x00000001)
|
||||
Q=(Q | 0x80000000);
|
||||
else
|
||||
Q=(Q & 0x7FFFFFFF);
|
||||
|
||||
A=A>>1;
|
||||
if(A & 0x40000000)
|
||||
A=(A | 0x80000000);
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
result=0;
|
||||
result=((((unsigned long long int)(A)) << 32) |
|
||||
((unsigned long long int)(Q)));
|
||||
/* Before result must be -2309208815826051882 */ result=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
73
riscv/acstone/125.loop.c
Normal file
73
riscv/acstone/125.loop.c
Normal file
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
* @file 125.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses a implemented simple strlen loop.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char *ac="ArchC - Architecture Description Language\n";
|
||||
unsigned char *lsc="Computer System Laboratory\n";
|
||||
unsigned char *ic="Institute of Computing - UNICAMP\n";
|
||||
unsigned char *p;
|
||||
unsigned int count;
|
||||
|
||||
p=ac;
|
||||
count=0;
|
||||
while(*p) { /* strlen */
|
||||
p++; count++;
|
||||
}
|
||||
/* Before count must be 42 */ count=0;
|
||||
|
||||
p=lsc;
|
||||
count=0;
|
||||
while(*p) { /* strlen */
|
||||
p++; count++;
|
||||
}
|
||||
/* Before count must be 27 */ count=0;
|
||||
|
||||
p=ic;
|
||||
count=0;
|
||||
while(*p) { /* strlen */
|
||||
p++; count++;
|
||||
}
|
||||
/* Before count must be 33 */ count=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
73
riscv/acstone/126.loop.c
Normal file
73
riscv/acstone/126.loop.c
Normal file
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
* @file 126.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses implemented simple fatorial loop.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int nu;
|
||||
unsigned long long int resultu;
|
||||
unsigned long long int iu;
|
||||
|
||||
signed long long int ns;
|
||||
signed long long int results;
|
||||
signed long long int is;
|
||||
|
||||
nu=25;
|
||||
resultu=1;
|
||||
iu=nu;
|
||||
while(iu>1) {
|
||||
resultu=resultu*iu;
|
||||
iu--;
|
||||
}
|
||||
/* Before must be 7034535277573963776 */ resultu=0;
|
||||
|
||||
ns=25;
|
||||
results=1;
|
||||
is=ns;
|
||||
while(is>1) {
|
||||
results=results*is;
|
||||
is--;
|
||||
}
|
||||
/* Before must be 7034535277573963776 */ results=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
75
riscv/acstone/131.call.c
Normal file
75
riscv/acstone/131.call.c
Normal file
|
@ -0,0 +1,75 @@
|
|||
/**
|
||||
* @file 131.call.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses calls functions arg int, ret int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
int tmp;
|
||||
|
||||
tmp=funcmenos(0);
|
||||
/* Before tmp must be -1 */ tmp=0;
|
||||
|
||||
tmp=funcmais(0);
|
||||
/* Before tmp must be 1 */ tmp=0;
|
||||
|
||||
tmp=funcmenos(-1);
|
||||
/* Before tmp must be -2 */ tmp=0;
|
||||
|
||||
tmp=funcmais(-1);
|
||||
/* Before tmp must be 0 */ tmp=0;
|
||||
|
||||
tmp=funcmenos(1);
|
||||
/* Before tmp must be 0 */ tmp=0;
|
||||
|
||||
tmp=funcmais(1);
|
||||
/* Before tmp must be 2 */ tmp=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
int funcmenos(int input) {
|
||||
return(input-1);
|
||||
}
|
||||
|
||||
int funcmais(int input) {
|
||||
return(input+1);
|
||||
}
|
||||
|
141
riscv/acstone/132.call.c
Normal file
141
riscv/acstone/132.call.c
Normal file
|
@ -0,0 +1,141 @@
|
|||
/**
|
||||
* @file 132.call.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses indirect calls functions.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* Declarations */
|
||||
signed char funcA(signed char input);
|
||||
signed char funcB(signed char input);
|
||||
signed char funcC(signed char input);
|
||||
signed char funcD(signed char input);
|
||||
signed char funcE(signed char input);
|
||||
signed char funcF(signed char input);
|
||||
signed char funcG(signed char input);
|
||||
signed char funcH(signed char input);
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char tmp=0;
|
||||
tmp=funcA(-1);
|
||||
/* Before tmp must be -1 */ tmp=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
unsigned long long int count=0;
|
||||
|
||||
signed char funcA(signed char input) {
|
||||
signed int a=-2;
|
||||
funcB(input);
|
||||
count++;
|
||||
a++;
|
||||
/* Before a must be -1 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcB(signed char input) {
|
||||
unsigned int b=0;
|
||||
funcC(input);
|
||||
count++;
|
||||
b++;
|
||||
/* Before b must be 1 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcC(signed char input) {
|
||||
signed short int c=-1;
|
||||
funcD(input);
|
||||
count++;
|
||||
c++;
|
||||
/* Before c must be 0 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcD(signed char input) {
|
||||
unsigned short int d=9;
|
||||
funcE(input);
|
||||
count++;
|
||||
d++;
|
||||
/* Before d must be 10 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcE(signed char input) {
|
||||
signed int e=-1;
|
||||
funcF(input);
|
||||
count++;
|
||||
e++;
|
||||
/* Before e must be 0 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcF(signed char input) {
|
||||
unsigned int f=14;
|
||||
funcG(input);
|
||||
count++;
|
||||
f++;
|
||||
/* Before f must be 15 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcG(signed char input) {
|
||||
signed long long int g=-2;
|
||||
funcH(input);
|
||||
count++;
|
||||
g++;
|
||||
/* Before g must be -1 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcH(signed char input) {
|
||||
unsigned long long int h=1;
|
||||
count++;
|
||||
h++;
|
||||
|
||||
/* Before h must be 2 */ return input;
|
||||
}
|
||||
|
75
riscv/acstone/133.call.c
Normal file
75
riscv/acstone/133.call.c
Normal file
|
@ -0,0 +1,75 @@
|
|||
/**
|
||||
* @file 133.call.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses recursive fatorial.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* Declarations */
|
||||
unsigned long long int ulifatorial(unsigned long long int n);
|
||||
signed long long int slifatorial(signed long long int n);
|
||||
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int ulin;
|
||||
signed long long int slin;
|
||||
|
||||
ulin=ulifatorial(25);
|
||||
/* Before ulin must be 7034535277573963776 */ ulin=0;
|
||||
slin=slifatorial(25);
|
||||
/* Before slin must be 7034535277573963776 */ slin=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
|
||||
unsigned long long int ulifatorial(unsigned long long int n) {
|
||||
if(n > 1)
|
||||
return(n*ulifatorial(n-1));
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
signed long long int slifatorial(signed long long int n) {
|
||||
if(n > 1)
|
||||
return(n*slifatorial(n-1));
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
76
riscv/acstone/134.call.c
Normal file
76
riscv/acstone/134.call.c
Normal file
|
@ -0,0 +1,76 @@
|
|||
/**
|
||||
* @file 134.call.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses recursive Fibonacci function.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* Declarations */
|
||||
unsigned long long int ulifibonacci(unsigned long long int n);
|
||||
signed long long int slifibonacci(signed long long int n);
|
||||
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int ulin;
|
||||
signed long long int slin;
|
||||
|
||||
ulin=ulifibonacci(13);
|
||||
/* Before ulin must be */ ulin=0;
|
||||
slin=slifibonacci(13);
|
||||
/* Before ulin must be */ slin=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
unsigned long long int ulifibonacci(unsigned long long int n) {
|
||||
if(n < 3)
|
||||
return 1;
|
||||
else
|
||||
return(ulifibonacci(n-1)+
|
||||
ulifibonacci(n-2));
|
||||
}
|
||||
|
||||
signed long long int slifibonacci(signed long long int n) {
|
||||
if(n < 3)
|
||||
return 1;
|
||||
else
|
||||
return(slifibonacci(n-1)+
|
||||
slifibonacci(n-2));
|
||||
}
|
||||
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
162
riscv/acstone/141.array.c
Normal file
162
riscv/acstone/141.array.c
Normal file
|
@ -0,0 +1,162 @@
|
|||
/**
|
||||
* @file 141.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses size three dot products.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char uca[3];
|
||||
unsigned char ucb[3];
|
||||
unsigned char ucc;
|
||||
|
||||
signed char sca[3];
|
||||
signed char scb[3];
|
||||
signed char scc;
|
||||
|
||||
unsigned short int usia[3];
|
||||
unsigned short int usib[3];
|
||||
unsigned short int usic;
|
||||
|
||||
signed short int ssia[3];
|
||||
signed short int ssib[3];
|
||||
signed short int ssic;
|
||||
|
||||
unsigned int uia[3];
|
||||
unsigned int uib[3];
|
||||
unsigned int uic;
|
||||
|
||||
signed int sia[3];
|
||||
signed int sib[3];
|
||||
signed int sic;
|
||||
|
||||
unsigned long long int ulia[3];
|
||||
unsigned long long int ulib[3];
|
||||
unsigned long long int ulic;
|
||||
|
||||
signed long long int slia[3];
|
||||
signed long long int slib[3];
|
||||
signed long long int slic;
|
||||
|
||||
unsigned char count;
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
uca[count-1]=count;
|
||||
ucb[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
usia[count-1]=count;
|
||||
usib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
uia[count-1]=count;
|
||||
uib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
ulia[count-1]=count;
|
||||
ulib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
sca[count-1]=count;
|
||||
scb[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
ssia[count-1]=count;
|
||||
ssib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
sia[count-1]=count;
|
||||
sib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
slia[count-1]=count;
|
||||
slib[count-1]=count;
|
||||
}
|
||||
|
||||
|
||||
ucc=0;
|
||||
for(count=0;count<3;count++)
|
||||
ucc=ucc+(uca[count]*ucb[count]);
|
||||
/* Before ucc must be 14 */ ucc=0;
|
||||
|
||||
scc=0;
|
||||
for(count=0;count<3;count++)
|
||||
scc=scc+(sca[count]*scb[count]);
|
||||
/* Before scc must be 14 */ scc=0;
|
||||
|
||||
usic=0;
|
||||
for(count=0;count<3;count++)
|
||||
usic=usic+(usia[count]*usib[count]);
|
||||
/* Before usic must be 14 */ usic=0;
|
||||
|
||||
ssic=0;
|
||||
for(count=0;count<3;count++)
|
||||
ssic=ssic+(ssia[count]*ssib[count]);
|
||||
/* Before ssic must be 14 */ ssic=0;
|
||||
|
||||
uic=0;
|
||||
for(count=0;count<3;count++)
|
||||
uic=uic+(uia[count]*uib[count]);
|
||||
/* Before uic must be 14 */ uic=0;
|
||||
|
||||
sic=0;
|
||||
for(count=0;count<3;count++)
|
||||
sic=sic+(sia[count]*sib[count]);
|
||||
/* Before sic must be 14 */ sic=0;
|
||||
|
||||
ulic=0;
|
||||
for(count=0;count<3;count++)
|
||||
ulic=ulic+(ulia[count]*ulib[count]);
|
||||
/* Before ulic must be 14 */ ulic=0;
|
||||
|
||||
slic=0;
|
||||
for(count=0;count<3;count++)
|
||||
slic=slic+(slia[count]*slib[count]);
|
||||
/* Before slic must be 14 */ slic=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
82
riscv/acstone/142.array.c
Normal file
82
riscv/acstone/142.array.c
Normal file
|
@ -0,0 +1,82 @@
|
|||
/**
|
||||
* @file 142.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses a kind of square matrix multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a[10][10];
|
||||
signed long long int b[10][10];
|
||||
signed long long int c[10][10];
|
||||
|
||||
unsigned char i,j,k;
|
||||
|
||||
unsigned char error=0;
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* A = I */
|
||||
for(j=0 ; j<10 ; j++) {
|
||||
if(i==j)
|
||||
a[i][j]=1;
|
||||
else
|
||||
a[i][j]=0;
|
||||
}
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* B = X */
|
||||
for(j=0 ; j<10 ; j++)
|
||||
b[i][j]=((signed long long int)i+(signed long long int)j);
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* C = 0 */
|
||||
for(j=0 ; j<10 ; j++)
|
||||
c[i][j]=0;
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* C = A . B */
|
||||
for(j=0 ; j<10 ; j++)
|
||||
for(k=0 ; k<10 ; k++)
|
||||
c[i][j]=c[i][j]+(a[i][k]*b[k][j]);
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* B = C ? */
|
||||
for(j=0 ; j<10 ; j++)
|
||||
if(b[i][j] != c[i][j])
|
||||
error=1;
|
||||
|
||||
/* Before error must be 0 */ error=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
151
riscv/acstone/143.array.c
Normal file
151
riscv/acstone/143.array.c
Normal file
|
@ -0,0 +1,151 @@
|
|||
/**
|
||||
* @file 143.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned char Bubble Sort.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
void scBubbleSort(signed char scarray[],int size);
|
||||
void ucBubbleSort(unsigned char ucarray[],int size);
|
||||
|
||||
int main() {
|
||||
|
||||
signed char scinput[21];
|
||||
unsigned char ucinput[21];
|
||||
|
||||
signed char i;
|
||||
unsigned char j;
|
||||
|
||||
int count=0,errorsc=0,erroruc=0;
|
||||
|
||||
scinput[0]=0xDF;
|
||||
scinput[1]=0x44;
|
||||
scinput[2]=0x12;
|
||||
scinput[3]=0x45;
|
||||
scinput[4]=0x80;
|
||||
scinput[5]=0xDD;
|
||||
scinput[6]=0x43;
|
||||
scinput[7]=0x67;
|
||||
scinput[8]=0x00;
|
||||
scinput[9]=0x23;
|
||||
scinput[10]=0x01;
|
||||
scinput[11]=0xF7;
|
||||
scinput[12]=0x45;
|
||||
scinput[13]=0x86;
|
||||
scinput[14]=0x96;
|
||||
scinput[15]=0x52;
|
||||
scinput[16]=0xFF;
|
||||
scinput[17]=0x56;
|
||||
scinput[18]=0x23;
|
||||
scinput[19]=0x10;
|
||||
scinput[20]=0x05;
|
||||
|
||||
ucinput[0]=0xDF;
|
||||
ucinput[1]=0x44;
|
||||
ucinput[2]=0x12;
|
||||
ucinput[3]=0x45;
|
||||
ucinput[4]=0x80;
|
||||
ucinput[5]=0xDD;
|
||||
ucinput[6]=0x43;
|
||||
ucinput[7]=0x67;
|
||||
ucinput[8]=0x00;
|
||||
ucinput[9]=0x23;
|
||||
ucinput[10]=0x01;
|
||||
ucinput[11]=0xF7;
|
||||
ucinput[12]=0x45;
|
||||
ucinput[13]=0x86;
|
||||
ucinput[14]=0x96;
|
||||
ucinput[15]=0x52;
|
||||
ucinput[16]=0xFF;
|
||||
ucinput[17]=0x56;
|
||||
ucinput[18]=0x23;
|
||||
ucinput[19]=0x10;
|
||||
ucinput[20]=0x05;
|
||||
|
||||
|
||||
/* signed sort */
|
||||
scBubbleSort(scinput,21);
|
||||
/* unsigned sort */
|
||||
ucBubbleSort(ucinput,21);
|
||||
|
||||
|
||||
/* Check */
|
||||
errorsc=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(scinput[count] > scinput[count+1])
|
||||
errorsc=1;
|
||||
|
||||
/* Check */
|
||||
erroruc=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(ucinput[count] > ucinput[count+1])
|
||||
erroruc=1;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
/* signed char bubble sort */
|
||||
void scBubbleSort(signed char scarray[],int size) {
|
||||
int i,j;
|
||||
signed char temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(scarray[j+1] < scarray[j]) {
|
||||
temp=scarray[j+1];
|
||||
scarray[j+1]=scarray[j];
|
||||
scarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* unsigned char bubble sort */
|
||||
void ucBubbleSort(unsigned char ucarray[],int size) {
|
||||
int i,j;
|
||||
unsigned char temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(ucarray[j+1] < ucarray[j]) {
|
||||
temp=ucarray[j+1];
|
||||
ucarray[j+1]=ucarray[j];
|
||||
ucarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
151
riscv/acstone/144.array.c
Normal file
151
riscv/acstone/144.array.c
Normal file
|
@ -0,0 +1,151 @@
|
|||
/**
|
||||
* @file 144.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned short int Bubble Sort.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
void ssiBubbleSort(signed short int ssiarray[],int size);
|
||||
void usiBubbleSort(unsigned short int usiarray[],int size);
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int ssiinput[21];
|
||||
unsigned short int usiinput[21];
|
||||
|
||||
signed char i;
|
||||
unsigned char j;
|
||||
|
||||
int count,errorssi,errorusi;
|
||||
|
||||
ssiinput[0]=0xF5DF;
|
||||
ssiinput[1]=0x2444;
|
||||
ssiinput[2]=0x5612;
|
||||
ssiinput[3]=0xF645;
|
||||
ssiinput[4]=0xFF80;
|
||||
ssiinput[5]=0x12DD;
|
||||
ssiinput[6]=0x4343;
|
||||
ssiinput[7]=0xF167;
|
||||
ssiinput[8]=0x0000;
|
||||
ssiinput[9]=0x0123;
|
||||
ssiinput[10]=0x3301;
|
||||
ssiinput[11]=0x12F7;
|
||||
ssiinput[12]=0x8745;
|
||||
ssiinput[13]=0x8286;
|
||||
ssiinput[14]=0x1296;
|
||||
ssiinput[15]=0x3452;
|
||||
ssiinput[16]=0xE3FF;
|
||||
ssiinput[17]=0x2456;
|
||||
ssiinput[18]=0x6723;
|
||||
ssiinput[19]=0x7510;
|
||||
ssiinput[20]=0x0005;
|
||||
|
||||
usiinput[0]=0xF5DF;
|
||||
usiinput[1]=0x2444;
|
||||
usiinput[2]=0x5612;
|
||||
usiinput[3]=0xF645;
|
||||
usiinput[4]=0xFF80;
|
||||
usiinput[5]=0x12DD;
|
||||
usiinput[6]=0x4343;
|
||||
usiinput[7]=0xF167;
|
||||
usiinput[8]=0x0000;
|
||||
usiinput[9]=0x0123;
|
||||
usiinput[10]=0x3301;
|
||||
usiinput[11]=0x12F7;
|
||||
usiinput[12]=0x8745;
|
||||
usiinput[13]=0x8286;
|
||||
usiinput[14]=0x1296;
|
||||
usiinput[15]=0x3452;
|
||||
usiinput[16]=0xE3FF;
|
||||
usiinput[17]=0x2456;
|
||||
usiinput[18]=0x6723;
|
||||
usiinput[19]=0x7510;
|
||||
usiinput[20]=0x0005;
|
||||
|
||||
|
||||
/* signed sort */
|
||||
ssiBubbleSort(ssiinput,21);
|
||||
/* unsigned sort */
|
||||
usiBubbleSort(usiinput,21);
|
||||
|
||||
|
||||
/* Check */
|
||||
errorssi=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(ssiinput[count] > ssiinput[count+1])
|
||||
errorssi=1;
|
||||
|
||||
/* Check */
|
||||
errorusi=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(usiinput[count] > usiinput[count+1])
|
||||
errorusi=1;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
/* signed short int bubble sort */
|
||||
void ssiBubbleSort(signed short int ssiarray[],int size) {
|
||||
int i,j;
|
||||
signed short int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(ssiarray[j+1] < ssiarray[j]) {
|
||||
temp=ssiarray[j+1];
|
||||
ssiarray[j+1]=ssiarray[j];
|
||||
ssiarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* unsigned short int bubble sort */
|
||||
void usiBubbleSort(unsigned short int usiarray[],int size) {
|
||||
int i,j;
|
||||
unsigned short int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(usiarray[j+1] < usiarray[j]) {
|
||||
temp=usiarray[j+1];
|
||||
usiarray[j+1]=usiarray[j];
|
||||
usiarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
151
riscv/acstone/145.array.c
Normal file
151
riscv/acstone/145.array.c
Normal file
|
@ -0,0 +1,151 @@
|
|||
/**
|
||||
* @file 145.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned int Bubble Sort.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
void siBubbleSort(signed int siarray[],int size);
|
||||
void uiBubbleSort(unsigned int uiarray[],int size);
|
||||
|
||||
int main() {
|
||||
|
||||
signed int siinput[21];
|
||||
unsigned int uiinput[21];
|
||||
|
||||
signed char i;
|
||||
unsigned char j;
|
||||
|
||||
int count,errorsi,errorui;
|
||||
|
||||
siinput[0]=0xF234F5DF;
|
||||
siinput[1]=0x23512444;
|
||||
siinput[2]=0x34565612;
|
||||
siinput[3]=0x1234F645;
|
||||
siinput[4]=0x8901FF80;
|
||||
siinput[5]=0x789012DD;
|
||||
siinput[6]=0x23454343;
|
||||
siinput[7]=0x8965F167;
|
||||
siinput[8]=0x00000000;
|
||||
siinput[9]=0x45670123;
|
||||
siinput[10]=0x23453301;
|
||||
siinput[11]=0x543212F7;
|
||||
siinput[12]=0x76548745;
|
||||
siinput[13]=0x23458286;
|
||||
siinput[14]=0x87651296;
|
||||
siinput[15]=0xD3453452;
|
||||
siinput[16]=0xC432E3FF;
|
||||
siinput[17]=0x22222456;
|
||||
siinput[18]=0x12346723;
|
||||
siinput[19]=0xD4567510;
|
||||
siinput[20]=0x00000005;
|
||||
|
||||
uiinput[0]=0xF234F5DF;
|
||||
uiinput[1]=0x23512444;
|
||||
uiinput[2]=0x34565612;
|
||||
uiinput[3]=0x1234F645;
|
||||
uiinput[4]=0x8901FF80;
|
||||
uiinput[5]=0x789012DD;
|
||||
uiinput[6]=0x23454343;
|
||||
uiinput[7]=0x8965F167;
|
||||
uiinput[8]=0x00000000;
|
||||
uiinput[9]=0x45670123;
|
||||
uiinput[10]=0x23453301;
|
||||
uiinput[11]=0x543212F7;
|
||||
uiinput[12]=0x76548745;
|
||||
uiinput[13]=0x23458286;
|
||||
uiinput[14]=0x87651296;
|
||||
uiinput[15]=0xD3453452;
|
||||
uiinput[16]=0xC432E3FF;
|
||||
uiinput[17]=0x22222456;
|
||||
uiinput[18]=0x12346723;
|
||||
uiinput[19]=0xD4567510;
|
||||
uiinput[20]=0x00000005;
|
||||
|
||||
|
||||
/* signed sort */
|
||||
siBubbleSort(siinput,21);
|
||||
/* unsigned sort */
|
||||
uiBubbleSort(uiinput,21);
|
||||
|
||||
|
||||
/* Check */
|
||||
errorsi=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(siinput[count] > siinput[count+1])
|
||||
errorsi=1;
|
||||
|
||||
/* Check */
|
||||
errorui=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(uiinput[count] > uiinput[count+1])
|
||||
errorui=1;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
/* signed int bubble sort */
|
||||
void siBubbleSort(signed int siarray[],int size) {
|
||||
int i,j;
|
||||
signed int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(siarray[j+1] < siarray[j]) {
|
||||
temp=siarray[j+1];
|
||||
siarray[j+1]=siarray[j];
|
||||
siarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* unsigned int bubble sort */
|
||||
void uiBubbleSort(unsigned int uiarray[],int size) {
|
||||
int i,j;
|
||||
unsigned int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(uiarray[j+1] < uiarray[j]) {
|
||||
temp=uiarray[j+1];
|
||||
uiarray[j+1]=uiarray[j];
|
||||
uiarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
153
riscv/acstone/146.array.c
Normal file
153
riscv/acstone/146.array.c
Normal file
|
@ -0,0 +1,153 @@
|
|||
/**
|
||||
* @file 146.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned long long int Bubble Sort.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* It is a simple main function that uses signed and unsigned long long int Bubble Sort.*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
void sliBubbleSort(signed long long int siarray[],int size);
|
||||
void uliBubbleSort(unsigned long long int uiarray[],int size);
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int sliinput[21];
|
||||
unsigned long long int uliinput[21];
|
||||
|
||||
signed char i;
|
||||
unsigned char j;
|
||||
|
||||
int count,errorsli,erroruli;
|
||||
|
||||
sliinput[0]=0xF5032345F234F5DFLL;
|
||||
sliinput[1]=0xD3A4F62123512444LL;
|
||||
sliinput[2]=0x9876223434565612LL;
|
||||
sliinput[3]=0x000000001234F645LL;
|
||||
sliinput[4]=0x234567898901FF80LL;
|
||||
sliinput[5]=0x78905432789012DDLL;
|
||||
sliinput[6]=0x1234567823454343LL;
|
||||
sliinput[7]=0x890765238965F167LL;
|
||||
sliinput[8]=0x0000000000000000LL;
|
||||
sliinput[9]=0x4523457845670123LL;
|
||||
sliinput[10]=0x0987123423453301LL;
|
||||
sliinput[11]=0x56780987543212F7LL;
|
||||
sliinput[12]=0x8654123476548745LL;
|
||||
sliinput[13]=0x45E3213423458286LL;
|
||||
sliinput[14]=0xF234566887651296LL;
|
||||
sliinput[15]=0xD345674902953452LL;
|
||||
sliinput[16]=0x4523457845670123LL;
|
||||
sliinput[17]=0x2345678922222456LL;
|
||||
sliinput[18]=0x8889098612346723LL;
|
||||
sliinput[19]=0x12345433D4567510LL;
|
||||
sliinput[20]=0x0000000000000005LL;
|
||||
|
||||
uliinput[0]=0xF5032345F234F5DFULL;
|
||||
uliinput[1]=0xD3A4F62123512444ULL;
|
||||
uliinput[2]=0x9876223434565612ULL;
|
||||
uliinput[3]=0x000000001234F645ULL;
|
||||
uliinput[4]=0x234567898901FF80ULL;
|
||||
uliinput[5]=0x78905432789012DDULL;
|
||||
uliinput[6]=0x1234567823454343ULL;
|
||||
uliinput[7]=0x890765238965F167ULL;
|
||||
uliinput[8]=0x0000000000000000ULL;
|
||||
uliinput[9]=0x4523457845670123ULL;
|
||||
uliinput[10]=0x0987123423453301ULL;
|
||||
uliinput[11]=0x56780987543212F7ULL;
|
||||
uliinput[12]=0x8654123476548745ULL;
|
||||
uliinput[13]=0x45E3213423458286ULL;
|
||||
uliinput[14]=0xF234566887651296ULL;
|
||||
uliinput[15]=0xD345674902953452ULL;
|
||||
uliinput[16]=0x4523457845670123ULL;
|
||||
uliinput[17]=0x2345678922222456ULL;
|
||||
uliinput[18]=0x8889098612346723ULL;
|
||||
uliinput[19]=0x12345433D4567510ULL;
|
||||
uliinput[20]=0x0000000000000005ULL;
|
||||
|
||||
|
||||
/* signed sort */
|
||||
sliBubbleSort(sliinput,21);
|
||||
/* unsigned sort */
|
||||
uliBubbleSort(uliinput,21);
|
||||
|
||||
|
||||
/* Check */
|
||||
errorsli=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(sliinput[count] > sliinput[count+1])
|
||||
errorsli=1;
|
||||
|
||||
/* Check */
|
||||
erroruli=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(uliinput[count] > uliinput[count+1])
|
||||
erroruli=1;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
/* signed long long int bubble sort */
|
||||
void sliBubbleSort(signed long long int sliarray[],int size) {
|
||||
int i,j;
|
||||
signed long long int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(sliarray[j+1] < sliarray[j]) {
|
||||
temp=sliarray[j+1];
|
||||
sliarray[j+1]=sliarray[j];
|
||||
sliarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* unsigned long long int bubble sort */
|
||||
void uliBubbleSort(unsigned long long int uliarray[],int size) {
|
||||
int i,j;
|
||||
unsigned long long int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(uliarray[j+1] < uliarray[j]) {
|
||||
temp=uliarray[j+1];
|
||||
uliarray[j+1]=uliarray[j];
|
||||
uliarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
47
riscv/acstone/Makefile
Normal file
47
riscv/acstone/Makefile
Normal file
|
@ -0,0 +1,47 @@
|
|||
|
||||
SUFFIX = .$(ARCH)
|
||||
ECHO = /bin/echo
|
||||
TESTS = $(patsubst %.c,%,$(wildcard *.c))
|
||||
TESTS_X86 = $(patsubst %.c,%.x86,$(wildcard *.c))
|
||||
|
||||
|
||||
# Use rules
|
||||
help:
|
||||
@$(ECHO) -e "\nRules:\n"
|
||||
@$(ECHO) -e "help: \tShow this help"
|
||||
@$(ECHO) -e "build: \tCompile programs"
|
||||
@$(ECHO) -e "run: \tRun the simulator with gdb commands"
|
||||
@$(ECHO) -e "check: \tCheck the simulator outputs with the host outputs"
|
||||
@$(ECHO) -e "clean: \tRemove generated files"
|
||||
@$(ECHO) -e "\nEdit and source the file 'acstone.env.sh' before of all\n"
|
||||
|
||||
build: $(TESTS) $(TESTS_X86)
|
||||
|
||||
$(TESTS_X86):
|
||||
gcc -g $(basename $@).c -o $@ -lm
|
||||
|
||||
include $(ARCH).mk
|
||||
|
||||
|
||||
# Clean executables and backup files
|
||||
clean:
|
||||
rm -f $(TESTS)
|
||||
rm -f *~
|
||||
rm -f *.cmd
|
||||
rm -f *.out
|
||||
rm -f *.$(ARCH)
|
||||
rm -f *.x86
|
||||
rm -f *.$(ARCH).stats
|
||||
|
||||
run:
|
||||
./bin/run_x86.sh
|
||||
./bin/run_simulator.sh &
|
||||
./bin/run_gdb.sh
|
||||
|
||||
check:
|
||||
./bin/check.sh
|
||||
|
||||
consolidate:
|
||||
./bin/consolidate.sh
|
||||
|
||||
.PHONY: build clean all
|
124
riscv/acstone/README.md
Normal file
124
riscv/acstone/README.md
Normal file
|
@ -0,0 +1,124 @@
|
|||
ACStone
|
||||
============
|
||||
|
||||
* For adding another architecture, follow riscv.mk convention and create the .mk file with $(TESTS) rule.
|
||||
|
||||
* Execute `make` to see the options
|
||||
|
||||
* Edit and source the file `acstone.env.sh`
|
||||
```bash
|
||||
source acstone.env.sh
|
||||
```
|
||||
|
||||
* Build the pieces of code
|
||||
```bash
|
||||
make build
|
||||
```
|
||||
|
||||
* Run the simulator using gdb commands
|
||||
```bash
|
||||
make run
|
||||
```
|
||||
|
||||
* Check the correctness using the x86 output
|
||||
```bash
|
||||
make check
|
||||
```
|
||||
* If you are using acsim with -scsv flag, run the following to generate consolidated statistics
|
||||
```bash
|
||||
make consolidate
|
||||
```
|
||||
|
||||
|
||||
Pieces of code
|
||||
---------------------
|
||||
|
||||
```
|
||||
000.main Simple main function that returns 0
|
||||
|
||||
011.const Uses signed char
|
||||
012.const Uses unsigned char
|
||||
013.const Uses signed short int
|
||||
014.const Uses unsigned short int
|
||||
015.const Uses int
|
||||
016.const Uses unsigned int
|
||||
017.const Uses signed long long int
|
||||
018.const Uses unsigned long long int
|
||||
|
||||
021.cast Uses cast signed char to signed short int
|
||||
022.cast Uses cast signed char to signed int
|
||||
023.cast Uses cast signed char to signed long long int
|
||||
024.cast Uses cast signed short int to signed int
|
||||
025.cast Uses cast signed short int to signed long long int
|
||||
026.cast Uses cast signed int to signed long long int
|
||||
027.cast Uses some unsigned casts
|
||||
|
||||
031.add Uses signed and unsigned char adds
|
||||
032.add Uses signed and unsigned short int adds
|
||||
033.add Uses signed and unsigned int adds
|
||||
034.add Uses signed and unsigned long long int adds
|
||||
|
||||
041.sub Uses signed and unsigned char subs
|
||||
042.sub Uses signed and unsigned short int subs
|
||||
043.sub Uses signed and unsigned int subs
|
||||
044.sub Uses signed and unsigned long long int adds
|
||||
|
||||
051.mul Uses signed char multiplication
|
||||
052.mul Uses unsigned char multiplication
|
||||
053.mul Uses signed short int multiplication
|
||||
054.mul Uses unsigned short int multiplication
|
||||
055.mul Uses signed int multiplication
|
||||
056.mul Uses unsigned int multiplication
|
||||
057.mul Uses various signed multiplication
|
||||
058.mul Uses various unsigned multiplication
|
||||
|
||||
061.div Uses signed char division
|
||||
062.div Uses unsigned char division
|
||||
063.div Uses signed short int division
|
||||
064.div Uses unsigned short int division
|
||||
065.div Uses signed int division
|
||||
066.div Uses unsigned int division
|
||||
067.div Uses signed long long int division
|
||||
068.div Uses unsigned long long int division
|
||||
|
||||
071.bool Uses char boolean operators
|
||||
072.bool Uses short int boolean operators
|
||||
073.bool Uses int boolean operators
|
||||
074.bool Uses long long int boolean operators
|
||||
075.bool Uses various boolean operators
|
||||
|
||||
081.shift Uses signed and unsigned char shifts
|
||||
082.shift Uses signed and unsigned short int shifts
|
||||
083.shift Uses signed and unsigned int shifts
|
||||
084.shift Uses signed and unsigned long long int shifts
|
||||
085.shift Uses shifts and some logic operators
|
||||
|
||||
111.if Uses signed char ifs
|
||||
112.if Uses unsigned char ifs
|
||||
113.if Uses signed short int ifs
|
||||
114.if Uses unsigned short int ifs
|
||||
115.if Uses signed int ifs
|
||||
116.if Uses unsigned int ifs
|
||||
117.if Uses signed long long int ifs
|
||||
118.if Uses unsigned long long int ifs
|
||||
119.if Uses various ifs
|
||||
|
||||
121.loop Uses while loops
|
||||
122.loop Uses for loops
|
||||
123.loop Uses implemented unsigned multiplication
|
||||
124.loop Uses implemented signed multiplication (Booth)
|
||||
125.loop Uses implemented simple strlen loop
|
||||
126.loop Uses implemented simple fatorial loop
|
||||
|
||||
131.call Uses calls functions arg int, ret int
|
||||
132.call Uses indirect calls functions
|
||||
133.call Uses recursive fatorial
|
||||
134.call Uses recursive Fibonacci function
|
||||
|
||||
141.array Uses size three dot products
|
||||
142.array Uses a kind of square matrix multiplication
|
||||
143.array Uses signed and unsigned char Bubble Sort
|
||||
144.array Uses signed and unsigned short int Bubble Sort
|
||||
145.array Uses signed and unsigned int Bubble Sort
|
||||
146.array Uses signed and unsigned long long int Bubble Sort
|
||||
```
|
8
riscv/acstone/acstone.env.sh
Normal file
8
riscv/acstone/acstone.env.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
export ARCH="mips"
|
||||
export CROSS_COMPILER="mips-newlib-elf-gcc"
|
||||
export GDB="gdb-multiarch"
|
||||
export SIMULATOR="/home/max/ArchC/processors/github/mips/mips.x --load="
|
||||
export GDBPORT="5000"
|
||||
|
||||
|
9
riscv/acstone/bin/check.sh
Executable file
9
riscv/acstone/bin/check.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
for I in *.x86.out ; do
|
||||
|
||||
TMP=`echo $I | cut -d '.' -f '1 2'`
|
||||
#diff --brief --report-identical-files ${TMP}.${ARCH}.out data/$TMP.data
|
||||
diff --brief --report-identical-files ${TMP}.${ARCH}.out ${TMP}.x86.out
|
||||
|
||||
done
|
25
riscv/acstone/bin/consolidate.sh
Executable file
25
riscv/acstone/bin/consolidate.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
rm "$ARCH.stats"
|
||||
awk -F", " 'BEGIN { OFS = ";"} {print $1}' "000.main.$ARCH.stats" > "$ARCH.stats"
|
||||
|
||||
for I in `ls *.${ARCH}`; do
|
||||
echo "Processing:" "$I.stats"
|
||||
VAR=`awk -F", " 'BEGIN { OFS = ", "} FNR==NR{a[$1]=$0; next}{print a[$1],$2}' "$ARCH.stats" "$I.stats"`
|
||||
echo "$VAR" > "$ARCH.stats"
|
||||
done
|
||||
|
||||
VAR=`awk -F", " 'BEGIN { OFS = ", "} NR > 1 { sum=0; for(i = 2; i <= NF; i++) { sum+=$i; }; print $1, sum; }' "$ARCH.stats"`
|
||||
echo "$VAR" > "$ARCH.stats"
|
||||
|
||||
echo "UNTESTED INSTRUCTIONS:"
|
||||
VAR=`awk -F", " '{ if($2 == 0) print $1 }' "$ARCH.stats"`
|
||||
|
||||
echo "$VAR"
|
||||
|
||||
COUNT_TESTED=`awk '$2 > 0 { count++ } END { print count }' "$ARCH.stats"`
|
||||
COUNT_UNTESTED=`awk '$2 == 0 { count++ } END { print count }' "$ARCH.stats"`
|
||||
echo "COUNT_TESTED: $COUNT_TESTED"
|
||||
echo "COUNT_UNTESTED: $COUNT_UNTESTED"
|
||||
DIV=`bc <<< "scale=2; ($COUNT_TESTED / ($COUNT_UNTESTED+$COUNT_TESTED))*100"`
|
||||
echo "Coverage: $DIV%"
|
32
riscv/acstone/bin/run_gdb.sh
Executable file
32
riscv/acstone/bin/run_gdb.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
# For each compiled program construct a gdb's
|
||||
# command file and call gdb
|
||||
|
||||
# Compute the number lines of inicial first commands file
|
||||
NLCFG=`cat gdb/firstcommands.gdb | wc -l`
|
||||
|
||||
#Make a loop for each file
|
||||
for I in `ls *.${ARCH}`; do
|
||||
|
||||
NAME=`echo ${I} | cut -f '1 2' -d '.'`
|
||||
NL=`cat gdb/${NAME}.gdb | wc -l`
|
||||
NLSHOW=`expr ${NL} - 2`
|
||||
|
||||
rm -f ${NAME}.cmd
|
||||
cat gdb/firstcommands.gdb > ${NAME}.cmd
|
||||
sed -i "s@\$GDBPORT@$GDBPORT@g" ${NAME}.cmd
|
||||
tail -n ${NLSHOW} gdb/${NAME}.gdb >> ${NAME}.cmd
|
||||
|
||||
echo "${GDB} ${I} --command=${NAME}.cmd -batch"
|
||||
${GDB} ${I} --command=${NAME}.cmd -batch | cut -s -f 2 -d '$' | cut -f 2 -d '=' > ${NAME}.${ARCH}.out
|
||||
|
||||
if [ -e ${ARCH}_lastrun_stats.csv ]
|
||||
then
|
||||
mv ${ARCH}_lastrun_stats.csv ${I}.stats
|
||||
fi
|
||||
|
||||
sleep 0.25
|
||||
|
||||
done
|
||||
|
11
riscv/acstone/bin/run_simulator.sh
Executable file
11
riscv/acstone/bin/run_simulator.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Make a loop for each file
|
||||
for I in `ls *.${ARCH}`
|
||||
do
|
||||
|
||||
echo ${SIMULATOR}${I} --port=${GDBPORT}
|
||||
${SIMULATOR}${I} --port=${GDBPORT}
|
||||
|
||||
done
|
||||
|
10
riscv/acstone/bin/run_x86.sh
Executable file
10
riscv/acstone/bin/run_x86.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
for I in `ls *.x86`
|
||||
do
|
||||
NAME=`echo ${I} | cut -f '1 2' -d '.'`
|
||||
# gdb ${I} --command=gdb/${NAME}.gdb > ${I}.out
|
||||
gdb ${I} --command=gdb/${NAME}.gdb | cut -s -f 2 -d '$' | cut -f 2 -d '=' > ${I}.out
|
||||
|
||||
done
|
||||
|
5
riscv/acstone/gdb/000.main.gdb
Normal file
5
riscv/acstone/gdb/000.main.gdb
Normal file
|
@ -0,0 +1,5 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/011.const.gdb
Normal file
20
riscv/acstone/gdb/011.const.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/012.const.gdb
Normal file
20
riscv/acstone/gdb/012.const.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/013.const.gdb
Normal file
20
riscv/acstone/gdb/013.const.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/014.const.gdb
Normal file
20
riscv/acstone/gdb/014.const.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/015.const.gdb
Normal file
20
riscv/acstone/gdb/015.const.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/016.const.gdb
Normal file
20
riscv/acstone/gdb/016.const.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/017.const.gdb
Normal file
20
riscv/acstone/gdb/017.const.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/018.const.gdb
Normal file
20
riscv/acstone/gdb/018.const.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/021.cast.gdb
Normal file
20
riscv/acstone/gdb/021.cast.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
n
|
||||
n
|
||||
p si
|
||||
n
|
||||
n
|
||||
n
|
||||
p si
|
||||
n
|
||||
n
|
||||
n
|
||||
p si
|
||||
n
|
||||
n
|
||||
n
|
||||
p si
|
||||
c
|
||||
q
|
20
riscv/acstone/gdb/022.cast.gdb
Normal file
20
riscv/acstone/gdb/022.cast.gdb
Normal file
|
@ -0,0 +1,20 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
n
|
||||
n
|
||||
p i
|
||||
n
|
||||
n
|
||||
n
|
||||
p i
|
||||
n
|
||||
n
|
||||
n
|
||||
p i
|
||||
n
|
||||
n
|
||||
n
|
||||
p i
|
||||
c
|
||||
q
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue