Merge pull request #3496 from yuanhec/develop

Fixed MSA enabled optimization on Loongson-3A4000
This commit is contained in:
Martin Kroeker 2021-12-28 18:51:56 +01:00 committed by GitHub
commit a06b4aff52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -165,7 +165,7 @@ void get_cpuconfig(void){
}else{ }else{
printf("#define UNKNOWN\n"); printf("#define UNKNOWN\n");
} }
if (!get_feature(msa)) printf("#define NO_MSA\n"); if (!get_feature("msa")) printf("#define NO_MSA\n");
} }
void get_libname(void){ void get_libname(void){
@ -193,7 +193,7 @@ int get_feature(char *search)
while (fgets(buffer, sizeof(buffer), infile)) while (fgets(buffer, sizeof(buffer), infile))
{ {
if (!strncmp("Features", buffer, 8)) if (!strncmp("Features", buffer, 8) || !strncmp("ASEs implemented", buffer, 16))
{ {
p = strchr(buffer, ':') + 2; p = strchr(buffer, ':') + 2;
break; break;
@ -207,7 +207,7 @@ int get_feature(char *search)
t = strtok(p," "); t = strtok(p," ");
while( t = strtok(NULL," ")) while( t = strtok(NULL," "))
{ {
if (!strcmp(t, search)) { return(1); } if (strstr(t, search)) { return(1); }
} }
#endif #endif

View File

@ -201,7 +201,7 @@ void get_cpuconfig(void){
printf("#define DTB_SIZE 4096\n"); printf("#define DTB_SIZE 4096\n");
printf("#define L2_ASSOCIATIVE 8\n"); printf("#define L2_ASSOCIATIVE 8\n");
} }
if (!get_feature(msa)) printf("#define NO_MSA\n"); if (!get_feature("msa")) printf("#define NO_MSA\n");
} }
void get_libname(void){ void get_libname(void){
@ -233,7 +233,7 @@ int get_feature(char *search)
while (fgets(buffer, sizeof(buffer), infile)) while (fgets(buffer, sizeof(buffer), infile))
{ {
if (!strncmp("Features", buffer, 8)) if (!strncmp("Features", buffer, 8) || !strncmp("ASEs implemented", buffer, 16))
{ {
p = strchr(buffer, ':') + 2; p = strchr(buffer, ':') + 2;
break; break;
@ -247,7 +247,7 @@ int get_feature(char *search)
t = strtok(p," "); t = strtok(p," ");
while( t = strtok(NULL," ")) while( t = strtok(NULL," "))
{ {
if (!strcmp(t, search)) { return(1); } if (strstr(t, search)) { return(1); }
} }
#endif #endif