mersenneforum.org  

Go Back   mersenneforum.org > Prime Search Projects > Sierpinski/Riesel Base 5

Reply
 
Thread Tools
Old 2007-06-26, 03:24   #144
BlisteringSheep
 
BlisteringSheep's Avatar
 
Oct 2006
On a Suzuki Boulevard C90

2·3·41 Posts
Default

FYI, sr5sieve-1.5.8 passes the sr5check test.

Thanks for the clarification on the command-line.txt option. Using that is easier for me in one way because I can create finer grained ranges (I never have the same number of CPUs to run with, so I can't get even splits on G boundaries when divying up ranges).

1.5.9 doesn't compile when EXPERIMENTAL is set to 1. I get errors starting with:
gcc412 -O3 -ffast-math -mtune=G5 -mcpu=970 -m64 -fomit-frame-pointer -maltivec -mabi=altivec -Wall -Xassembler -mregnames -DDEFAULT_L1_CACHE_SIZE=32 -DDEFAULT_L2_CACHE_SIZE=512 -DUSE_ASM -DUSE_INLINE_MULMOD -DNDEBUG -c -o bsgs.o bsgs.c
bsgs.c: In function 'climb_ladder_2':
bsgs.c:603: error: impossible register constraint in 'asm'

I've attached the full error list. I get the same errors with gcc-3.4.6.
Attached Files
File Type: zip comperror.txt.zip (1.1 KB, 110 views)

Last fiddled with by BlisteringSheep on 2007-06-26 at 03:26 Reason: added EXPERIMENTAL notation
BlisteringSheep is offline   Reply With Quote
Old 2007-06-26, 04:01   #145
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

115710 Posts
Default

Quote:
Originally Posted by BlisteringSheep View Post
bsgs.c:603: error: impossible register constraint in 'asm'
This is probably to do with the condition registers. I will write a version that uses fixed registers cr4, cr5, cr6, cr7 instead of trying to get GCC to choose them. Until then you could try changing the definition of CONDITION_REGISTER_T from `uint64_t' to `char', or `int' and see if it makes a difference.

Last fiddled with by geoff on 2007-06-26 at 04:02 Reason: fixed quote.
geoff is offline   Reply With Quote
Old 2007-06-26, 04:21   #146
BlisteringSheep
 
BlisteringSheep's Avatar
 
Oct 2006
On a Suzuki Boulevard C90

2×3×41 Posts
Default

Quote:
Originally Posted by geoff View Post
Until then you could try changing the definition of CONDITION_REGISTER_T from `uint64_t' to `char', or `int' and see if it makes a difference.
That changed some of the specific values in the error messages, but the errors are still all the same.
BlisteringSheep is offline   Reply With Quote
Old 2007-06-26, 10:59   #147
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

11·577 Posts
Default

Quote:
Originally Posted by geoff View Post
GCC doesn't know that addze depends on adde, it might reorder these operations or schedule another instruction between them that clobbers the carry flag. I don't think there is a way to tell GCC about the dependancy, so it is necessary to combine both instructions into one asm().
If gcc does, then it would be very easy to write an inline function that combines those two instructions and only those two. The point is that it is easier to write the C code than the ASM code and it is easier for anyone looking at the code to understand. Unless gcc screws up the optimization, there should be little if any cost to writing the mulmod in C.

Quote:
Originally Posted by geoff View Post
In version 1.5.9 I have tried to use the idea from this code to modify the existing code. Set EXPERIMENTAL to 1 in asm-ppc64.h to enable it. The definition for CONDITION_REGISTER_T might need to be changed. I have also fixed the malloc.h issues for OS X.
I have same same problems as BlisteringSheep with compiling.

Quote:
Originally Posted by geoff View Post
How many condition registers does the PPC64 have?
8
rogue is offline   Reply With Quote
Old 2007-06-28, 01:53   #148
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13×89 Posts
Default

I think I know what caused the compile errors in verison 1.5.9 -- register "cc" refers to all condition registers, not just cr0. I think if you replaced each "cc" with "cr0" then it would compile.

In version 1.5.10 I have used fixed condition registers instead of getting GCC to choose which ones to use. There are two options in asm-ppc64.h: EXPERIMENTAL=1 uses just one condition register for all conditional branches, EXPERIMENTAL=2 uses up to 4 condition registers.
geoff is offline   Reply With Quote
Old 2007-06-28, 02:07   #149
BlisteringSheep
 
BlisteringSheep's Avatar
 
Oct 2006
On a Suzuki Boulevard C90

2·3·41 Posts
Default

With EXPERIMENTAL set to 1 or 2:


gcc412 -O3 -ffast-math -mtune=G5 -mcpu=970 -m64 -fomit-frame-pointer -maltivec -mabi=altivec -Wall -Xassembler -mregnames -DDEFAULT_L1_CACHE_SIZE=32 -DDEFAULT_L2_CACHE_SIZE=512 -DUSE_ASM -DUSE_INLINE_MULMOD -DNDEBUG -c -o bsgs.o bsgs.c
bsgs.c: In function 'baby_steps_4':
bsgs.c:263: error: expected string literal before ')' token
bsgs.c: In function 'baby_steps_1':
bsgs.c:340: error: expected string literal before ')' token
bsgs.c: In function 'giant_steps_1':
bsgs.c:511: error: expected string literal before ')' token
bsgs.c: In function 'climb_ladder_4':
bsgs.c:617: error: expected string literal before ')' token
bsgs.c: In function 'climb_ladder_1':
bsgs.c:659: error: expected string literal before ')' token
bsgs.c: In function 'setup64':
bsgs.c:763: error: expected string literal before ')' token
bsgs.c:796: error: expected string literal before ')' token
bsgs.c:848: error: expected string literal before ')' token
make: *** [bsgs.o] Error 1
BlisteringSheep is offline   Reply With Quote
Old 2007-06-28, 02:09   #150
BlisteringSheep
 
BlisteringSheep's Avatar
 
Oct 2006
On a Suzuki Boulevard C90

2·3·41 Posts
Default

The output from the preprocessor for the part of baby_steps_4() with the error:

Code:
  for (j = 0; j < 3; j++)
    BJ64[j+1] = ({ register uint64_t ret, s, t; asm ("mulhdu  %0, %8, %3" "\n\t" "mulld   %1, %9, %3" "\n\t" "mulhdu  %2, %9, %3" "\n\t" "adde    %1, %0, %1" "\n\t" "addze   %2, %2" "\n\t" "srd     %1, %1, %6" "\n\t" "sld     %2, %2, %7" "\n\t" "or      %1, %1, %2" "\n\t" "mulld   %0, %3, %4" "\n\t" "mulld   %2, %1, %5" "\n\t" "sub     %0, %0, %2" "\n\t" "cmpdi   cr6, %0, 0" "\n\t" "bge+    cr6, 0f" "\n\t" "add     %0, %0, %5" "\n" "0:" : "=&r" (ret), "=&r" (s), "=&r" (t) : "r" (BJ64[j]), "r" (b), "r" (p), "r" (pShift), "r" (64-pShift), "r" (bLO), "r" (bHI) : "cr0", "cr6", ); ret; });
BlisteringSheep is offline   Reply With Quote
Old 2007-06-28, 02:15   #151
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

48516 Posts
Default

Quote:
Originally Posted by BlisteringSheep View Post
bsgs.c:263: error: expected string literal before ')' token
This probably just means there is a missing quote, comma, etc. somewhere :-( I will have a look now and see if I can spot it.
geoff is offline   Reply With Quote
Old 2007-06-28, 02:16   #152
BlisteringSheep
 
BlisteringSheep's Avatar
 
Oct 2006
On a Suzuki Boulevard C90

2×3×41 Posts
Default

As best as I can see, it's complaining because after preprocessing, the last line of the assembly code:
Code:
       : "r7", "r8", "r9", "r10", "cr0", "cr6" ); \
is getting turned in to:
Code:
"r" (bLO), "r" (bHI) : "cr0", "cr6", ); ret; });
which ends up with a comma between "cr6" and the closing parentheses.
BlisteringSheep is offline   Reply With Quote
Old 2007-06-28, 02:22   #153
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13×89 Posts
Default

Quote:
Originally Posted by BlisteringSheep View Post
As best as I can see, it's complaining because after preprocessing, the last line of the assembly code:
Code:
       : "r7", "r8", "r9", "r10", "cr0", "cr6" ); \
is getting turned in to:
Code:
"r" (bLO), "r" (bHI) : "cr0", "cr6", ); ret; });
which ends up with a comma between "cr6" and the closing parentheses.
Yes the following line in asm-ppc64.h is a problem, try removing the trailing comma:
Code:
       : "cr0", "cr6", ); \
geoff is offline   Reply With Quote
Old 2007-06-28, 02:26   #154
BlisteringSheep
 
BlisteringSheep's Avatar
 
Oct 2006
On a Suzuki Boulevard C90

2·3·41 Posts
Default

The difficulty for me is that the trailing comma isn't in asm-ppc64.h; it's in the preprocessed code. I can't see what it is in asm-ppc64.h that is causing it to appear after preprocessing.

Never mind. I found it (I was looking in the wrong place).

Last fiddled with by BlisteringSheep on 2007-06-28 at 02:27 Reason: eating crow
BlisteringSheep is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
srsieve/sr2sieve enhancements rogue Software 300 2021-03-18 20:31
32-bit of sr1sieve and sr2sieve for Win pepi37 Software 5 2013-08-09 22:31
sr2sieve question SaneMur Information & Answers 2 2011-08-21 22:04
sr2sieve client mgpower0 Prime Sierpinski Project 54 2008-07-15 16:50
How to use sr2sieve nuggetprime Riesel Prime Search 40 2007-12-03 06:01

All times are UTC. The time now is 09:31.


Sat Jul 17 09:31:15 UTC 2021 up 50 days, 7:18, 1 user, load averages: 1.62, 1.42, 1.50

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.