🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by marvinw Thu, 12 Nov 1992 22:18
gcc-2.3.1, scheduling and asm's
#1380
Author: marvinw
Date: Thu, 12 Nov 1992 22:18
101 lines
3422 bytes
We are using gcc-2.3.1 as a cross-compiler, the host is sparc and the target
is mips.  We are using a modified version of the OSF assembler.  In the 
following example you will find a missing nop before the coprocessor 
instruction, mtc2.  I would like to see the compiler issue a nop after
the	
	"lw	$2,y" 

just as it does for the

	"lw      $3,z"

		Marvin Wyckoff
		Tektronix, Inc.
		503-685-2985

/* ------------------------ asm2.c ------------------------ */
#define MTC2(src, reg)  _MTC2(src, reg)
#define _MTC2(src, reg) \
  { asm volatile ("mtc2 %0,"#reg"" : : "r" ((unsigned long) (src))); }
int y,z;
main()
{
	int x;

	x = y;
	MTC2(x,$3);
	y += z;
}
/* ------------------------ asm2.c ------------------------ */
Script started on Thu Nov 12 14:11:49 1992
intrepid% uname -a
SunOS intrepid 4.1A.1 4.1.1 sun4
intrepid% cat ~/gnu/gcc-2.3.1/sparc-mips/config.status
#!/bin/sh
# GCC was configured as follows:
../configure --host=sparc --target=mips-mips-bsd
echo host=sparc-sun-sunos4.1.1 target=mips-mips-bsd build=sparc-sun-sunos4.1.1
intrepid% ~/nwd/tools/sparc/bin/mgcc -O2 -S -v asm2.c
gcc version 2.3.1
 /home/marvinw/nwd/tools/sparc/lib/gcc-lib/mips-mips-bsd/2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_BSD43 -D_mips -D_unix -D_host_mips -D_MIPSEB -D_R3000 -D_SYSTYPE_BSD43 -D__mips__ -D__unix__ -D__host_mips__ -D__MIPSEB__ -D__R3000__ -D__SYSTYPE_BSD43__ -D___mips__ -D___unix__ -D___host_mips__ -D___MIPSEB__ -D___R3000__ -D___SYSTYPE_BSD43__ -D__mips -D__unix -D__host_mips -D__MIPSEB -D__R3000 -D__SYSTYPE_BSD43 -D___mips -D___unix -D___host_mips -D___MIPSEB


 -D___R3000 -D___SYSTYPE_BSD43 -D__OPTIMIZE__ -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C asm2.c /usr/tmp/cca13703.i
GNU CPP version 2.3.1 [AL 1.1, MM 28] BSD Mips
 /home/marvinw/nwd/tools/sparc/lib/gcc-lib/mips-mips-bsd/2.3.1/cc1 /usr/tmp/cca13703.i -mgas -mgpopt -quiet -dumpbase asm2.c -O2 -version -o asm2.s
GNU C version 2.3.1 [AL 1.1, MM 28] BSD Mips compiled by CC.
intrepid% cat asm2.s
	.file	1 "asm2.c"

 # GNU C 2.3.1 [AL 1.1, MM 28] BSD Mips compiled by CC

 # Cc1 defaults:

 # Cc1 arguments (-G value = 0, Cpu = default, ISA = 1):
 # -mgas -mgpopt -quiet -dumpbase -O2 -version -o

gcc2_compiled.:
	.text
	.align	2
	.globl	main

	.comm	y,8

	.comm	z,8

	.text

	.loc	1 6
	.ent	main
main:
	.frame	$sp,0,$31		# vars= 0, regs= 0/0, args = 0, extra= 0
	.mask	0x00000000,0
	.fmask	0x00000000,0
	.set	noreorder
	lw	$2,y
 #APP
	mtc2 $2,$3
 #NO_APP
	.set	reorder
	.set	noreorder
	lw	$3,z
	nop
	.set	reorder
	addu	$2,$2,$3
	sw	$2,y
	j	$31
	.end	main
intrepid% mas -o asm2.o asm2.s
intrepid% mdis asm2.o

asm2.o:     file format tekmips

Disassembly of section .text:
00000000  lw $v0,0($gp)
00000004  mtc2 $v0,$f3
00000008  lw $v1,0($gp)
0000000c  nop 
00000010  addu $v0,$v0,$v1
00000014  sw $v0,0($gp)
00000018  jr $ra
0000001c  nop 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads