Re: Count Words?

2018-06-17 Thread Seymour J Metz
, June 16, 2018 12:23 AM To: ASSEMBLER-LIST@listserv.uga.edu Subject: Re: Count Words? As with any multiple-byte operand with no alignment requirements, the second operand of TRT (containing the function bytes) can span a cache line or page boundary. So, unless the programmer is exceedingly

Re: Count Words?

2018-06-17 Thread Rob van der Heij
On 17 June 2018 at 03:57, Farley, Peter x23353 wrote: > Didn't think of that, but you are probably right - pipeline stalls are > quite expensive and tough to benchmark. > But pipeline stalls at least are consistent and show in a profile, even though it may not show the exact spot. I find

Re: Count Words?

2018-06-17 Thread Robin Vowels
From: "Charles Mills" Sent: Saturday, June 16, 2018 11:27 PM Is it worth pointing out that English is not an alphabet? The context was English alphabet. That English changes all the time? The alphabet doesn't. --- This email has been checked for viruses by Avast antivirus software.

Re: Count Words?

2018-06-17 Thread Robin Vowels
From: "Walt Farrell" Sent: Saturday, June 16, 2018 11:25 PM On Sat, 16 Jun 2018 13:17:52 +1000, Robin Vowels wrote: From: "Charles Mills" Sent: Friday, June 15, 2018 10:43 PM Possible non-alphabetic characters number around 200 FSVO "alphabet" For all values of alphabet. English

Re: Count Words?

2018-06-16 Thread Farley, Peter x23353
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Count Words? EXTERNAL EMAIL On 2018-06-16, at 18:53:32, Farley, Peter x23353 wrote: > > The PoP says for the Vector String instructions that "For all instructions > that optionally set the condition code, performance may be degraded if th

Re: Count Words?

2018-06-16 Thread Farley, Peter x23353
case? Peter -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Ed Jaffe Sent: Saturday, June 16, 2018 9:23 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Count Words? On 6/16/2018 5:53 PM, Farley, Peter x23353 wrote: > The

Re: Count Words?

2018-06-16 Thread Paul Gilmartin
On 2018-06-16, at 18:53:32, Farley, Peter x23353 wrote: > > The PoP says for the Vector String instructions that "For all instructions > that optionally set the condition code, performance may be degraded if the > condition code is set." > I suspect it's not that the Vector String instruction

Re: Count Words?

2018-06-16 Thread Ed Jaffe
On 6/16/2018 5:53 PM, Farley, Peter x23353 wrote: The PoP says for the Vector String instructions that "For all instructions that optionally set the condition code, performance may be degraded if the condition code is set." Have you found that performance can be significantly (or at all)

Re: Count Words?

2018-06-16 Thread Farley, Peter x23353
18 4:24 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Count Words? EXTERNAL EMAIL On 6/16/2018 12:15 PM, Paul Gilmartin wrote: > > I stand corrected. Thanks. > > This architecture has grown beyond human ken. Let the compiler do it, and > hope the compiler author gets it right.

Re: Count Words?

2018-06-16 Thread Ed Jaffe
On 6/16/2018 12:15 PM, Paul Gilmartin wrote: I stand corrected. Thanks. This architecture has grown beyond human ken. Let the compiler do it, and hope the compiler author gets it right. It's still understandable and VERY usable in hand-written code for real HLASM programmers. It just

Re: Count Words?

2018-06-16 Thread Paul Gilmartin
On 2018-06-16, at 12:06:48, Farley, Peter x23353 wrote: > And I got that instruction specification wrong. VFAEB is the extended > mnemonic form for VFAE with M4 set to 0 for byte length, so the "inverted" > instruction would be VFAEB V1,V1,V0,9 (adding 8 for mask bit zero to the M5 > operand

Re: Count Words?

2018-06-16 Thread Farley, Peter x23353
mbler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Paul Gilmartin Sent: Thursday, June 14, 2018 9:19 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Count Words? On 2018-06-14, at 18:50:01, Robin Vowels wrote: On 2018-06-14, at 16:05:54, Ed Jaffe wrote: > > Use VL to load 16 one-byte

Re: Count Words?

2018-06-16 Thread Charles Mills
: Friday, June 15, 2018 8:18 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Count Words? From: "Charles Mills" Sent: Friday, June 15, 2018 10:43 PM >> Possible non-alphabetic characters number around 200 > > FSVO "alphabet" For all values of alphabet. English

Re: Count Words?

2018-06-16 Thread Walt Farrell
On Sat, 16 Jun 2018 13:17:52 +1000, Robin Vowels wrote: >From: "Charles Mills" >Sent: Friday, June 15, 2018 10:43 PM > > >>> Possible non-alphabetic characters number around 200 >> >> FSVO "alphabet" > >For all values of alphabet. English hasn't changed much lately, >as I said. Did the OP

Re: Count Words?

2018-06-15 Thread Dan Greiner
As with any multiple-byte operand with no alignment requirements, the second operand of TRT (containing the function bytes) can span a cache line or page boundary. So, unless the programmer is exceedingly confident of the content of the first operand of TRT (i.e., the stuff that's being

Re: Count Words?

2018-06-15 Thread Robin Vowels
From: "Charles Mills" Sent: Friday, June 15, 2018 10:43 PM Possible non-alphabetic characters number around 200 FSVO "alphabet" For all values of alphabet. English hasn't changed much lately, as I said. --- This email has been checked for viruses by Avast antivirus software.

Re: Count Words?

2018-06-15 Thread Robin Vowels
From: "Tony Harminc" Sent: Saturday, June 16, 2018 3:03 AM On 14 June 2018 at 15:40, Charles Mills wrote: 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

Re: Count Words?

2018-06-15 Thread Seymour J Metz
Mainframe Assembler List on behalf of Paul Gilmartin <0014e0e4a59b-dmarc-requ...@listserv.uga.edu> Sent: Friday, June 15, 2018 12:53 PM To: ASSEMBLER-LIST@listserv.uga.edu Subject: Re: Count Words? On 2018-06-15, at 10:49:05, Seymour J Metz wrote: > What about translation and scanning

Re: Count Words?

2018-06-15 Thread Tony Harminc
On 14 June 2018 at 15:40, Charles Mills wrote: > 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

Re: Count Words?

2018-06-15 Thread Seymour J Metz
Subject: Re: Count Words? Back around the z9 (circa 2005), IBM pushed the TRT instruction into the hardware coprocessor (aka CoP). This produced fabulous performance scanning the first operand if the nonzero function byte occurred deep into the first operand (e.g., hundreds of bytes deep

Re: Count Words?

2018-06-15 Thread Seymour J Metz
Mainframe Assembler List on behalf of glen herrmannsfeldt Sent: Thursday, June 14, 2018 11:33 PM To: ASSEMBLER-LIST@listserv.uga.edu Subject: Re: Count Words? Nothing against discussions on how to write fast code, but I don’t believe that this is normally necessary. About 20 years ago, I was counting

Re: Count Words?

2018-06-15 Thread Charles Mills
U Subject: Re: Count Words? From: "Paul Gilmartin" <0014e0e4a59b-dmarc-requ...@listserv.uga.edu> Sent: Friday, June 15, 2018 5:18 AM > Is there a modern, clever, efficient way to count words in a string where: > o A separator is or (+ others ad lib.) > o

Re: Count Words?

2018-06-15 Thread Robin Vowels
From: "Ed Jaffe" Sent: Friday, June 15, 2018 11:14 AM On 6/14/2018 5:44 PM, Robin Vowels wrote: - Original Message - From: "Ed Jaffe" Sent: Friday, June 15, 2018 5:34 AM BY FAR the fastest way HANDS DOWN -- if you're looking for 16 or fewer characters -- is with the vector

Re: Count Words?

2018-06-15 Thread Robin Vowels
- Original Message - From: "Paul Gilmartin" <0014e0e4a59b-dmarc-requ...@listserv.uga.edu> To: Sent: Friday, June 15, 2018 11:18 AM On 2018-06-14, at 18:50:01, Robin Vowels wrote: Why is everyone afraid to use TRT? It is designed for just such a task. - Original Message

Re: Count Words?

2018-06-15 Thread Robin Vowels
How is ths useful? What does it mean? - Original Message - From: "Keven" Sent: Friday, June 15, 2018 12:32 PM I think the technical answer in this context is:1 x 16-letter word2 x 8-letter words 4 x 4-letter words8 x 2-letter words16 x 1-letter words This assumes single-byte

Re: Count Words?

2018-06-15 Thread Robin Vowels
GH's contribution seems to be not particularly relevant. However, I may add that in PL/I one trivial statement will count the number of words when any particular character (such as blank) is the delimiter. To permit bunches of other characters to be delimiters, a prior call to the TRANSLATE

Re: Count Words?

2018-06-14 Thread Robin Vowels
From: "Paul Gilmartin" <0014e0e4a59b-dmarc-requ...@listserv.uga.edu> Sent: Friday, June 15, 2018 5:18 AM Is there a modern, clever, efficient way to count words in a string where: o A separator is or (+ others ad lib.) o A word is a maximal non-empty sequence of consecuti

Re: Count Words?

2018-06-14 Thread Charles Mills
Amen! Charles -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of glen herrmannsfeldt Sent: Thursday, June 14, 2018 8:34 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Count Words? Nothing against discussions on how to write

Re: Count Words?

2018-06-14 Thread Paul Gilmartin
On 2018-06-14, at 21:21:11, Dan Greiner wrote: > Back around the z9 (circa 2005), IBM pushed the TRT instruction into the > hardware coprocessor (aka CoP). This produced fabulous performance scanning > the first operand if the nonzero function byte occurred deep into the first > operand

Re: Count Words?

2018-06-14 Thread glen herrmannsfeldt
Nothing against discussions on how to write fast code, but I don’t believe that this is normally necessary. About 20 years ago, I was counting words, not just how many, but how many of each word, on gigabytes of text. (Full text US patents for two years.) I did it in Java (with JIT compiler

Re: Count Words?

2018-06-14 Thread Dan Greiner
Back around the z9 (circa 2005), IBM pushed the TRT instruction into the hardware coprocessor (aka CoP). This produced fabulous performance scanning the first operand if the nonzero function byte occurred deep into the first operand (e.g., hundreds of bytes deep). Unfortunately, empirical

Re: Count Words?

2018-06-14 Thread Keven
I think the technical answer in this context is:1  x 16-letter word2 x  8-letter words 4 x  4-letter words8 x  2-letter words16 x 1-letter words This assumes single-byte character encoding. Sorry if this sounds facile; I found

Re: Count Words?

2018-06-14 Thread Ed Jaffe
On 6/14/2018 6:18 PM, Paul Gilmartin wrote: Oops! From PoOps: Proceeding from left to right, the elements of the second operand are compared with the corresponding elements of the third operand and optionally with zero. "Corresponding element" is the problem. If the second

Re: Count Words?

2018-06-14 Thread Paul Gilmartin
On 2018-06-14, at 18:50:01, Robin Vowels wrote: > Why is everyone afraid to use TRT? > It is designed for just such a task. > > - Original Message - From: "Charles Mills" > Sent: Friday, June 15, 2018 5:40 AM > >> Not the answer to your question but I don't think "TRT performs badly."

Re: Count Words?

2018-06-14 Thread Ed Jaffe
On 6/14/2018 5:44 PM, Robin Vowels wrote: - Original Message - From: "Ed Jaffe" Sent: Friday, June 15, 2018 5:34 AM BY FAR the fastest way HANDS DOWN -- if you're looking for 16 or fewer characters -- is with the vector instructions... How many words can you fit into 16 characters?

Re: Count Words?

2018-06-14 Thread Robin Vowels
for the job [such as TRT] makes it easier to write and debug. - Original Message - From: "Charles Mills" To: 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 peo

Re: Count Words?

2018-06-14 Thread Robin Vowels
- Original Message - From: "Ed Jaffe" Sent: Friday, June 15, 2018 5:34 AM BY FAR the fastest way HANDS DOWN -- if you're looking for 16 or fewer characters -- is with the vector instructions... How many words can you fit into 16 characters? --- This email has been checked for

Re: Count Words?

2018-06-14 Thread Farley, Peter x23353
Thank you! Peter -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Ed Jaffe Sent: Thursday, June 14, 2018 6:06 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Count Words? On 6/14/2018 1:50 PM, Farley, Peter x23353 wrote

Re: Count Words?

2018-06-14 Thread Ed Jaffe
On 6/14/2018 3:05 PM, Ed Jaffe wrote: LA R1,0(R15,1R1) Of course, I intended to type LA R1,0(R15,R1) -- Phoenix Software International Edward E. Jaffe 831 Parkview Drive North El Segundo, CA 90245 http://www.phoenixsoftware.com/

Re: Count Words?

2018-06-14 Thread Ed Jaffe
On 6/14/2018 1:50 PM, Farley, Peter x23353 wrote: Any way you could share a code example? Or at least pseudo code for the technique? Use VL to load 16 one-byte search arguments into (for example) V0 Use VLL to load 16 bytes (or how ever many remain if <16) of the string into (for example)

Re: Count Words?

2018-06-14 Thread Farley, Peter x23353
Subject: Re: Count Words? BY FAR the fastest way HANDS DOWN -- if you're looking for 16 or fewer characters -- is with the vector instructions... On 6/14/2018 12:18 PM, Paul Gilmartin wrote: > Is there a modern, clever, efficient way to count words in a string where: > o A separator is or (+

Re: Count Words?

2018-06-14 Thread Farley, Peter x23353
. Peter -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Farley, Peter x23353 Sent: Thursday, June 14, 2018 4:17 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Count Words? One could reverse engineer the XLC/C++ library module

Re: Count Words?

2018-06-14 Thread Farley, Peter x23353
: Thursday, June 14, 2018 3:41 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU 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 m

Re: Count Words?

2018-06-14 Thread Charles Mills
RT 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

Re: Count Words?

2018-06-14 Thread Ed Jaffe
BY FAR the fastest way HANDS DOWN -- if you're looking for 16 or fewer characters -- is with the vector instructions... On 6/14/2018 12:18 PM, Paul Gilmartin wrote: Is there a modern, clever, efficient way to count words in a string where: o A separator is or (+ others ad lib.) o A word

Count Words?

2018-06-14 Thread Paul Gilmartin
Is there a modern, clever, efficient way to count words in a string where: o A separator is or (+ others ad lib.) o A word is a maximal non-empty sequence of consecutive non-separator characters. (Whew!) Do TRT and CLI remain the best primitives? (TRT is reported to perform badly, perhaps