[(set_attr "type" "neon_minmax<q>")]
)
-(define_insn "*smin<mode>3_neon"
- [(set (match_operand:VDQW 0 "s_register_operand" "=w")
- (smin:VDQW (match_operand:VDQW 1 "s_register_operand" "w")
- (match_operand:VDQW 2 "s_register_operand" "w")))]
- "TARGET_NEON"
+(define_insn "*smin<VDQWH:mode>3_neon"
+ [(set (match_operand:VDQWH 0 "s_register_operand" "=w")
+ (smin:VDQWH (match_operand:VDQWH 1 "s_register_operand" "w")
+ (match_operand:VDQWH 2 "s_register_operand" "w")))]
+ "ARM_HAVE_NEON_<MODE>_ARITH"
"vmin.<V_s_elem>\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
[(set (attr "type")
(if_then_else (match_test "<Is_float_mode>")
(const_string "neon_minmax<q>")))]
)
-(define_insn "*smax<mode>3_neon"
- [(set (match_operand:VDQW 0 "s_register_operand" "=w")
- (smax:VDQW (match_operand:VDQW 1 "s_register_operand" "w")
- (match_operand:VDQW 2 "s_register_operand" "w")))]
- "TARGET_NEON"
+(define_insn "*smax<VDQWH:mode>3_neon"
+ [(set (match_operand:VDQWH 0 "s_register_operand" "=w")
+ (smax:VDQWH (match_operand:VDQWH 1 "s_register_operand" "w")
+ (match_operand:VDQWH 2 "s_register_operand" "w")))]
+ "ARM_HAVE_NEON_<MODE>_ARITH"
"vmax.<V_s_elem>\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
[(set (attr "type")
(if_then_else (match_test "<Is_float_mode>")
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_2a_fp16_neon_ok } */
+/* { dg-add-options arm_v8_2a_fp16_neon } */
+/* { dg-additional-options "-std=c23 -Ofast" } */
+void foo(void);
+extern _Float16 main_in[];
+void bar() {
+ _Float16 out = 0.0;
+ for (int i = 0; i < 100; i++)
+ if (out < main_in[i])
+ out = main_in[i];
+ if (out)
+ foo();
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_2a_fp16_neon_ok } */
+/* { dg-add-options arm_v8_2a_fp16_neon } */
+/* { dg-additional-options "-std=c23 -Ofast" } */
+void foo(void);
+extern _Float16 main_in[];
+void bar() {
+ _Float16 out = 0.0;
+ for (int i = 0; i < 100; i++)
+ if (out > main_in[i])
+ out = main_in[i];
+ if (out)
+ foo();
+}