https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118103

--- Comment #4 from Li Pan <pan2.li at intel dot com> ---
gcc-14 has the correct behavior and mostly some middle-end change I guess.

└─(11:39:07 on master⚑ ✭)──> riscv64-linux-gnu-gcc-14 --version                 
riscv64-linux-gnu-gcc-14 (Ubuntu 14.2.0-4ubuntu2~24.04) 14.2.0

  70   │ test_exampe:
  71   │ .LFB2:
  72   │     .cfi_startproc
  73   │     frrm    a3
  74   │     fsrmi   2
  75   │     lla a2,.LANCHOR0
  76   │     lla a4,.LANCHOR0+8
  77   │     vsetivli    zero,4,e16,m1,ta,ma
  78   │     vle16.v v1,0(a2)
  79   │     vfnmadd.vv  v1,v1,v1
  80   │     fsrm    a3
  81   │     vfmsub.vv   v1,v1,v1
  82   │     vse16.v v1,0(a4)
  83   │     ret
  84   │     .cfi_endproc
  85   │ .LFE2:
  86   │     .size   test_exampe, .-test_exampe
  87   │     .section    .text.startup,"ax",@progbits
  88   │     .align  1
  89   │     .globl  main
  90   │     .type   main, @function
  91   │ main:
  92   │ .LFB3:
  93   │     .cfi_startproc
  94   │     addi    sp,sp,-16
  95   │     .cfi_def_cfa_offset 16
  96   │     sd  ra,8(sp)
  97   │     .cfi_offset 1, -8
  98   │     call    initialize
  99   │     frrm    a3
 100   │     fsrmi   2
 101   │     lla a2,.LANCHOR0
 102   │     lla a4,.LANCHOR0+8
 103   │     vsetivli    zero,4,e16,m1,ta,ma
 104   │     vle16.v v1,0(a2)
 105   │     vfnmadd.vv  v1,v1,v1
 106   │     fsrm    a3
 107   │     vfmsub.vv   v1,v1,v1
 108   │     vse16.v v1,0(a4)
 109   │     call    print_result

Reply via email to