[PATCH] Improve and consolidate sparc PIC assembler.

David Miller davem at davemloft.net
Sat Apr 13 20:55:51 CEST 2013


From: Torbjorn Granlund <tg at gmplib.org>
Date: Sat, 13 Apr 2013 15:40:38 +0200

> I spotted a comment in gcc,
> 
> ;; Even on V9 we use this call sequence with a stub, instead of "rd %pc, ..."
> ;; because the RDPC instruction is extremely expensive and incurs a complete
> ;; instruction pipeline flush.
> 
> which perhaps answers my question.  But is that true in general or for
> some sparcv9 implementations?  It would be nice to avoid these long
> insns sequences where they can be avoided.

"rd %pc" is very expensive on every single chip I've tried it on.

It tends to flush the entire pipeline, which for example means a
minimum of 9 cycles on Ultra1&2.


More information about the gmp-devel mailing list