@@ -1958,6 +1958,7 @@ vector_macro (struct riscv_cl_insn *ip)
19581958 int vs2 = (ip -> insn_opcode >> OP_SH_VS2 ) & OP_MASK_VS2 ;
19591959 int vm = (ip -> insn_opcode >> OP_SH_VMASK ) & OP_MASK_VMASK ;
19601960 int vtemp = (ip -> insn_opcode >> OP_SH_VFUNCT6 ) & OP_MASK_VFUNCT6 ;
1961+ const char * vmslt_vx = ip -> insn_mo -> match ? "vmsltu.vx" : "vmslt.vx" ;
19611962 int mask = ip -> insn_mo -> mask ;
19621963
19631964 switch (mask )
@@ -1966,7 +1967,7 @@ vector_macro (struct riscv_cl_insn *ip)
19661967 if (vm )
19671968 {
19681969 /* Unmasked. */
1969- macro_build (NULL , "vmslt.vx" , "Vd,Vt,sVm" , vd , vs2 , vs1 , -1 );
1970+ macro_build (NULL , vmslt_vx , "Vd,Vt,sVm" , vd , vs2 , vs1 , -1 );
19701971 macro_build (NULL , "vmnand.mm" , "Vd,Vt,Vs" , vd , vd , vd );
19711972 break ;
19721973 }
@@ -1975,13 +1976,13 @@ vector_macro (struct riscv_cl_insn *ip)
19751976 /* Masked. Have vtemp to avoid overlap constraints. */
19761977 if (vd == vm )
19771978 {
1978- macro_build (NULL , "vmslt.vx" , "Vd,Vt,sVm" , vtemp , vs2 , vs1 , -1 );
1979+ macro_build (NULL , vmslt_vx , "Vd,Vt,sVm" , vtemp , vs2 , vs1 , -1 );
19791980 macro_build (NULL , "vmandnot.mm" , "Vd,Vt,Vs" , vd , vm , vtemp );
19801981 }
19811982 else
19821983 {
19831984 /* Preserve the value of vd if not updating by vm. */
1984- macro_build (NULL , "vmslt.vx" , "Vd,Vt,sVm" , vtemp , vs2 , vs1 , -1 );
1985+ macro_build (NULL , vmslt_vx , "Vd,Vt,sVm" , vtemp , vs2 , vs1 , -1 );
19851986 macro_build (NULL , "vmandnot.mm" , "Vd,Vt,Vs" , vtemp , vm , vtemp );
19861987 macro_build (NULL , "vmandnot.mm" , "Vd,Vt,Vs" , vd , vd , vm );
19871988 macro_build (NULL , "vmor.mm" , "Vd,Vt,Vs" , vd , vtemp , vd );
@@ -1990,42 +1991,7 @@ vector_macro (struct riscv_cl_insn *ip)
19901991 else if (vd != vm )
19911992 {
19921993 /* Masked. This may cause the vd overlaps vs2, when LMUL > 1. */
1993- macro_build (NULL , "vmslt.vx" , "Vd,Vt,sVm" , vd , vs2 , vs1 , vm );
1994- macro_build (NULL , "vmxor.mm" , "Vd,Vt,Vs" , vd , vd , vm );
1995- }
1996- else
1997- as_bad (_ ("must provide temp if destination overlaps mask" ));
1998- break ;
1999-
2000- case M_VMSGEU :
2001- if (vm )
2002- {
2003- /* Unmasked. */
2004- macro_build (NULL , "vmsltu.vx" , "Vd,Vt,sVm" , vd , vs2 , vs1 , -1 );
2005- macro_build (NULL , "vmnand.mm" , "Vd,Vt,Vs" , vd , vd , vd );
2006- break ;
2007- }
2008- if (vtemp != 0 )
2009- {
2010- /* Masked. Have vtemp to avoid overlap constraints. */
2011- if (vd == vm )
2012- {
2013- macro_build (NULL , "vmsltu.vx" , "Vd,Vt,sVm" , vtemp , vs2 , vs1 , -1 );
2014- macro_build (NULL , "vmandnot.mm" , "Vd,Vt,Vs" , vd , vm , vtemp );
2015- }
2016- else
2017- {
2018- /* Preserve the value of vd if not updating by vm. */
2019- macro_build (NULL , "vmsltu.vx" , "Vd,Vt,sVm" , vtemp , vs2 , vs1 , -1 );
2020- macro_build (NULL , "vmandnot.mm" , "Vd,Vt,Vs" , vtemp , vm , vtemp );
2021- macro_build (NULL , "vmandnot.mm" , "Vd,Vt,Vs" , vd , vd , vm );
2022- macro_build (NULL , "vmor.mm" , "Vd,Vt,Vs" , vd , vtemp , vd );
2023- }
2024- }
2025- else if (vd != vm )
2026- {
2027- /* Masked. This may cause the vd overlaps vs2, when LMUL > 1. */
2028- macro_build (NULL , "vmsltu.vx" , "Vd,Vt,sVm" , vd , vs2 , vs1 , vm );
1994+ macro_build (NULL , vmslt_vx , "Vd,Vt,sVm" , vd , vs2 , vs1 , vm );
20291995 macro_build (NULL , "vmxor.mm" , "Vd,Vt,Vs" , vd , vd , vm );
20301996 }
20311997 else
@@ -2180,7 +2146,6 @@ macro (struct riscv_cl_insn *ip, expressionS *imm_expr,
21802146 break ;
21812147
21822148 case M_VMSGE :
2183- case M_VMSGEU :
21842149 vector_macro (ip );
21852150 break ;
21862151
0 commit comments