[v2,14/14] LoongArch: Allow ftintrz for DF->DI in loongarch32

Message ID 20230809115325.3716347-15-c@jia.je
State Unresolved
Headers
Series LoongArch: Add loongarch32 and ilp32 abi |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jiajie Chen Aug. 9, 2023, 11:46 a.m. UTC
  In LoongArch, signed DF->DI conversion can be done if -mfpu=64 and
-march=loongarch32.

gcc/ChangeLog:

	* config/loongarch/loongarch.md (fix_trunc*2): Use ANYFI instead
	of GPR because it depends on fpu width instead of target bits.
---
 gcc/config/loongarch/loongarch.md | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
index 31bdf3388f6..f6042af25b7 100644
--- a/gcc/config/loongarch/loongarch.md
+++ b/gcc/config/loongarch/loongarch.md
@@ -1482,11 +1482,11 @@ 
 
 ;; conversion of a floating-point value to a integer
 
-(define_insn "fix_trunc<ANYF:mode><GPR:mode>2"
-  [(set (match_operand:GPR 0 "register_operand" "=f")
-	(fix:GPR (match_operand:ANYF 1 "register_operand" "f")))]
+(define_insn "fix_trunc<ANYF:mode><ANYFI:mode>2"
+  [(set (match_operand:ANYFI 0 "register_operand" "=f")
+	(fix:ANYFI (match_operand:ANYF 1 "register_operand" "f")))]
   ""
-  "ftintrz.<GPR:ifmt>.<ANYF:fmt> %0,%1"
+  "ftintrz.<ANYFI:ifmt>.<ANYF:fmt> %0,%1"
   [(set_attr "type" "fcvt")
    (set_attr "mode" "<ANYF:MODE>")])