🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #750

Re: Large constants in RISC

#750
From: Thomas Koenig
Date: Sun, 15 Nov 2026 10:06
45 lines
2683 bytes
Waldek Hebisch <antispam@fricas.org> schrieb:

> I read what he wrote and I do not doubt that code having constants
> in instructions is faster.  What is not clear how frequently
> code with explicit constants appears in real life.

Some statistics, from counting assembly on my favorite applications.
"labels mem" can be either 32-bit or 64-bit, depending on the
memory model.  The results depend on the current state of the compiler,
of course.

gnuplot:

Instructions:          128531
16-bit-immediates mem:  11086 ( 8.63%)
Labels mem:             25757 (20.04%)
5-bit immediates.       26520 (20.63%)
16-bit immediates:       7129 ( 5.55%)
32-bit-immediates:        627 ( 0.49%)
64-bit-immediates:       1191 ( 0.93%)

Perl:

Instructions:          552093
16-bit-immediates mem:  89642 (16.24%)
Labels mem:             58505 (10.60%)
5-bit immediates.      114569 (20.75%)
16-bit immediates:      39361 ( 7.13%)
32-bit-immediates:       9075 ( 1.64%)
64-bit-immediates:       5427 ( 0.98%)

GSL (GNU Scientific Library):

Instructions:          279126
16-bit-immediates mem:  31401 (11.25%)
Labels mem:             13266 ( 4.75%)
5-bit immediates.       57499 (20.60%)
16-bit immediates:      13957 ( 5.00%)
32-bit-immediates:       4350 ( 1.56%)
64-bit-immediates:       4418 ( 1.58%)

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Technical Details
Message-ID: <11dc07h$2lal5$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11d76uq$11cdc$1@paganini.bofh.team> <11d7ct8$17akn$1@dont-email.me> <11d7ih2$11orr$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Thomas Koenig <tkoenig@netcologne.de>
Newsgroups: comp.arch
Subject: Re: Large constants in RISC
Date: Sun, 15 Nov 2026 10:06:41 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <11dc07h$2lal5$1@dont-email.me>
References: <11d76uq$11cdc$1@paganini.bofh.team>
 <11d7ct8$17akn$1@dont-email.me> <11d7ih2$11orr$1@paganini.bofh.team>
 <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team>
Injection-Date: Sun, 15 Nov 2026 10:06:42 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2796197"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/3L+FqrvEbIFOmPQIx7pTny2Er5SDBEsQ="; posting-host="c01236227eea1b8f139016af6317dcb3"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:+kZM3HrjRfcAtOG++lW6LsaHk4U= sha256:kIcvzxu1Vh6n7d7xctnXxV7u6pkpp4wpBQgPoYV6vhE=
	sha1:q2W5n8gmqDYtV5ssn1WuHWrHcHU= sha256:5RtXmxd81SprdX6fFnmSkF5NCEeu4bVXxMnVd/AfAKc=