Why is everyone afraid to use TRT?
It is designed for just such a task.

There are multiple characters that can terminate a word.
(terminators can be determined dynamically, if required,
but since the English alphabet has not changed much lately ... )

Using the simplest instructions suitable for the job [such as TRT]
makes it easier to write and debug.

----- Original Message ----- From: "Charles Mills" <charl...@mcn.org>
To: <ASSEMBLER-LIST@LISTSERV.UGA.EDU>
Sent: Friday, June 15, 2018 5:40 AM
Subject: Re: Count Words?


Not the answer to your question but I don't think "TRT performs badly."

It is just that people sometimes assume that because it is a single
instruction in the Pop it must execute roughly as fast as many simple
instructions.

I think it is fast for what it does. Picture "writing TRT in assembler" --
implementing it as a subroutine as if the opcode magically vanished.

Now picture a version of that only somewhat faster because millicode has
some special tricks up its sleeve -- that's TRT.

If I had to count words in a string in assembler I would probably just use a
loop of CLI's and such -- unless there was some incredible need for
optimization. The big cost these days is getting the data into cache, and
that is all the same whether CLI, TRT, SRST, etc. TRT is perhaps a little
worse because you need to get two things into cache, the string and the
table. I might look first at SRST.

Charles

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Reply via email to