RISC-V Code : illegal instruction for 'aes32esi'

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • RISC-V Code : illegal instruction for 'aes32esi'

      Hello,
      for a RISC-V simple executable project ,

      I am encountering an "illegal instruction" error when using 'aes32esi'. The code compiles without any errors, but the error occurs at runtime.


      SEGGER setup:
      • arm_assembler_variant = "SEGGER"
      • asm_additional_options = "-target-feature;+zkne;-target-feature;+zknd;-target-feature;-zscrypto"
      • c_additional_options = "-target-feature;+zkne;-target-feature;+zknd"









      error :
      ========================================================

      ========================================================

      .section .text
      .global myfunc
      myfunc:
      # a0 = const char *str
      li x0, 0 # i = 0
      00000013 nop
      li x1, 1 # i = 0
      00100093 li ra, 1
      li x2, 1 # i = 0
      00100113 li sp, 1
      aes32esi x1, x2, x1, 2
      A21100B3 ??????




      code example to reproduce the error :
      ========================================================
      ========================================================



      //c-code file main.c
      /*********************************************************************

      #include <stdio.h>
      extern void myfunc(void);
      int main(void) {
      myfunc();
      int i;

      for (i = 0; i < 100; i++) {
      printf("Hello World %d!\n", i);
      }
      do {
      i++;
      } while (1);
      }

      //assembly file f1.S
      /*********************************************************************
      .section .text
      .global myfunc
      myfunc:
      # a0 = const char *str
      li x0, 0 # i = 0
      li x1, 1 # i = 0
      li x2, 1 # i = 0
      aes32esi x1, x2, x1, 2


      ret # Return back via the return address register