On Thu, 2023-11-23 at 17:14 +0800, chenglulu wrote:
> When I look at this code and compare it to our scalar implementation, it 
> seems
> 
> that our scalar implementation still lacks an "lround".

Should be "lroundeven".  We don't have an instruction for lround :(.

I tried this but it does not work:

-(define_int_iterator LRINT [UNSPEC_FTINT UNSPEC_FTINTRM UNSPEC_FTINTRP])
+(define_int_iterator LRINT
+  [UNSPEC_FTINT UNSPEC_FTINTRM UNSPEC_FTINTRP UNSPEC_FTINTRNE])
 (define_int_attr lrint_pattern [(UNSPEC_FTINT "lrint")
                                (UNSPEC_FTINTRM "lfloor")
-                               (UNSPEC_FTINTRP "lceil")])
+                               (UNSPEC_FTINTRP "lceil")
+                               (UNSPEC_FTINTRNE "lroundeven")])
 (define_int_attr lrint_submenmonic [(UNSPEC_FTINT "")
                                    (UNSPEC_FTINTRM "rm")
-                                   (UNSPEC_FTINTRP "rp")])
+                                   (UNSPEC_FTINTRP "rp")
+                                   (UNSPEC_FTINTRNE "rne")])

The problem is "lroundevenMN2" is not a standard pattern name.  The SIMD
version of ftintrne in patch 1 only works because we are expanding
"roundevenM2" (it's a standard pattern name) to UNSPEC_SIMD_FRINTRNE,
and then a define_insn can match (fix (UNSPEC_SIMD_FRINTRNE op)).  But
for non-SIMD we don't have roundevenM2.

-- 
Xi Ruoyao <xry...@xry111.site>
School of Aerospace Science and Technology, Xidian University

Reply via email to