On Tue, 2026-04-14 at 08:42 +0200, John Paul Adrian Glaubitz via Gcc wrote: > Hi John, > > On Tue, 2026-04-14 at 02:38 +0000, John Scott wrote: > > I noticed at > > https://forge.sourceware.org/gcc/gcc-mirror/src/branch/master/gcc/config.gcc#L3399 > > that > > a glob expression "sh*-superh-elf" is used, and it's apparently intended to > > match embedded SuperH > > targets. However, the use of the "superh" token in the target triple > > appears to be serving as a > > manufacturer name. This looks like it could be a mistake; for example, I > > simply use the target tripl > > "sh-elf" when building Debian's bare-metal toolchain, and so this clause > > wouldn't take effect. It's > > also weird to see SuperH used in the manufacturer field anyway (Hitachi and > > Renesas would be more > > fitting if this were intended). > > It actually makes sense since there used to be a company called "SuperH" back > then, see: > > https://www.eetimes.com/hitachi-and-stmicro-form-superh-company/ > > > On the other hand, such as at lines 3429 and 3466 there, it seems like > > "sh-superh-*" is intended to be > > the same as "sh4-*", but only if there is no suffix on the CPU name. For > > example, sh2-superh-elf > > wouldn't get this "magic" treatment of being promoted to sh4. > > Sounds like just a minor convenience feature to default the SH target to sh4.
The main purpose of SuperH Inc was to develop the SH5 aka SH64. SH5 consisted of the SHcompact instruction set and SHmedia instruction set. SHcompact was essentially SH4 while SHmedia was the SIMD 64-bit next- generation-über-lord-CPU or something like that. > > This is, at the very least, confusing, and if it's on purpose some in-line > > commentary would be helpful. > > Maybe there was a historical reason for this? Otherwise it would be fitting > > if the matching expression > > didn't include a manufacturer/vendor name because that is imprecise and > > doesn't make a lot of sense here. > I guess they tried to use "superh" as a name for ABI/flavor here, which defaulted to SH4 baseline. I don't think it has of any meaning or significance anymore. SH5 / SH64 support has been removed already a while ago. This might just be (yet another) leftover piece. Best regards, Oleg Endo
