Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jun 2014 01:26:55 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        freebsd-ppc@freebsd.org
Subject:   powerpc64 10.0-STABLE's math/gmp gets "too few operands for instruction" under clang 3.4.1
Message-ID:  <F759971A-FAA9-444D-A66F-9D79E5B14F1B@dsl-only.net>
In-Reply-To: <7AB6B15C-2FB0-41A5-915D-ADEC175D78B8@dsl-only.net>
References:  <7AB6B15C-2FB0-41A5-915D-ADEC175D78B8@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help
clang did not finish the prerequisites for devel/boost-libs...

/usr/ports/math/gmp/work/gmp-5.1.3/mpn/ gets

divrem-2.lo
tmp-divrem-2.s error: too few operands for instruction
rlwinm 0, 0, 30, 1

and so clang stopped there.

An IBM web page reports ( =
http://www-01.ibm.com/support/knowledgecenter/?lang=3Den#!/ssw_aix_53/com.=
ibm.aix.aixassem/doc/alangref/rlwinm.htm%23iw480ken )...

rlwinm RA,RS,SH,MB,ME
rlwinm. RA,RS,SH,MB,ME
rlwinm RA,RS,SH,BM
rlwinm. RA,RS,SH,BM

The rlwinm and rlinm instructions rotate left the contents of the source =
general-purpose register (GPR) RS by the number of bits specified by the =
SH parameter, logically AND the rotated data with a 32-bit generated =
mask defined by the values in Mask Begin (MB) and Mask End (ME), and =
store the result in GPR RA.

Consider the following when using the rlwinm and rlinm instructions:

If the MB value is less than the ME value + 1, then the mask bits =
between and including the starting point and the end point are set to =
ones. All other bits are set to zeros.
If the MB value is the same as the ME value + 1, then all 32 mask bits =
are set to ones.
If the MB value is greater than the ME value + 1, then all of the mask =
bits between and including the ME value +1 and the MB value -1 are set =
to zeros. All other bits are set to ones.

The BM parameter can also be used to specify the mask for these =
instructions. The assembler will generate the MB and ME parameters from =
the BM value.



=3D=3D=3D
Mark Millard
markmi@dsl-only.net

On Jun 30, 2014, at 12:55 AM, Mark Millard <markmi@dsl-only.net> wrote:

buildworld uses -mlongcall for /usr/src/lib/csu/powerpc64/ and so clang =
3.4.1 stops there.

buildkernel uses -mcall-aixdesc and -Wa,-many for =
/usr/obj/usr/src/sys/GENERIC64/ and so clang stops there as well.


Technique of discovery: Starting from

FreeBSD-10.0-STABLE-powerpc-powerpc64-20140622-r267746-disk1.iso

[with /usr/ports/Mk/Uses/compiler.mk still reverted so it does not avoid =
clang so much --but I'v not gotten to devel/boost-all testing yet]

and with /etc/make.conf being:

CPP=3Dclang-cpp
CC=3Dclang
CXX=3Dclang++

then following script tries buildworld and buildkernel:

#!/bin/sh
rm -fr /usr/obj/*
#
# Presume a free-standing clang c++ is available for bootstrapping:
# One is in 10.0-STABLE for the specifics here.
#
# Convert to having hosted implementation material in place.
#
cd /usr/src/lib/libcxxrt
make clean
make
make install
#
cd /usr/src/lib/libc++
make clean
make
make install
#
# Then with the hosted implementation in place...
#
make buildworld
make buildkernel

In essence: it bootstraps from a freestanding clang based c++ =
implementation to a hosted c++ implementation before any other possible =
other uses of the c++ compiler (including before llvm and/or clang are =
rebuilt: They require a hosted implementation.).

libcxxrt and libc++ built without reporting errors. The lack of && =
between make buildworld and make buildkernel allowed the script file to =
show where both stopped: I was more interested in that information than =
continuing to build without starting over.

I will probably see what happens if I repeat my boost-all experiment: =
rebuild all the prerequisites in this context and then retry boost-all =
(if it it gets that far). That would mean that icu had been built by =
clang (if it is successful).

=3D=3D=3D
Mark Millard
markmi@dsl-only.net





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F759971A-FAA9-444D-A66F-9D79E5B14F1B>