aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorXianmiao Qu <cooper.qu@linux.alibaba.com>2023-01-10 21:48:15 +0800
committerXianmiao Qu <cooper.qu@linux.alibaba.com>2023-01-10 19:57:21 +0800
commit8f3b032e57ded80f6b773672b36def28b3e7ec50 (patch)
treeb791c08c34ef8267bafb0206f4d1c4bf7dadd64a /gcc
parentb86703a050c61d0dc81410de707b078a27ce4732 (diff)
downloadgcc-8f3b032e57ded80f6b773672b36def28b3e7ec50.zip
gcc-8f3b032e57ded80f6b773672b36def28b3e7ec50.tar.gz
gcc-8f3b032e57ded80f6b773672b36def28b3e7ec50.tar.bz2
C-SKY: Fix patterns' condition for ck802 smart mode.
Ck802 smart mode should not be treated as ck801. It do only allocate r0-r8 registers like ck801, but support 32-bits intructions. This bug will cause ICE when compiler pr43164.c for ck802 big-endian, /src/gcc/gcc/testsuite/gcc.c-torture/compile/pr43164.c:16:1: error: insn does not satisfy its constraints: (insn 48 28 30 2 (set (reg:SI 0 a0 [230]) (ior:SI (reg:SI 2 a2 [222]) (ashift:SI (const_int 1 [0x1]) (const_int 24 [0x18])))) "/src/gcc/gcc/testsuite/gcc.c-torture/compile/pr43164.c":15:10 224 {smart_bseti} (expr_list:REG_DEAD (reg:SI 2 a2 [222]) (nil))) gcc/ * config/csky/csky.md (smart_bseti): Change condition to CSKY_ISA_FEATURE (E1). (smart_bclri): Likewise. (fast_bseti): Change condition to CSKY_ISA_FEATURE (E2). (fast_bclri): Likewise. (fast_cmpnesi_i): Likewise. (*fast_cmpltsi_i): Likewise. (*fast_cmpgeusi_i): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/csky/csky.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/config/csky/csky.md b/gcc/config/csky/csky.md
index d7bafdb..8fb832f 100644
--- a/gcc/config/csky/csky.md
+++ b/gcc/config/csky/csky.md
@@ -573,7 +573,7 @@
(ior:SI (match_operand:SI 1 "register_operand" "0")
(ashift:SI (const_int 1)
(match_operand:SI 2 "csky_literal_K_operand" "K"))))]
- "TARGET_MINI_REGISTERS"
+ "CSKY_ISA_FEATURE (E1)"
"bseti\t%0, %2"
[(set_attr "length" "2")])
@@ -582,7 +582,7 @@
(ior:SI (match_operand:SI 1 "register_operand" "0,r")
(ashift:SI (const_int 1)
(match_operand:SI 2 "csky_literal_K_operand" "K,K"))))]
- "!TARGET_MINI_REGISTERS"
+ "CSKY_ISA_FEATURE (E2)"
"bseti\t%0, %1, %2"
[(set_attr "length" "2,4")])
@@ -599,7 +599,7 @@
(and:SI (match_operand:SI 1 "register_operand" "0")
(not:SI (ashift:SI (const_int 1)
(match_operand:SI 2 "csky_literal_K_operand" "K")))))]
- "TARGET_MINI_REGISTERS"
+ "CSKY_ISA_FEATURE (E1)"
"bclri\t%0, %2"
[(set_attr "length" "2")])
@@ -608,7 +608,7 @@
(and:SI (match_operand:SI 1 "register_operand" "0,r")
(not:SI (ashift:SI (const_int 1)
(match_operand:SI 2 "csky_literal_K_operand" "K,K")))))]
- "!TARGET_MINI_REGISTERS"
+ "CSKY_ISA_FEATURE (E2)"
"bclri\t%0, %1, %2"
[(set_attr "length" "2,4")])
@@ -3014,7 +3014,7 @@
[(set (reg:CC CSKY_CC_REGNUM)
(ne:CC (match_operand:SI 0 "register_operand" "r")
(match_operand:SI 1 "csky_literal_I_operand" "I")))]
- "!TARGET_MINI_REGISTERS && CSKY_ISA_FEATURE (E2)"
+ "CSKY_ISA_FEATURE (E2)"
"cmpnei\t%0, %1"
[(set_attr "type" "cmp")]
)
@@ -3056,7 +3056,7 @@
[(set (reg:CC CSKY_CC_REGNUM)
(lt:CC (match_operand:SI 0 "register_operand" "a,r")
(match_operand:SI 1 "csky_literal_Uk_operand" "J,Uk")))]
- "!TARGET_MINI_REGISTERS && CSKY_ISA_FEATURE (E2)"
+ "CSKY_ISA_FEATURE (E2)"
"cmplti\t%0, %1"
[(set_attr "length" "2,4")
(set_attr "type" "cmp")]
@@ -3149,7 +3149,7 @@
[(set (reg:CC CSKY_CC_REGNUM)
(geu:CC (match_operand:SI 0 "register_operand" "a,r")
(match_operand:SI 1 "csky_literal_Uk_operand" "J,Uk")))]
- "!TARGET_MINI_REGISTERS && CSKY_ISA_FEATURE (E2)"
+ "CSKY_ISA_FEATURE (E2)"
"cmphsi\t%0, %1"
[(set_attr "length" "2,4")
(set_attr "type" "cmp")]