Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] Fixes for MIPS assembly [w/ PATCHES]
From: Paul H. Hargrove (PHHargrove_at_[hidden])
Date: 2012-02-15 01:13:08

The attached patches fix three problems with the non-inline ASM for MIPS
(and MIPS64EL):
1) ".set rerorder" was placed too early.
    This was causing loss of the SLTU instruction in the jump delay
    slot which follows the return instruction. Since that SLTU is
    used to set the return value, this was fatal to most tests in test/asm.
2) The 64-bit cmpset code was performing the XOR (to compare the read
    value to 'oldval') using 'addr' as the destination register. Since
    XOR is in the delay slot of the retry branch instruction (except in
    the acq variant) any retry would load from an invalid 'addr' (SEGV).
3) The 64-bit cmpset code was using the wrong destination register for
    the SLTU and thus not setting the return value (even after the
    ".set reorder" was placed correctly).

There is one patch each for the 1.5 branch and trunk.
Both have been testing with on:
     linux/mips32 w/ -march=4kc in the *FLAGS (gcc-4.4.5)
     linux/mips64 w/ -mabi=n32 in the *FLAGS (gcc-4.3.2)
     linux/mips64 w/ -mabi=64 in the *FLAGS (gcc-4.3.2)
     linux/mips64el (gcc-4.2.3)

Of those 8 builds, the mips32/ompi-1.5 build is the only one that fails.
That is because, unlike trunk, it tries to build the 64-bit atomics
which the assembler then rejects.
I have not attempted to backport the fix(es) for that from trunk to 1.5.

On the linux/mips64el platform I also tried the PathScale 3.3a compilers
on both branches.
On both branches the atomic_*_noinline tests all PASS, which validates
these patches.
On trunk all the tests in test/asm are PASSing.
However, the versions NOT suffixed with _noinline are FAILing on the 1.5
Since those failures DO NOT use the files touched by these patches, they
are irrelevant.

If/when these patches have been committed, I may consider returning to
the 1.5 branch to backport/CMR
+ support for MIPS32 (should not be trying to build the 64-bit atomics)
+ fix for the inline atomics (the FAILures on the inline tests) w/ pathcc


Paul H. HargrovePHHargrove_at_[hidden]
Future Technologies Group
HPC Research Department                   Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900