Skip to content

Commit eb5f0c7

Browse files
author
Christophe Lyon
committed
arm: [MVE intrinsics] rework uqrshll uqrshll_sat48
Implement uqrshll and uqrshll_sat48 using the new MVE builtins framework. gcc/ChangeLog: * config/arm/arm-mve-builtins-base.cc (enum which_scalar_shift): Add ss_UQRSHLL, ss_UQRSHLL_SAT48. (mve_function_scalar_shift): Add support for ss_UQRSHLL, ss_UQRSHLL_SAT48. * config/arm/arm-mve-builtins-base.def (uqrshll, uqrshll_sat48): New. * config/arm/arm-mve-builtins-base.h (uqrshll, uqrshll_sat48): New. * config/arm/arm_mve.h (uqrshll): Delete. (uqrshll_sat48): Delete. (__arm_uqrshll): Delete. (__arm_uqrshll_sat48): Delete. * config/arm/mve.md (mve_uqrshll_sat<supf>_di): Add '@' prefix.
1 parent e0b23a9 commit eb5f0c7

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

gcc/config/arm/arm-mve-builtins-base.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,8 @@ class vld24_impl : public full_width_access
11721172
enum which_scalar_shift {
11731173
ss_ASRL,
11741174
ss_LSLL,
1175+
ss_UQRSHLL,
1176+
ss_UQRSHLL_SAT48,
11751177
};
11761178

11771179
class mve_function_scalar_shift : public function_base
@@ -1201,6 +1203,14 @@ class mve_function_scalar_shift : public function_base
12011203
code = CODE_FOR_mve_lsll;
12021204
break;
12031205

1206+
case ss_UQRSHLL:
1207+
code = code_for_mve_uqrshll_sat_di (UQRSHLL_64);
1208+
break;
1209+
1210+
case ss_UQRSHLL_SAT48:
1211+
code = code_for_mve_uqrshll_sat_di (UQRSHLL_48);
1212+
break;
1213+
12041214
default:
12051215
gcc_unreachable ();
12061216
}
@@ -1397,6 +1407,8 @@ namespace arm_mve {
13971407

13981408
FUNCTION (asrl, mve_function_scalar_shift, (ss_ASRL))
13991409
FUNCTION (lsll, mve_function_scalar_shift, (ss_LSLL))
1410+
FUNCTION (uqrshll, mve_function_scalar_shift, (ss_UQRSHLL))
1411+
FUNCTION (uqrshll_sat48, mve_function_scalar_shift, (ss_UQRSHLL_SAT48))
14001412
FUNCTION_PRED_P_S_U (vabavq, VABAVQ)
14011413
FUNCTION_WITHOUT_N (vabdq, VABDQ)
14021414
FUNCTION (vabsq, unspec_based_mve_function_exact_insn, (ABS, ABS, ABS, -1, -1, -1, VABSQ_M_S, -1, VABSQ_M_F, -1, -1, -1))

gcc/config/arm/arm-mve-builtins-base.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#define REQUIRES_FLOAT false
2121
DEF_MVE_FUNCTION (asrl, scalar_s64_shift, none, none)
2222
DEF_MVE_FUNCTION (lsll, scalar_u64_shift, none, none)
23+
DEF_MVE_FUNCTION (uqrshll, scalar_u64_shift, none, none)
24+
DEF_MVE_FUNCTION (uqrshll_sat48, scalar_u64_shift, none, none)
2325
DEF_MVE_FUNCTION (vabavq, binary_acca_int32, all_integer, p_or_none)
2426
DEF_MVE_FUNCTION (vabdq, binary, all_integer, mx_or_none)
2527
DEF_MVE_FUNCTION (vabsq, unary, all_signed, mx_or_none)

gcc/config/arm/arm-mve-builtins-base.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace functions {
2525

2626
extern const function_base *const asrl;
2727
extern const function_base *const lsll;
28+
extern const function_base *const uqrshll;
29+
extern const function_base *const uqrshll_sat48;
2830
extern const function_base *const vabavq;
2931
extern const function_base *const vabdq;
3032
extern const function_base *const vabsq;

gcc/config/arm/arm_mve.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@
8888
#define srshr(__p0, __p1) __arm_srshr(__p0, __p1)
8989
#define srshrl(__p0, __p1) __arm_srshrl(__p0, __p1)
9090
#define uqrshl(__p0, __p1) __arm_uqrshl(__p0, __p1)
91-
#define uqrshll(__p0, __p1) __arm_uqrshll(__p0, __p1)
92-
#define uqrshll_sat48(__p0, __p1) __arm_uqrshll_sat48(__p0, __p1)
9391
#define uqshl(__p0, __p1) __arm_uqshl(__p0, __p1)
9492
#define uqshll(__p0, __p1) __arm_uqshll(__p0, __p1)
9593
#define urshr(__p0, __p1) __arm_urshr(__p0, __p1)
@@ -244,20 +242,6 @@ __arm_vgetq_lane_u64 (uint64x2_t __a, const int __idx)
244242
return __a[__ARM_LANEQ(__a,__idx)];
245243
}
246244

247-
__extension__ extern __inline uint64_t
248-
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
249-
__arm_uqrshll (uint64_t value, int32_t shift)
250-
{
251-
return __builtin_mve_uqrshll_sat64_di (value, shift);
252-
}
253-
254-
__extension__ extern __inline uint64_t
255-
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
256-
__arm_uqrshll_sat48 (uint64_t value, int32_t shift)
257-
{
258-
return __builtin_mve_uqrshll_sat48_di (value, shift);
259-
}
260-
261245
__extension__ extern __inline int64_t
262246
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
263247
__arm_sqrshrl (int64_t value, int32_t shift)

gcc/config/arm/mve.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4278,7 +4278,7 @@
42784278
;;
42794279
;; [uqrshll_di]
42804280
;;
4281-
(define_insn "mve_uqrshll_sat<supf>_di"
4281+
(define_insn "@mve_uqrshll_sat<supf>_di"
42824282
[(set (match_operand:DI 0 "arm_low_register_operand" "=l")
42834283
(unspec:DI [(match_operand:DI 1 "arm_low_register_operand" "0")
42844284
(match_operand:SI 2 "register_operand" "r")]

0 commit comments

Comments
 (0)