[HN Gopher] ESP32-S3 has a few SIMD instructions
       ___________________________________________________________________
        
       ESP32-S3 has a few SIMD instructions
        
       Author : _Microft
       Score  : 104 points
       Date   : 2024-05-05 16:21 UTC (6 hours ago)
        
 (HTM) web link (bitbanksoftware.blogspot.com)
 (TXT) w3m dump (bitbanksoftware.blogspot.com)
        
       | adolph wrote:
       | _The Xtensa processor comes from Cadence and for some reason they
       | like to keep everything under NDA, even information which would
       | help people use their processors. I find it hard to understand
       | why the instruction set should be kept secret; a CPU vendor
       | should make it as easy as possible for engineers to use their
       | CPUs._
       | 
       | The P4 can't come soon enough to get off Xtensa.
        
         | jsheard wrote:
         | The P4 doesn't have a built-in radio though, so if you want
         | those beefy RISC-V cores you will need to integrate a second
         | ESP32 just to handle WiFi/BT :(
         | 
         | It will have USB-OTG and an LCD driver at least, which so far
         | have been missing from all of their RISC-V parts.
        
           | ComputerGuru wrote:
           | Cost optimization aside, that has always been the best way to
           | use an ESP chip. Just go with one of their barebone models
           | wired up as a peripheral to an ARM or RISC mcu.
        
             | clbrmbr wrote:
             | Yet it's possible to build some incredible applications on
             | top of just ESP32, especially with extra RAM.
        
           | timschmidt wrote:
           | Seems likely they'll continue releasing more models, further
           | integrating the features of the P4 and C6 for example. Maybe
           | we'll even get some risc-v SIMD instructions and support for
           | off-chip SRAM.
        
           | antoniuschan99 wrote:
           | I think that's totally fine. Might actually be the future
           | direction. But yea would've been nice to have wifi/bt
           | integrated.
           | 
           | Eg if you want 5ghz then use c5, or if you want some wifi-6
           | so c6, etc.
           | 
           | Also here's a talk by them on how to use esp as a wifi
           | coprocessor https://youtu.be/g14aEjnjRLw?si=TgkEyJJ2_L_Shuom
           | 
           | There's also adafruit airlift
           | https://www.adafruit.com/product/4201
        
           | yau8edq12i wrote:
           | Without the builtin radio it's really hard to justify the use
           | of an ESP32 over, say, an STM32. The integrated small package
           | with "everything" to make a fun project is the whole appeal.
        
             | AlotOfReading wrote:
             | Espressif has a huge advantage in lead times over ST
             | recently. I migrated a few projects over because ST
             | couldn't or wouldn't give us supply in under a month when
             | you could buy ESP chips and have them on your doorstep
             | practically overnight.
        
               | vbezhenar wrote:
               | Did you look at chinese STM clones? We used gd32, I liked
               | it.
        
           | sitkack wrote:
           | The ESP8684H2 is 1.20 qty 1, more than enough to handle BT an
           | Wifi, then you can use any MCU you want as your application
           | processor.
        
         | ajross wrote:
         | FWIW this bit in the article is a little confused. The SIMD
         | instructions being detailed appear to be Espressif-custom
         | things implemented using Cadence's "TIE" facility.
         | 
         | Cadence does indeed have their own SIMD architecture ("HiFi",
         | really it's a family of similar but binary-incompatible ISAs).
         | And indeed docs for that don't appear in public (though if you
         | look carefully, details for how to emit the instructions are
         | part of the GNU toolchain integration).
         | 
         | But that isn't this. If you want docs for this, talk to
         | Espressif, not Cadence.
        
       | lunfard000 wrote:
       | Was it a secret? You could have guessed that something advertised
       | [0] for "AI" had some kind of SIMD. Even ChatGPT 3.5 can give
       | relevant code to use "AI" features [1].
       | 
       | 0: https://www.espressif.com/en/products/socs/esp32-s3
       | 
       | 1: https://chat.openai.com/share/3e1f990d-e8eb-4e56-acbb-
       | ad5a33...
        
         | iamflimflam1 wrote:
         | Not a secret - just not documented very well if at all.
         | 
         | We all knew there were SIMD instructions, but if there's no
         | information on how to use them or what they do...
        
           | lunfard000 wrote:
           | And the author is not documenting them either, just
           | announcing his new niche library. It is not like
           | disassembling a few functions to prove that they exist is
           | dark magic. I just don't see any value in the article.
        
           | bobmcnamara wrote:
           | IIRC, they have 128bit alignment requirements, so tricky to
           | autovectorize.
        
         | relaxing wrote:
         | I love doing engineering based off of advertising material...
        
         | amelius wrote:
         | > Even ChatGPT 3.5 can give relevant code to use "AI" features
         | 
         | I've seen ChatGPT invent its own functions and commands ...
        
           | exe34 wrote:
           | if problem: solve_problem()
           | 
           | There, problem solved!
        
       | tzmlab wrote:
       | There's also a follow-up blog post "ESP32-S3 SIMD Minimal
       | Example" [0].
       | 
       | 0:
       | https://bitbanksoftware.blogspot.com/2024/01/esp32-s3-simd-m...
        
       | londons_explore wrote:
       | ESP_Sprite, former opensource-projects-guy, now Espressif
       | employee, is the best source of knowledge on this stuff.
       | 
       | Looks like back in 2021 they had an intention to document these,
       | but never quite got round to it:
       | 
       | https://esp32.com/viewtopic.php?p=88114&sid=f7f25776d9cfc6b6...
       | 
       | They do publish a bunch of opensource code that uses the SIMD
       | stuff, and an assembler, so it isn't secret, just very badly
       | documented.
        
         | londons_explore wrote:
         | Upon further inspection, it now seems like it is much better
         | documented...
         | 
         | Page 37-301 of the reference manual seems to have all you'd
         | need, including binary instruction encodings, details on
         | instruction timings, etc.
         | 
         | https://www.espressif.com/sites/default/files/documentation/...
        
       | londons_explore wrote:
       | I had plans to use this SIMD support for some DSP algorithms on
       | camera video feeds.... But looking at how badly documented it is,
       | I may reconsider...
       | 
       | Without scatter/gather I don't think I'm gonna be able to meet my
       | timing requirements (I need to distort images through warping,
       | which is tricky to do without scatter/gather)
        
       | amelius wrote:
       | Where is a good overview of the various ESP32 chips available and
       | their features?
        
         | mort96 wrote:
         | Espressif has a pretty decent overview on their website:
         | https://www.espressif.com/en/products/socs
         | 
         | They also make a set of modules per chip, so you can get a
         | particular chip in an easier to use package with e.g a built-in
         | PCB antenna or antenna mounting ports or no antenna, various
         | onboard flash sizes, that sort of stuff:
         | https://www.espressif.com/en/products/modules
        
       ___________________________________________________________________
       (page generated 2024-05-05 23:00 UTC)