Commit Graph

68 Commits

Author SHA1 Message Date
Julien Fischer
c27f120d54 Update link to x86_64 ABI documentation.
runtime/machdeps/x86_64_regs.h:
    As above.
2023-01-23 02:29:13 +11:00
Julien Fischer
f3d68031f5 Minor fixes for the doregtest script.
runtime/machdeps/doregtest:
    Fix some things identified by ShellCheck.
2021-01-13 15:24:23 +11:00
Julien Fischer
e613aabeea Distinguish between 32- and 64-bit ARM in a couple of spots.
runtime/machdeps/aarch64_regs.h:
runtime/machdeps/arm_regs.h:
    As above.
2021-01-13 14:27:22 +11:00
Julien Fischer
84b561a2a0 Use global registers on aarch64.
runtime/machdeps/aarch64_regs.h:
runtime/mercury_regs.h:
     Define global registers for aarch64.

configure.ac:
     Compile with -fomit-frame-pointer on aarch64.  (Doing so frees
     up register x29.)

     Compile with -fPIC instead of -fpic on aarch64-*-linux* systems
     in order to avoid size limits on the global offset table.
2021-01-13 14:22:21 +11:00
Julien Fischer
ff39b3463b Remove legacy support for the Alpha architecture.
README.Linux-Alpha:
runtime/machdeps/ALPHA_REGS:
runtime/machdeps/alpha_regs.h:
runtime/machdeps/alpha_regtest:
    Delete these files.

configure.ac:
runtime/Mmakefile:
runtime/mercury_goto.h:
runtime/mercury_regs.h:
README.md:
README.Linux:
README.Linux-PPC:
    Delete or update references to the Alpha architecture.

NEWS:
    Announce the above.

scripts/mgnuc.in:
    Unrelated: update a comment.
2020-10-18 16:35:52 +11:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.

COPYING.LIB:
    Add a special linking exception to the LGPL.

*:
    Update references to COPYING.LIB.

    Clean up some minor errors that have accumulated in copyright
    messages.
2018-06-09 17:43:12 +10:00
Zoltan Somogyi
c8d718ec57 Remove the .regparm and .picreg grade components.
For picreg, this is only the first half of the change; it deletes code
that generates references to this grade component. When this diff has been
installed on all our machines, will come the second half, which will delete
the code that understands references to picreg. The delay is needed because
your current installed compiler is still generating such references.

runtime/mercury_grade.h:
    Remove both regparm and picreg as grade components.

doc/user_guide.texi:
    Remove the (commented out) documentation of picreg; regparm had
    no documentation to delete.

runtime/mercury_std.h:
    Remove the small bit of code that implemented regparm.

runtime/mercury_conf_param.h:
    Don't define MR_PIC_REG.

runtime/machdeps/i386_regs.h:
runtime/mercury_conf_bootstrap.h:
    Remove references to picreg.

scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
    Keep in place the code that accepts picreg grade components,
    but make them do nothing. Mark such do-nothing code so that
    it can be deleted when this first-half diff has been bootstrapped.

configure.ac:
    Delete the autoconfigured variable EXT_FOR_LINK_WITH_PIC_OBJECTS,
    which could be set to either 'lpic_o' or just 'o', because it is now
    *always* the latter.

scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
    Remove code that transmitted the value of EXT_FOR_LINK_WITH_PIC_OBJECTS
    to the compiler via the --link-with-pic-object-file-extension option.

compiler/options.m:
    Keep the --link-with-pic-object-file-extension and --pic-reg options,
    but mark them for deletion in the second half of this change.

compiler/compile_target_code.m:
    Change the code that dealt with the value of the
    --link-with-pic-object-file-extension and --pic-reg options to assume
    that the former is always the same as the non-pic file extension,
    and that --pic-reg is never needed. The former means that we don't need
    to handle link_with_pic as a separate category of object files from
    just plain non_pic.

compiler/compute_grade.m:
    Keep accepting picreg grades, but mark the code that does this
    for deletion.

compiler/make.program_target.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/make.util.m:
    Conform to the changes above.
2016-02-25 16:47:16 +11:00
Julien Fischer
d9ff3a3b46 Fix spelling.
runtime/machdeps/README:
    As above.
2015-12-30 02:56:48 +11:00
Julien Fischer
ba7fd290ad As discussed on mercury-developers, reduce the number of registers that
Estimated hours taken: 1
Branches: main

As discussed on mercury-developers, reduce the number of registers that
are reserved for use as gcc global register variables on x86 machines
for non-PIC Mercury code from three to two.

This change should reduce the frequency of register allocation problems
occurring with gcc on x86 machines, at the cost of increasing execution
time for non-PIC by about 2.2%.   (That figure is based on our standard
benchmark.)

runtime/machdeps/i386_regs.h:
	Do not reserve an extra register for use as a global register
	variable for non-PIC on x86.

configure.in:
	Conform to the new number of global register variables.

	Define EXT_FOR_LINK_WITH_PIC_OBJECTS as .o rather than .lpic_o
	on x86.  (The latter should only be used when MR_PIC_REG has
	some meaning.)

compiler/compile_target_code.m:
	Update a comment: MR_PIC_REG no longer has an effect on x86
	machines.
2007-11-09 06:32:26 +00:00
Julien Fischer
8244972e19 Add support for shared libraries on x86-64 Linux.
Estimated hours taken: 4.5
Branches: main, release

Add support for shared libraries on x86-64 Linux.

configure.in:
	Enable for support for shared libraries on x86-64 Linux ELF
	systems.

runtime/machdeps/x86_64_regs.h:
	Add an explanation of a problem with our use of r15 as a global
	register and PIC with the medium and large code models.  (We
	don't encounter this problem because we currently use the small
	code model.)

	Fix the comments attached to the register variable declarations.
	We do not have three different versions of succip.

runtime/mercury_goto.h:
	Add x86_64 specific hacks.

scripts/mgnuc.in:
	Conform to the above changes.
2006-08-02 06:48:56 +00:00
Julien Fischer
20e2d517e2 Commit Sergey Khorev's patch to port Mercury to the ARM architecture.
Estimated hours taken: 0.5 by me (+ unknown by Sergey Khorev)
Branches: main, release

Commit Sergey Khorev's patch to port Mercury to the ARM architecture.

configure.in:
runtime/mercury_regs.h:
runtime/machdeps/arm_regs.h:
	Global registers for ARM.

runtime/Mmakefile:
	Add arm_regs.h to the list of machine dependent headers.

runtime/machdeps/ARM_REGS:
	Add documentation from the gcc source code on what registers
	can be used.

runtime/machdeps/arm_regtest:
	Test what registers we can use on ARM.
2005-12-02 06:53:19 +00:00
Julien Fischer
b8119cfc52 Commit Peter Hawkins' patch for global registers on x86_64.
Estimated hours taken: 0.1 (+ unknown time by hawkinsp)
Branches: main

Commit Peter Hawkins' patch for global registers on x86_64.
(The actual registers we use may need some finessing but we can
do that later when we have more experience with this architecture.)

runtime/mercury_regs.h:
runtime/machdeps/x86_64_regs.h:
	Global registers for x86_64.

runtime/Mmakefile:
	Add x86_64_regs.h to the list of machine dependent
	headers.

runtime/machdeps/README:
	Mention that the above Mmakefile needs to be updated
	when adding a new architecture.
2005-08-30 03:13:54 +00:00
Peter Ross
86772706b2 Update the (C) message.
Estimated hours taken: 0.1
Branches: main

runtime/machdeps/ia64_regs.h:
	Update the (C) message.
2004-07-16 12:15:47 +00:00
Peter Ross
30426876b9 Add contributions from Peter Hawkins to support hppa, ia64 and s390
Estimated hours taken: 0.25 (plus phawkins work)

Add contributions from Peter Hawkins to support hppa, ia64 and s390
architectures.

config.guess:
config.sub:
	Upgrade to newer versions.

configure.in:
	Update to support the hppa64, ia64 and s390 architectures.

runtime/mercury_regs.h:
runtime/machdeps/ia64_regs.h:
	Add support for ia64.
2004-07-16 12:14:27 +00:00
Fergus Henderson
ddb677279c Ensure that in MLDS grades, arguments with arg_mode `top_unused' do not
Estimated hours taken: 2
Branches: main

Ensure that in MLDS grades, arguments with arg_mode `top_unused' do not
get passed.

Previously, different parts of the compiler had different and inconsistent
ideas about if/how they should get passed, which caused problems,
including an internal error for tests/hard_coded/foreign_type2.m in grade
`java'.  The comments in mlds.m said they should not get passed, the
code in ml_call_gen.m passed them as if they were output arguments, and
the code in ml_code_util declared them as if they were input arguments.

compiler/hlds_pred.m:
	Add some detailed comments about the meaning of the `arg_mode' type.

compiler/ml_call_gen.m:
compiler/ml_code_util.m:
compiler/ml_code_gen.m:
	Ensure that arguments with arg_mode `unused' do not get passed,
	declared, or converted (respectively).

runtime/mercury_grade.h:
	Bump the binary compatibility version number for MLDS grades.
	This is needed because the calling convention for procedures
	with `unused' mode arguments has changed.
2003-02-14 09:58:41 +00:00
Fergus Henderson
c6ae49bbfc Fix the setting of NUM_REAL_R_REGS for PowerPC.
Estimated hours taken: 0.25
Branches: main

Fix the setting of NUM_REAL_R_REGS for PowerPC.
(This should hopefully improve performance on Macs a little.)

configure.in:
	Treat powerpc-* the same as rs6000-* with regard to registers.
	This is needed because powerpc is just a variant of rs6000.

runtime/machdeps/rs6000_regs.h:
	Mention that this file is used for PowerPC, as well as for RS/6000.
2002-09-11 11:58:05 +00:00
Simon Taylor
b7c4a317e9 Add MR_ prefixes to the remaining non-prefixed symbols.
Estimated hours taken: 4
Branches: main

Add MR_ prefixes to the remaining non-prefixed symbols.

This change will require all workspaces to be updated
The compiler will start generating references to MR_TRUE,
MR_bool, etc., which are not defined in the old runtime
header files.

runtime/mercury_std.h:
	Add MR_ prefixes to bool, TRUE, FALSE, max, min,
	streq, strdiff, strtest, strntest, strneq, strndiff,
	strntest, NO_RETURN.

	Delete a commented out definition of `reg'.

runtime/mercury_tags.h:
	Add an MR_ prefix to TAGBITS.

configure.in:
runtime/mercury_goto.h:
runtime/machdeps/i386_regs.h/mercury_goto.h:
	Add an MR_ prefix to PIC.

runtime/mercury_conf_param.h:
	Allow non-prefixed PIC and HIGHTAGS to be defined on
	the command line.

runtime/mercury_bootstrap.h:
	Add backwards compatibility definitions.

RESERVED_MACRO_NAMES:
	Remove the renamed macros.

compiler/export.m:
compiler/ml_code_gen.m:
	Use MR_bool rather than MR_Bool (MR_Bool is
	meant to be for references to the Mercury type
	bool__bool).

runtime/mercury_types.h:
	Add a comment the MR_Bool is for references to
	bool__bool.

*/*.c:
*/*.h:
*/*.m:
	Add MR_ prefixes.
2002-02-18 07:01:33 +00:00
Simon Taylor
c66cea0665 Add MR_ prefixes to uses of configuration macros.
Estimated hours taken: 2.5
Branches: main

Add MR_ prefixes to uses of configuration macros.
Bootcheck now succeeds with MR_NO_CONF_BACKWARDS_COMPAT.

Mmake.common.in:
	Define MR_NO_CONF_BACKWARDS_COMPAT when checking
	for namespace cleanliness.

RESERVED_MACRO_NAMES:
	Remove the configuration macros.

runtime/mercury_conf_bootstrap.h:
	Remove a duplicate definition of BOXED_FLOAT.

configure.in:
*/*.c:
*/*.h:
*/*.m:
	Add MR_ prefixes.
2002-02-13 09:56:49 +00:00
Fergus Henderson
1e9195b4f3 Add some Mmake rules to the runtime and some code to tools/bootcheck
Estimated hours taken: 16

Add some Mmake rules to the runtime and some code to tools/bootcheck
so that we automatically check that the namespace remains clean.
Also add some `MR_' prefixes that Zoltan missed in his earlier change.

tools/bootcheck:
	Add an option, which is enabled by default, to
	build the check_namespace target in the runtime.

runtime/RESERVED_MACRO_NAMES:
	New file.  Contains a list of the macros names that
	don't start with `MR_' or the like.

runtime/Mmakefile:
	Change the rule for `check_headers' so that it checks for macros
	that don't occur in the RESERVED_MACRO_NAMES files, as well as not
	starting with `MR_' prefixes, and reports errors for such macros.
	Also add a rule for check_objs that checks whether the object
	files define any global symbols that don't have the right prefixes,
	and a rule `check_namespace' that does both of the above.

runtime/mercury_bootstrap.h:
	#include "mercury_types.h" and "mercury_float.h",
	to ensure that this header file is self-contained.
	Also make sure that all the old names are disabled if you
	compile with `-DMR_NO_BACKWARDS_COMPAT'.

runtime/mercury_context.c:
runtime/mercury_thread.h:
runtime/mercury_thread.c:
	Use `bool' rather than `MR_Bool' for the argument to
	MR_check_pending_contexts() and the return type of
	MR_init_thread(), since these are C bools, not Mercury
	bools, and there's no requirement that they have the
	same size as MR_Integer.

runtime/mercury_type_info.h:
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
library/std_util.m:
trace/mercury_trace_declarative.c:
trace/mercury_trace_external.c:
trace/mercury_trace_internal.c:
tests/hard_coded/existential_types_test.m:
	Add MR_ prefixes to UNIV_OFFSET_FOR_TYPEINFO and UNIV_OFFSET_FOR_VALUE.

trace/mercury_trace_external.c:
trace/mercury_trace_internal.c:
trace/mercury_trace_tables.c:
	Add MR_ prefixes to do_init_modules().

runtime/mercury_tabling.h:
runtime/mercury_tabling.c:
runtime/mercury_overflow.h:
runtime/mercury_debug.h:
	Add MR_ prefixes to table_*.

runtime/mercury_overflow.h:
runtime/mercury_debug.h:
	Add MR_ prefixes to IF().

runtime/mercury_context.h:
	Add MR_ prefixes to IF_MR_THREAD_SAFE().

runtime/mercury_engine.h:
	Add MR_ prefixes to IF_NOT_CONSERVATIVE_GC().

runtime/mercury_engine.h:
runtime/mercury_engine.c:
library/exception.m:
extras/aditi/aditi.m:
	Add MR_ prefixs to do_fail, do_redo, do_not_reached, etc.

compiler/trace.m:
compiler/fact_table.m:
compiler/llds_out.m:
	Add MR_ prefixes to the generated code.
2000-12-04 18:35:22 +00:00
Zoltan Somogyi
090552c993 Make everything in the runtime use MR_ prefixes, and make the compiler
Estimated hours taken: 10

Make everything in the runtime use MR_ prefixes, and make the compiler
bootstrap with -DMR_NO_BACKWARDS_COMPAT.

runtime/mercury_*.[ch]
	Add MR_ prefixes to all functions, global variables and almost all
	macros that could pollute the namespace. The (intentional) exceptions
	are

	1. some function, variable, type and label names that already start
	   with MR_, mercury_, Mercury or _entry;
	2. some standard C macros in mercury_std.h;
	3. the macros used in autoconfiguration (since they are used in scripts
	   as well as the runtime, the MR_ prefix may not be appropriate for
	   those).

	In some cases, I deleted things instead of adding prefixes
	if the "things" were obsolete and not user visible.

runtime/mercury_bootstrap.h:
	Provide MR_-less forms of the macros for bootstrapping and for
	backward compatibility for user code.

runtime/mercury_debug.[ch]:
	Add a FILE * parameter to a function that needs it.

compiler/code_info.m:
compiler/export.m:
compiler/fact_table.m:
compiler/llds.m:
compiler/llds_out.m:
compiler/pragma_c_gen.m:
compiler/trace.m:
	Add MR_ prefixes to the C code generated by the compiler.

library/*.m:
	Add MR_ prefixes to handwritten code.

trace/mercury_trace_*.c:
util/mkinit.c:
	Add MR_ prefixes as necessary.

extras/concurrency/semaphore.m:
	Add MR_ prefixes as necessary.
2000-11-23 02:01:11 +00:00
Zoltan Somogyi
9b60e6c3bf Add .nocopyright files to get rid of warning messages during commits.
Estimated hours taken: 0.1

*/.nocopyright:
	Add .nocopyright files to get rid of warning messages during commits.
2000-11-22 00:07:50 +00:00
Tyson Dowd
db64a3588d Add MR_ prefixes to the types used when generating C code.
Estimated hours taken: 4

Add MR_ prefixes to the types used when generating C code.
This means types such as Word, String, Bool, Float become MR_Word,
MR_String, MR_Bool, MR_Float.  Also define MR_Box for both the LLDS and
MLDS backends so we can use it uniformly.

This is very important in environments where String or Bool have already
been used as system types (for example, managed C++).  And besides, we
should do it anyway as part of the grand namespace cleanup.

I have fixed all of the uses of the non-prefixed types in the runtime
and trace directories.  I haven't done it for the library and compiler
directories yet (no promises that I will do it in future either).  But
if you see a non-prefixed type in code from now on, please consider it a
bug and fix it.

mercury_bootstrap.h contains #defines to map the non-prefixed types into
the prefixed ones.  Like many of the other namespace cleaning backwards
compatibility macros, this can be turned off with
MR_NO_BACKWARDS_COMPAT.

This shouldn't break any code, but this kind of change affects so many
things that of course there could be problems lurking in there somewhere.

If you start getting errors from the C compiler after this change is
installed, you will want to make sure you at least have the runtime
system updated so that you are getting the backwards compatibility
definitions in mercury_bootstrap.h.  Then if you continue to have
problems you can bug me about it.

compiler/export.m:
compiler/llds_out.m:
compiler/mlds_to_c.m:
	Use MR_Word, MR_Float, MR_Bool, etc when generating C.

doc/reference_manual.texi:
	Update the reference manual to talk about MR_Word, MR_String,
	MR_Char, etc.

runtime/mercury_bootstrap.h:
	Add bootstrapping typedefs.

runtime/*:
trace/*:
	Change Word, Float, Bool, Code, String, etc to
	MR_Word, MR_Float, MR_Bool, MR_Code, MR_String.
2000-08-03 06:19:31 +00:00
Fergus Henderson
c57634c639 Add some more tests.
Estimated hours taken: 1

runtime/machdeps/regtest.c:
runtime/machdeps/regtest2.c:
runtime/machdeps/doregtest:
	Add some more tests.

runtime/machdeps/SPARC_REGS:
	Update the commentary here to reflect more a recent version
	of GNU C.
1999-12-26 06:05:35 +00:00
Tyson Dowd
376f2c69af An initial implementation of the accurate garbage collector.
Estimated hours taken: 90

An initial implementation of the accurate garbage collector.

WORK_IN_PROGRESS:
	Add an entry for the accurate garbage collector.

library/builtin.m:
library/mercury_builtin.m:
library/std_util.m:
runtime/mercury_tabling.h:
	Deep copy terms using the address of the value instead of
	just the value.

library/io.m:
	Initialize the garbage collector's rootset with the globals.

runtime/Mmakefile:
	Add new files to the Mmakefile.

runtime/mercury_accurate_gc.h:
runtime/mercury_accurate_gc.c:
	The new garbage collector.

runtime/mercury_agc_debug.c:
runtime/mercury_agc_debug.h:
	Debugging utilities for the new garbage collector.

runtime/mercury_deep_copy.c:
runtime/mercury_deep_copy.h:
runtime/mercury_deep_copy_body.h:
	Put the deep copy code in mercury_deep_copy_body.h, and #include
	it with appropriate #defines in order to get a variant for
	deep_copy(), and one for agc_deep_copy().

	agc_deep_copy() forwards pointers as it copies.

	Also, deep_copy (all variants) have been modified to take
	a pointer to the data to be copied, because some variants
	need to be able to modify it.

runtime/mercury_engine.c:
runtime/mercury_engine.h:
	Add a second heap_zone which is the to-space of
	the copying collector.
	Add a debug_heap_zone, which is used as a scratch
	heap for debugging.

runtime/mercury_label.c:
	Instead of
		realloc(entry_table, ....)
	do
		entry_table = realloc(entry_table, ....)
	to avoid horrible bugs.

	Also, make sure the tables get initialized before looking up
	an entry label.

runtime/mercury_imp.h:
	Include mercury_debug.h before most of the modules.
	(mercury_engine.h adds a new MemoryZone only if we are
	debugging accurate GC).

runtime/mercury_memory.c:
	Setup the debug_memory_zone sizes.
	Remove an unnecessary prototype.

runtime/mercury_memory_handlers.c:
	Add code to get the program counter and the stack pointer
	from the signal context.

	Call MR_schedule_agc() from default_handler() if doing accurate gc.

runtime/mercury_memory_zones.c:
	Setup the hardzone regardless of whether redzones are used.

	Add some more debugging information.

runtime/mercury_regorder.h:
runtime/machdeps/alpha_regs.h:
runtime/machdeps/i386_regs.h:
	Add definitions to make the real machine registers name/number
	for MR_sp available.

runtime/mercury_trace_internal.c:
runtime/mercury_trace_util.c:
runtime/mercury_trace_util.h:
	Add MR_trace_write_variable(), which writes terms given their
	value and type_info.

runtime/mercury_wrapper.c:
runtime/mercury_wrapper.h:
	Change the size of the heap redzone when doing accurate GC.
	Use a small heap when debugging agc.

runtime/mercury_debug.h:
runtime/mercury_conf_param.h:
	Add new debugging macros and document them.

runtime/mercury_type_info.c:
	Add const to the pointer arguments of MR_make_type_info.
1998-07-22 07:55:19 +00:00
Thomas Conway
56801ceb2e fix a trivial bug in my previous changes.
runtime/machdeps/i386_reg.h:
	fix a trivial bug in my previous changes.
1998-06-09 07:25:37 +00:00
Thomas Conway
a70b59e83c Add a test to find the number of words needed to represent a
configure.in:
        Add a test to find the number of words needed to represent a
        synchronization term.

boehm_gc/gc.h:
        fix a declaration by replacing the args () with (void).
boehm_gc/solaris_pthreads.c:
        add a missing include
        check the return values of pthread calls.

compiler/*.m:
        Add handling for the new HLDS goal type par_conj.
        Add handling for the four new LLDS instructions:
                init_sync_term
                fork
                join_and_terminate
                join_and_continue

compiler/code_info.m:
        add a new alternative for slot_contents - sync_term.

compiler/handle_options.m:
        add .par as part of the grade

compiler/hlds_goal.m:
        add the new goal type par_conj.

compiler/instmap.m:
        add instmap__unify which takes a list of instmaps
                and abstractly unifies them.
        add unify_instmap_delta which tajes two instmap deltas
                and abstractly unifies them.

compiler/llds.m:
        add the new llds instructions.

compiler/mode_info.m:
        add par_conj as a lock reason.

library/Makefile:
        work around a bug in the solaris version pthread.h

library/benchmarking.m:
        reference the stack zones from the engine structure
        rather than from global variables.

library/{nc,sp}_builtin.nl:
        add an op declaration for &.

library/std_util.m:
        change references to global variables to references inside
        the engine structure.

runtime/Mmakefile:
        add mercury_thread.{c,h}
        add THREADLIBS to the libraries

runtime/*.{c,h}
        Remove some old junk from the previous processes/shrd-mem
        changes that found their way into the repository.
        Add MR_ prefixes to lots of names.

runtime/mercury_context.c:
        Add init_thread_stuff for creating and initializing a
        context structure for the current thread.

runtime/mercury_context.h:
        add a field to the mercury context which stores the thread id
        of the thread where this context originated.
        add various macros for implementing the new llds instructions.

runtime/mercury_engine.c:
        initialize the engine structure, rather than a bunch of globals.

runtime/mercury_engine.h:
        declare the mercury_engine structure.

runtime/mercury_regorder.h:
        if MR_THREAD_SAFE, and there is at least one global register
        then use mr0 as a pointer to the mercury engine structure.

scripts/init_grade_options.sh-subr
        add thread_safe

scripts/mgnuc.in
        add THREAD_OPTS

scripts/ml.in:
        add THREAD_LIBS
1998-06-09 02:16:31 +00:00
Fergus Henderson
5720b13df2 Add support for gcc global registers on Linux/PPC.
runtime/mercury_regs.h:
	Change `#if defined(_POWER)' to
	`#if defined(_POWER) || defined(__powerpc)',
	since gcc on Linux/PPC does not defined `_POWER'.

runtime/machdeps/rs6000_regs.h:
	Fix a typo that broke the PPC port:
	`restore_transient_reg_from_mem' should have been
	`restore_transient_regs_from_mem'.
			      ^
README.Linux-PPC:
	Update to reflect recent developments: with egcs,
	we now support global register variables.
1997-12-18 03:15:54 +00:00
Fergus Henderson
dc5f071d54 Fix a bug reported by Bas De Becker <basde.bakker@pica.nl>.
Estimated hours taken: 0.25

Fix a bug reported by Bas De Becker <basde.bakker@pica.nl>.

runtime/machdeps/regtest.c:
	Move #include statements after the global register variable
	declaration, to avoid problems on systems which define
	inline functions in the system header files.
1997-11-13 11:12:18 +00:00
Fergus Henderson
dceb7c6995 Add declarations for global register for the 68000 architecture.
Estimated hours taken: 0.75

runtime/machdeps/m68k.h:
	Add declarations for global register for the 68000 architecture.
	This code has not been tested, due to lack of a machine to test it on.
	Hence I have not enabled it -- I have not added code to
	runtime/regs.h to conditionally #include this header file.
	The reason for adding this code now is just to make it easier
	for whoever eventually does the 68k port.
1997-08-15 15:32:08 +00:00
Fergus Henderson
04b720630b Update the copyright messages so that (a) they contain the correct years
and (b) they say "Copyright (C) ... _The_ University of Melbourne".
1997-07-27 15:09:59 +00:00
Bert Thompson
616c652ea4 Modified C code to make it conform to the C coding standards.
Estimated hours taken: 5

Modified C code to make it conform to the C coding standards.

runtime/
	Mmake call.mod calls.h context.h context.mod debug.h
	deep_copy.c deep_copy.h dlist.c dlist.h dummy.c engine.h
	engine.mod getopt.h goto.h heap.h imp.h init.h label.c label.h
	memory.c memory.h mercury_float.h mercury_solver_backtrack.h
	mercury_string.h mercury_types.h misc.c misc.h overflow.h
	prof.c prof.h prof_mem.c prof_mem.h regorder.h regs.h
	spinlock.c spinlock.h stacks.h std.h table.c table.h tags.h
	timing.c timing.h type_info.h wrapper.h wrapper.mod
runtime/machdeps/
	alpha_regs.h i386_regs.h mips_regs.h no_regs.h pa_regs.h
	regtest.c rs6000_regs.h sparc_regs.h
util/
	demangle.c mkinit.c
1997-02-12 02:18:54 +00:00
Fergus Henderson
ba8532df11 Improve the support for shared libraries on Linux ELF.
Estimated hours taken: 0.5

Improve the support for shared libraries on Linux ELF.

runtime/mach_deps/i386_regs.h:
	If `PIC_REG' is defined, don't use %ebx,
	even if we're not compiling in PIC.

README.Linux:
	Update the documentation: when using shared libraries, it's more
	efficient to compile your main program with just `-DPIC_REG'
	rather than `-fpic'; `-DPIC_REG' is enough to make it work,
	and doesn't slow it down as much as `-fpic' does.
1997-02-10 17:03:40 +00:00
Fergus Henderson
ea65f86e9b One of a number of changes to add support for ELF shared libraries on Linux.
Estimated hours taken: 8

One of a number of changes to add support for ELF shared libraries on Linux.

runtime/machdeps/i386_regs.h:
	If compiling with -fpic, register `ebx' is reserved for use by
	gcc, so we can't use it.
1997-02-07 07:03:36 +00:00
Fergus Henderson
d96a3622dd Fix bugs in my previous change.
Estimated hours taken: 0.25

runtime/machdeps/rs6000_regs.h:
runtime/machdeps/sparc_regs.h:
	Fix bugs in my previous change.
1997-02-02 03:41:03 +00:00
Fergus Henderson
d25a619caf Add the usual "#ifndef SPARC_REGS_H" header guard.
Estimated hours taken: 0.1

runtime/machdeps/sparc_regs.h:
	Add the usual "#ifndef SPARC_REGS_H" header guard.
1997-01-31 19:14:58 +00:00
Fergus Henderson
06836efe02 Fix a typo in my previous change.
Estimated hours taken: 0.25

runtime/machdeps/sparc_regs.h:
	Fix a typo in my previous change.
1997-01-31 16:32:02 +00:00
Fergus Henderson
e21c14c8be Fix a bug in the C->Mercury interface: the Mercury code was using the
Estimated hours taken: 5

Fix a bug in the C->Mercury interface: the Mercury code was using the
callee-save registers (as global register variables) and not restoring
them before returning to the C code.

runtime/machdeps/*.h:
	Replace the macros
		save_registers(),
		restore_registers(),
		save_transient_registers(), and
		restore_transient_registers()
	which were hard-coded to save/restore from `fake_reg',
	with new ones called
		save_regs_to_mem(save_area),
		restore_regs_from_mem(save_area),
		save_transient_regs_to_mem(save_area), and
		restore_transient_regs_from_mem(save_area)
	that take a `save_area' parameter indicating which memory
	buffer to use.
1997-01-31 07:54:44 +00:00
Fergus Henderson
b9c1c429e9 New file, containing some general documentation about
Estimated hours taken: 0.25

runtime/machdeps/README:
	New file, containing some general documentation about
	how to define the registers for a new architecture.
1997-01-31 07:53:58 +00:00
Zoltan Somogyi
b0bf4f6f46 When compiling on the SPARC in a grade that wants global registers but not
Estimated hours taken: 0.1

When compiling on the SPARC in a grade that wants global registers but not
nonlocal gotos (i.e. reg and reg.*), give an error instead of silently
ignoring the request for global registers.
1996-12-08 08:24:40 +00:00
Fergus Henderson
263bd2f25b Add stuff from the gcc source code, as documentation of the
Estimated hours taken: 0.1

runtime/machdeps/RS6000_REGS:
	Add stuff from the gcc source code, as documentation of the
	registers used for RS/6000.
1996-05-02 16:35:18 +00:00
Fergus Henderson
92bcc02ec3 Use register $15 as a seventh global register.
Estimated hours taken: 0.75

runtime/machdeps/alpha_regs.h:
	Use register $15 as a seventh global register.
	This should improve performance slightly, but
	the main reason for the change is that it may
	avoid some problems with $15 being clobbered
	due to cross-function jumps skipping the save
	and restore of it in the function prologue/epilogue.
1996-04-30 18:16:01 +00:00
Fergus Henderson
a6f378ad95 A fix for global register variables on the RS/6000.
Estimated hours taken: 0.25
	(Plus about 6-12 hours debugging via email, over the course of
	a week, to find the problem.)

A fix for global register variables on the RS/6000.

runtime/machdeps/rs6000_regs.h:
	Work around a bug in gcc for the rs6000: gcc 2.7.2 sometimes
	saves/restores global register variables in function
	prologue/epilogues, which causes havoc, and goes against what
	the gcc documentation says.  In particular, it save and restores
	all the registers from the lowest-numbered call-saved register
	used through to r31.  The work-around is to use only the
	lowest-numbered call-saved registers for global register variables.
	(This fix is as yet untested.)
1996-04-17 20:48:28 +00:00
Fergus Henderson
05c8f2a702 Add GNU C global register declarations for RS/6000.
Estimated hours taken: 0.75

runtime/machdeps/rs6000_regs.h:
	Add GNU C global register declarations for RS/6000.
	Untested.
1996-03-30 09:33:01 +00:00
Fergus Henderson
110978d092 Add script for testing which gcc global registers can be used.
Estimated hours taken: 0.5

runtime/machdeps/generic_regtest:
	Add script for testing which gcc global registers can be used.
	This script uses register numbers (0-100) rather than names,
	so it will work on any machine.
1996-03-02 14:53:13 +00:00
Fergus Henderson
544611b675 Add global register declarations for the PA architecture.
runtime/machdeps/pa_regs.h:
	New file.

runtime/Mmake, runtime/regs.h:
	Add reference to machdeps/pa_regs.h.
1996-01-15 00:25:23 +00:00
Fergus Henderson
e9a0d343f2 Fix error: we use only 6 real registers, not 7.
Estimated hours taken: 0.1

runtime/machdeps/alpha_regs.h:
	Fix error: we use only 6 real registers, not 7.
1995-12-28 09:20:43 +00:00
Fergus Henderson
a2ac242e3b Fix syntax error.
Estimated hours taken: 0.1

runtime/machdeps/no_regs.h:
	Fix syntax error.
1995-12-28 05:18:09 +00:00
Fergus Henderson
a7e8640072 Fix problem on Linux where global register declarations occur after
Estimated hours taken: 0.5

Fix problem on Linux where global register declarations occur after
inline function definitions in system header files.

machdeps/*.h:
	Use `register' rather than `reg' to avoid dependency on "std.h".
1995-12-28 03:56:11 +00:00
Fergus Henderson
ed2601f855 Add a couple of lines of documentation.
runtime/machdeps/*:
	Add a couple of lines of documentation.
1995-09-09 03:51:29 +00:00
Fergus Henderson
02d8b37624 Add some more documentation.
runtime/machdeps/i386_regs.h:
	Add some more documentation.
1995-09-03 13:23:04 +00:00