aarch64: Do not alter value on a force_reg returned rtx expanding __jcvt
authorAndrea Corallo <andrea.corallo@arm.com>
Thu, 17 Sep 2020 16:17:52 +0000 (17:17 +0100)
committerAndrea Corallo <andrea.corallo@arm.com>
Mon, 21 Sep 2020 12:09:17 +0000 (14:09 +0200)
2020-09-17  Andrea Corallo  <andrea.corallo@arm.com>

* config/aarch64/aarch64-builtins.c
(aarch64_general_expand_builtin): Use expand machinery not to
alter the value of an rtx returned by force_reg.

gcc/config/aarch64/aarch64-builtins.c

index 2f4753b25cc9ed8bf63a3d4a0e6b9e4f6f17b8ec..1cfb5c07d705057fe54739430abb2bba1307eadc 100644 (file)
@@ -2140,14 +2140,14 @@ aarch64_general_expand_builtin (unsigned int fcode, tree exp, rtx target,
       return target;
 
     case AARCH64_JSCVT:
-      arg0 = CALL_EXPR_ARG (exp, 0);
-      op0 = force_reg (DFmode, expand_normal (arg0));
-      if (!target)
-       target = gen_reg_rtx (SImode);
-      else
-       target = force_reg (SImode, target);
-      emit_insn (GEN_FCN (CODE_FOR_aarch64_fjcvtzs) (target, op0));
-      return target;
+      {
+       expand_operand ops[2];
+       create_output_operand (&ops[0], target, SImode);
+       op0 = expand_normal (CALL_EXPR_ARG (exp, 0));
+       create_input_operand (&ops[1], op0, DFmode);
+       expand_insn (CODE_FOR_aarch64_fjcvtzs, 2, ops);
+       return ops[0].value;
+      }
 
     case AARCH64_SIMD_BUILTIN_FCMLA_LANEQ0_V2SF:
     case AARCH64_SIMD_BUILTIN_FCMLA_LANEQ90_V2SF: