@@ -24335,11 +24335,12 @@
24335
24335
[(parallel [(set (match_operand:PTR 0 "memory_operand")
24336
24336
(unspec:PTR [(match_operand:PTR 1 "memory_operand")]
24337
24337
UNSPEC_SP_SET))
24338
- (set (match_operand:W 2 "general_reg_operand") (const_int 0))
24338
+ (set (match_operand 2 "general_reg_operand") (const_int 0))
24339
24339
(clobber (reg:CC FLAGS_REG))])
24340
24340
(set (match_operand 3 "general_reg_operand")
24341
24341
(match_operand 4 "const0_operand"))]
24342
- "GET_MODE_SIZE (GET_MODE (operands[3])) <= UNITS_PER_WORD
24342
+ "GET_MODE (operands[2]) == word_mode
24343
+ && GET_MODE_SIZE (GET_MODE (operands[3])) <= UNITS_PER_WORD
24343
24344
&& peep2_reg_dead_p (0, operands[3])
24344
24345
&& peep2_reg_dead_p (1, operands[2])"
24345
24346
[(parallel [(set (match_dup 0)
@@ -24395,11 +24396,12 @@
24395
24396
[(parallel [(set (match_operand:PTR 0 "memory_operand")
24396
24397
(unspec:PTR [(match_operand:PTR 1 "memory_operand")]
24397
24398
UNSPEC_SP_SET))
24398
- (set (match_operand:W 2 "general_reg_operand") (const_int 0))
24399
+ (set (match_operand 2 "general_reg_operand") (const_int 0))
24399
24400
(clobber (reg:CC FLAGS_REG))])
24400
24401
(set (match_operand:SWI48 3 "general_reg_operand")
24401
24402
(match_operand:SWI48 4 "general_gr_operand"))]
24402
- "peep2_reg_dead_p (0, operands[3])
24403
+ "GET_MODE (operands[2]) == word_mode
24404
+ && peep2_reg_dead_p (0, operands[3])
24403
24405
&& peep2_reg_dead_p (1, operands[2])"
24404
24406
[(parallel [(set (match_dup 0)
24405
24407
(unspec:PTR [(match_dup 1)] UNSPEC_SP_SET))
24411
24413
(parallel [(set (match_operand:PTR 0 "memory_operand")
24412
24414
(unspec:PTR [(match_operand:PTR 1 "memory_operand")]
24413
24415
UNSPEC_SP_SET))
24414
- (set (match_operand:W 2 "general_reg_operand") (const_int 0))
24416
+ (set (match_operand 2 "general_reg_operand") (const_int 0))
24415
24417
(clobber (reg:CC FLAGS_REG))])]
24416
- "peep2_reg_dead_p (0, operands[3])
24418
+ "GET_MODE (operands[2]) == word_mode
24419
+ && peep2_reg_dead_p (0, operands[3])
24417
24420
&& peep2_reg_dead_p (2, operands[2])
24418
24421
&& !reg_mentioned_p (operands[3], operands[0])
24419
24422
&& !reg_mentioned_p (operands[3], operands[1])"
@@ -24448,16 +24451,71 @@
24448
24451
[(parallel [(set (match_operand:PTR 0 "memory_operand")
24449
24452
(unspec:PTR [(match_operand:PTR 1 "memory_operand")]
24450
24453
UNSPEC_SP_SET))
24451
- (set (match_operand:W 2 "general_reg_operand") (const_int 0))
24454
+ (set (match_operand 2 "general_reg_operand") (const_int 0))
24452
24455
(clobber (reg:CC FLAGS_REG))])
24453
24456
(set (match_operand:SWI48 3 "general_reg_operand")
24454
24457
(match_operand:SWI48 4 "address_no_seg_operand"))]
24455
- "peep2_reg_dead_p (0, operands[3])
24458
+ "GET_MODE (operands[2]) == word_mode
24459
+ && peep2_reg_dead_p (0, operands[3])
24456
24460
&& peep2_reg_dead_p (1, operands[2])"
24457
24461
[(parallel [(set (match_dup 0)
24458
24462
(unspec:PTR [(match_dup 1)] UNSPEC_SP_SET))
24459
24463
(set (match_dup 3) (match_dup 4))])])
24460
24464
24465
+ (define_insn "*stack_protect_set_4z_<mode>_di"
24466
+ [(set (match_operand:PTR 0 "memory_operand" "=m")
24467
+ (unspec:PTR [(match_operand:PTR 3 "memory_operand" "m")]
24468
+ UNSPEC_SP_SET))
24469
+ (set (match_operand:DI 1 "register_operand" "=&r")
24470
+ (zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm")))]
24471
+ "TARGET_64BIT && reload_completed"
24472
+ {
24473
+ output_asm_insn ("mov{<imodesuffix>}\t{%3, %<k>1|%<k>1, %3}", operands);
24474
+ output_asm_insn ("mov{<imodesuffix>}\t{%<k>1, %0|%0, %<k>1}", operands);
24475
+ if (ix86_use_lea_for_mov (insn, operands + 1))
24476
+ return "lea{l}\t{%E2, %k1|%k1, %E2}";
24477
+ else
24478
+ return "mov{l}\t{%2, %k1|%k1, %2}";
24479
+ }
24480
+ [(set_attr "type" "multi")
24481
+ (set_attr "length" "24")])
24482
+
24483
+ (define_insn "*stack_protect_set_4s_<mode>_di"
24484
+ [(set (match_operand:PTR 0 "memory_operand" "=m,m")
24485
+ (unspec:PTR [(match_operand:PTR 3 "memory_operand" "m,m")]
24486
+ UNSPEC_SP_SET))
24487
+ (set (match_operand:DI 1 "register_operand" "=&a,&r")
24488
+ (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "0,rm")))]
24489
+ "TARGET_64BIT && reload_completed"
24490
+ {
24491
+ output_asm_insn ("mov{<imodesuffix>}\t{%3, %<k>1|%<k>1, %3}", operands);
24492
+ output_asm_insn ("mov{<imodesuffix>}\t{%<k>1, %0|%0, %<k>1}", operands);
24493
+ if (which_alternative)
24494
+ return "movs{lq|x}\t{%2, %1|%1, %2}";
24495
+ else
24496
+ return "{cltq|cdqe}";
24497
+ }
24498
+ [(set_attr "type" "multi")
24499
+ (set_attr "length" "24")])
24500
+
24501
+ (define_peephole2
24502
+ [(parallel [(set (match_operand:PTR 0 "memory_operand")
24503
+ (unspec:PTR [(match_operand:PTR 1 "memory_operand")]
24504
+ UNSPEC_SP_SET))
24505
+ (set (match_operand 2 "general_reg_operand") (const_int 0))
24506
+ (clobber (reg:CC FLAGS_REG))])
24507
+ (set (match_operand:DI 3 "general_reg_operand")
24508
+ (any_extend:DI
24509
+ (match_operand:SI 4 "nonimmediate_gr_operand")))]
24510
+ "TARGET_64BIT
24511
+ && GET_MODE (operands[2]) == word_mode
24512
+ && peep2_reg_dead_p (0, operands[3])
24513
+ && peep2_reg_dead_p (1, operands[2])"
24514
+ [(parallel [(set (match_dup 0)
24515
+ (unspec:PTR [(match_dup 1)] UNSPEC_SP_SET))
24516
+ (set (match_dup 3)
24517
+ (any_extend:DI (match_dup 4)))])])
24518
+
24461
24519
(define_expand "stack_protect_test"
24462
24520
[(match_operand 0 "memory_operand")
24463
24521
(match_operand 1 "memory_operand")
0 commit comments