"@internal"
(match_operand 0 "low_bitmask_operand"))
-(define_constraint "Yy"
- "@internal"
- (match_operand 0 "high_bitmask_operand"))
-
(define_constraint "YI"
"@internal
A replicated vector const in which the replicated value is in the range
[(set_attr "move_type" "pick_ins")
(set_attr "mode" "<MODE>")])
-(define_insn_and_split "and<mode>3_align"
- [(set (match_operand:GPR 0 "register_operand" "=r")
- (and:GPR (match_operand:GPR 1 "register_operand" "r")
- (match_operand:GPR 2 "high_bitmask_operand" "Yy")))]
- ""
- "#"
- ""
- [(set (match_dup 0) (match_dup 1))
- (set (zero_extract:GPR (match_dup 0) (match_dup 2) (const_int 0))
- (const_int 0))]
-{
- int len;
-
- len = low_bitmask_len (<MODE>mode, ~INTVAL (operands[2]));
- operands[2] = GEN_INT (len);
-})
-
(define_insn_and_split "*bstrins_<mode>_for_mask"
[(set (match_operand:GPR 0 "register_operand" "=r")
(and:GPR (match_operand:GPR 1 "register_operand" "r")
(and (match_code "const_int")
(match_test "low_bitmask_len (mode, INTVAL (op)) > 12")))
-(define_predicate "high_bitmask_operand"
- (and (match_code "const_int")
- (match_test "low_bitmask_len (mode, ~INTVAL (op)) > 0")))
-
(define_predicate "d_operand"
(and (match_code "reg")
(match_test "GP_REG_P (REGNO (op))")))
(define_predicate "ins_zero_bitmask_operand"
(and (match_code "const_int")
- (match_test "INTVAL (op) != -1")
- (match_test "INTVAL (op) & 1")
(match_test "low_bitmask_len (mode, \
~UINTVAL (op) | (~UINTVAL(op) - 1)) \
- > 12")))
+ > 0")
+ (not (match_operand 0 "const_uns_arith_operand"))))
(define_predicate "const_call_insn_operand"
(match_code "const,symbol_ref,label_ref")
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=loongarch64 -mabi=lp64d" } */
+/* { dg-final { scan-assembler "bstrins\\.d\t\\\$r4,\\\$r0,2,2" } } */
+
+long
+x (long a)
+{
+ return a & ~4;
+}