Skip to content

Commit f70b5db

Browse files
ChenghuaXuChenghua Xu
authored andcommitted
Fix some typo and brain twister logical.
gcc/ * config/mips/mips.c: Fix typo in documentation of mips_loongson_ext2_prefetch_cookie. (mips_option_override): fix brain twister logical. * config/mips/mips.h: Fix typo in documentation of ISA_HAS_CTZ_CTO and define pattern. * config/mips/mips.md (prefetch): Hoist EXT2 above the 2EF/EXT block. (prefetch_indexed): Hoist EXT2 above the EXT block. gcc/testsuite/ * gcc.target/mips/loongson-ctz.c: Fix typo. * gcc.target/mips/loongson-dctz.c: Fix typo. From-SVN: r265871
1 parent 36b56cd commit f70b5db

File tree

7 files changed

+38
-22
lines changed

7 files changed

+38
-22
lines changed

gcc/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2018-11-07 Chenghua Xu <[email protected]>
2+
3+
* config/mips/mips.c: Fix typo in documentation of
4+
mips_loongson_ext2_prefetch_cookie.
5+
(mips_option_override): fix brain twister logical.
6+
* config/mips/mips.h: Fix typo in documentation of
7+
ISA_HAS_CTZ_CTO and define pattern.
8+
* config/mips/mips.md (prefetch): Hoist EXT2 above
9+
the 2EF/EXT block.
10+
(prefetch_indexed): Hoist EXT2 above the EXT block.
11+
112
2018-11-07 Jan Hubicka <[email protected]>
213

314
* tree.c (free_lang_data_in_type): Add fld parameter; simplify

gcc/config/mips/mips.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15151,7 +15151,7 @@ mips_prefetch_cookie (rtx write, rtx locality)
1515115151
return GEN_INT (INTVAL (write) + 6);
1515215152
}
1515315153

15154-
/* Loongson EXT2 only implements perf hint=0 (prefetch for load) and hint=1
15154+
/* Loongson EXT2 only implements pref hint=0 (prefetch for load) and hint=1
1515515155
(prefetch for store), other hint just scale to hint = 0 and hint = 1. */
1515615156

1515715157
rtx
@@ -20202,7 +20202,7 @@ mips_option_override (void)
2020220202
is true. If a user explicitly says -mloongson-ext2 -mno-loongson-ext
2020320203
then that is an error. */
2020420204
if (!TARGET_LOONGSON_EXT
20205-
&& !((target_flags_explicit & MASK_LOONGSON_EXT) == 0))
20205+
&& (target_flags_explicit & MASK_LOONGSON_EXT) != 0)
2020620206
error ("%<-mloongson-ext2%> must be used with %<-mloongson-ext%>");
2020720207
target_flags |= MASK_LOONGSON_EXT;
2020820208
}

gcc/config/mips/mips.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ struct mips_cpu_info {
11581158
/* ISA has count leading zeroes/ones instruction (not implemented). */
11591159
#define ISA_HAS_CLZ_CLO (mips_isa_rev >= 1 && !TARGET_MIPS16)
11601160

1161-
/* ISA has count tailing zeroes/ones instruction. */
1161+
/* ISA has count trailing zeroes/ones instruction. */
11621162
#define ISA_HAS_CTZ_CTO (TARGET_LOONGSON_EXT2)
11631163

11641164
/* ISA has three operand multiply instructions that put

gcc/config/mips/mips.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3153,7 +3153,7 @@
31533153
;;
31543154
;; ...................
31553155
;;
3156-
;; Count tailing zeroes.
3156+
;; Count trailing zeroes.
31573157
;;
31583158
;; ...................
31593159
;;
@@ -7157,21 +7157,21 @@
71577157
(match_operand 2 "const_int_operand" "n"))]
71587158
"ISA_HAS_PREFETCH && TARGET_EXPLICIT_RELOCS"
71597159
{
7160-
if (TARGET_LOONGSON_2EF || TARGET_LOONGSON_EXT || TARGET_LOONGSON_EXT2)
7160+
if (TARGET_LOONGSON_2EF || TARGET_LOONGSON_EXT)
71617161
{
7162-
/* Loongson ext2 implementation pref insnstructions. */
7163-
if (TARGET_LOONGSON_EXT2)
7164-
{
7165-
operands[1] = mips_loongson_ext2_prefetch_cookie (operands[1],
7166-
operands[2]);
7167-
return "pref\t%1, %a0";
7168-
}
71697162
/* Loongson 2[ef] and Loongson ext use load to $0 for prefetching. */
71707163
if (TARGET_64BIT)
71717164
return "ld\t$0,%a0";
71727165
else
71737166
return "lw\t$0,%a0";
71747167
}
7168+
/* Loongson ext2 implementation pref instructions. */
7169+
if (TARGET_LOONGSON_EXT2)
7170+
{
7171+
operands[1] = mips_loongson_ext2_prefetch_cookie (operands[1],
7172+
operands[2]);
7173+
return "pref\t%1, %a0";
7174+
}
71757175
operands[1] = mips_prefetch_cookie (operands[1], operands[2]);
71767176
return "pref\t%1,%a0";
71777177
}
@@ -7184,21 +7184,21 @@
71847184
(match_operand 3 "const_int_operand" "n"))]
71857185
"ISA_HAS_PREFETCHX && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
71867186
{
7187-
if (TARGET_LOONGSON_EXT || TARGET_LOONGSON_EXT2)
7187+
if (TARGET_LOONGSON_EXT)
71887188
{
7189-
/* Loongson ext2 implementation pref insnstructions. */
7190-
if (TARGET_LOONGSON_EXT2)
7191-
{
7192-
operands[2] = mips_loongson_ext2_prefetch_cookie (operands[2],
7193-
operands[3]);
7194-
return "prefx\t%2,%1(%0)";
7195-
}
71967189
/* Loongson Loongson ext use index load to $0 for prefetching. */
71977190
if (TARGET_64BIT)
71987191
return "gsldx\t$0,0(%0,%1)";
71997192
else
72007193
return "gslwx\t$0,0(%0,%1)";
72017194
}
7195+
/* Loongson ext2 implementation pref instructions. */
7196+
if (TARGET_LOONGSON_EXT2)
7197+
{
7198+
operands[2] = mips_loongson_ext2_prefetch_cookie (operands[2],
7199+
operands[3]);
7200+
return "prefx\t%2,%1(%0)";
7201+
}
72027202
operands[2] = mips_prefetch_cookie (operands[2], operands[3]);
72037203
return "prefx\t%2,%1(%0)";
72047204
}

gcc/testsuite/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2018-11-07 Chenghua Xu <[email protected]>
2+
3+
* gcc.target/mips/loongson-ctz.c: Fix typo.
4+
* gcc.target/mips/loongson-dctz.c: Fix typo.
5+
16
2018-11-07 Jan Hubicka <[email protected]>
27

38
* g++.dg/lto/odr-1_1.C: Fix template.

gcc/testsuite/gcc.target/mips/loongson-ctz.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Test cases for Loongson EXT2 instrutions. */
1+
/* Test cases for Loongson EXT2 instructions. */
22

33
/* { dg-do compile } */
44
/* { dg-options "-mloongson-ext2" } */

gcc/testsuite/gcc.target/mips/loongson-dctz.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Test cases for Loongson EXT2 instrutions. */
1+
/* Test cases for Loongson EXT2 instructions. */
22

33
/* { dg-do compile } */
44
/* { dg-options "-mloongson-ext2" } */

0 commit comments

Comments
 (0)