} "-flto -fuse-linker-plugin"]
}
-# Return 1 if the target supports executing 750CL paired-single instructions, 0
-# otherwise. Cache the result.
-
-proc check_750cl_hw_available { } {
- return [check_cached_effective_target 750cl_hw_available {
- # If this is not the right target then we can skip the test.
- if { ![istarget powerpc-*paired*] } {
- expr 0
- } else {
- check_runtime_nocache 750cl_hw_available {
- int main()
- {
- #ifdef __MACH__
- asm volatile ("ps_mul v0,v0,v0");
- #else
- asm volatile ("ps_mul 0,0,0");
- #endif
- return 0;
- }
- } "-mpaired"
- }
- }]
-}
-
# Return 1 if the target OS supports running SSE executables, 0
# otherwise. Cache the result.
unsigned int eax, edx;
asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
- return (eax & 6) != 6;
+ return (eax & 0x06) != 0x06;
}
} ""
}
int main ()
{
unsigned int eax, ebx, ecx, edx;
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return !(edx & bit_SSE);
- return 1;
- }
- } ""
- }
- }]
-}
-
-# Return 1 if the target supports executing MIPS Paired-Single instructions,
-# 0 otherwise. Cache the result.
-
-proc check_mpaired_single_hw_available { } {
- return [check_cached_effective_target mpaired_single_hw_available {
- # If this is not the right target then we can skip the test.
- if { !([istarget mips*-*-*]) } {
- expr 0
- } else {
- check_runtime_nocache mpaired_single_hw_available {
- int main()
- {
- asm volatile ("pll.ps $f2,$f4,$f6");
- return 0;
- }
- } ""
- }
- }]
-}
-
-# Return 1 if the target supports executing Loongson vector instructions,
-# 0 otherwise. Cache the result.
+ if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return 1;
-proc check_mips_loongson_hw_available { } {
- return [check_cached_effective_target mips_loongson_hw_available {
- # If this is not the right target then we can skip the test.
- if { !([istarget mips*-*-*]) } {
- expr 0
- } else {
- check_runtime_nocache mips_loongson_hw_available {
- #include <loongson.h>
- int main()
- {
- asm volatile ("paddw $f2,$f4,$f6");
- return 0;
- }
+ return !(edx & bit_SSE);
+ }
} ""
}
}]
}
-# Return 1 if the target supports executing MIPS MSA instructions, 0
-# otherwise. Cache the result.
-
-proc check_mips_msa_hw_available { } {
- return [check_cached_effective_target mips_msa_hw_available {
- # If this is not the right target then we can skip the test.
- if { !([istarget mips*-*-*]) } {
- expr 0
- } else {
- check_runtime_nocache mips_msa_hw_available {
- #if !defined(__mips_msa)
- #error "MSA NOT AVAIL"
- #else
- #if !(((__mips == 64) || (__mips == 32)) && (__mips_isa_rev >= 2))
- #error "MSA NOT AVAIL FOR ISA REV < 2"
- #endif
- #if !defined(__mips_hard_float)
- #error "MSA HARD_FLOAT REQUIRED"
- #endif
- #if __mips_fpr != 64
- #error "MSA 64-bit FPR REQUIRED"
- #endif
- #include <msa.h>
-
- int main()
- {
- v8i16 v = __builtin_msa_ldi_h (0);
- v[0] = 0;
- return v[0];
- }
- #endif
- } "-mmsa"
- }
- }]
-}
-
# Return 1 if the target supports executing SSE2 instructions, 0
# otherwise. Cache the result.
int main ()
{
unsigned int eax, ebx, ecx, edx;
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return !(edx & bit_SSE2);
- return 1;
+ if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return 1;
+
+ return !(edx & bit_SSE2);
}
} ""
}
int main ()
{
unsigned int eax, ebx, ecx, edx;
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return !(ecx & bit_SSE4_2);
- return 1;
+ if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return 1;
+
+ return !(ecx & bit_SSE4_2);
}
} ""
}
int main ()
{
unsigned int eax, ebx, ecx, edx;
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return ((ecx & (bit_AVX | bit_OSXSAVE))
- != (bit_AVX | bit_OSXSAVE));
- return 1;
+ if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return 1;
+
+ return ((ecx & (bit_AVX | bit_OSXSAVE))
+ != (bit_AVX | bit_OSXSAVE));
}
} ""
}
int main ()
{
unsigned int eax, ebx, ecx, edx;
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)
- || ((ecx & bit_OSXSAVE) != bit_OSXSAVE))
- return 1;
if (__get_cpuid_max (0, NULL) < 7)
return 1;
+ __cpuid (1, eax, ebx, ecx, edx);
+
+ if (!(ecx & bit_OSXSAVE))
+ return 1;
+
__cpuid_count (7, 0, eax, ebx, ecx, edx);
- return (ebx & bit_AVX2) != bit_AVX2;
+ return !(ebx & bit_AVX2);
}
} ""
}
int main ()
{
unsigned int eax, ebx, ecx, edx;
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)
- || !(ecx & bit_OSXSAVE))
- return 1;
if (__get_cpuid_max (0, NULL) < 7)
return 1;
+ __cpuid (1, eax, ebx, ecx, edx);
+
+ if (!(ecx & bit_OSXSAVE))
+ return 1;
+
__cpuid_count (7, 0, eax, ebx, ecx, edx);
return !(ebx & bit_AVX512F);
return 0
}
-# Return 1 if the target supports running MIPS Paired-Single
-# executables, 0 otherwise.
-
-proc check_effective_target_mpaired_single_runtime { } {
- if { [check_effective_target_mpaired_single]
- && [check_mpaired_single_hw_available] } {
- return 1
- }
- return 0
-}
-
-# Return 1 if the target supports running Loongson executables, 0 otherwise.
-
-proc check_effective_target_mips_loongson_runtime { } {
- if { [check_effective_target_mips_loongson]
- && [check_mips_loongson_hw_available] } {
- return 1
- }
- return 0
-}
-
-# Return 1 if the target supports running MIPS MSA executables, 0 otherwise.
-
-proc check_effective_target_mips_msa_runtime { } {
- if { [check_effective_target_mips_msa]
- && [check_mips_msa_hw_available] } {
- return 1
- }
- return 0
-}
-
# Return 1 if the target supports running AVX executables, 0 otherwise.
proc check_effective_target_avx_runtime { } {
return 0
}
+# Return 1 if the target supports executing MIPS Paired-Single instructions,
+# 0 otherwise. Cache the result.
+
+proc check_mpaired_single_hw_available { } {
+ return [check_cached_effective_target mpaired_single_hw_available {
+ # If this is not the right target then we can skip the test.
+ if { !([istarget mips*-*-*]) } {
+ expr 0
+ } else {
+ check_runtime_nocache mpaired_single_hw_available {
+ int main()
+ {
+ asm volatile ("pll.ps $f2,$f4,$f6");
+ return 0;
+ }
+ } ""
+ }
+ }]
+}
+
+# Return 1 if the target supports executing Loongson vector instructions,
+# 0 otherwise. Cache the result.
+
+proc check_mips_loongson_hw_available { } {
+ return [check_cached_effective_target mips_loongson_hw_available {
+ # If this is not the right target then we can skip the test.
+ if { !([istarget mips*-*-*]) } {
+ expr 0
+ } else {
+ check_runtime_nocache mips_loongson_hw_available {
+ #include <loongson.h>
+ int main()
+ {
+ asm volatile ("paddw $f2,$f4,$f6");
+ return 0;
+ }
+ } ""
+ }
+ }]
+}
+
+# Return 1 if the target supports executing MIPS MSA instructions, 0
+# otherwise. Cache the result.
+
+proc check_mips_msa_hw_available { } {
+ return [check_cached_effective_target mips_msa_hw_available {
+ # If this is not the right target then we can skip the test.
+ if { !([istarget mips*-*-*]) } {
+ expr 0
+ } else {
+ check_runtime_nocache mips_msa_hw_available {
+ #if !defined(__mips_msa)
+ #error "MSA NOT AVAIL"
+ #else
+ #if !(((__mips == 64) || (__mips == 32)) && (__mips_isa_rev >= 2))
+ #error "MSA NOT AVAIL FOR ISA REV < 2"
+ #endif
+ #if !defined(__mips_hard_float)
+ #error "MSA HARD_FLOAT REQUIRED"
+ #endif
+ #if __mips_fpr != 64
+ #error "MSA 64-bit FPR REQUIRED"
+ #endif
+ #include <msa.h>
+
+ int main()
+ {
+ v8i16 v = __builtin_msa_ldi_h (0);
+ v[0] = 0;
+ return v[0];
+ }
+ #endif
+ } "-mmsa"
+ }
+ }]
+}
+
+# Return 1 if the target supports running MIPS Paired-Single
+# executables, 0 otherwise.
+
+proc check_effective_target_mpaired_single_runtime { } {
+ if { [check_effective_target_mpaired_single]
+ && [check_mpaired_single_hw_available] } {
+ return 1
+ }
+ return 0
+}
+
+# Return 1 if the target supports running Loongson executables, 0 otherwise.
+
+proc check_effective_target_mips_loongson_runtime { } {
+ if { [check_effective_target_mips_loongson]
+ && [check_mips_loongson_hw_available] } {
+ return 1
+ }
+ return 0
+}
+
+# Return 1 if the target supports running MIPS MSA executables, 0 otherwise.
+
+proc check_effective_target_mips_msa_runtime { } {
+ if { [check_effective_target_mips_msa]
+ && [check_mips_msa_hw_available] } {
+ return 1
+ }
+ return 0
+}
+
# Return 1 if we are compiling for 64-bit PowerPC but we do not use direct
# move instructions for moves from GPR to FPR.
}]
}
+# Return 1 if the target supports executing 750CL paired-single instructions, 0
+# otherwise. Cache the result.
+
+proc check_750cl_hw_available { } {
+ return [check_cached_effective_target 750cl_hw_available {
+ # If this is not the right target then we can skip the test.
+ if { ![istarget powerpc-*paired*] } {
+ expr 0
+ } else {
+ check_runtime_nocache 750cl_hw_available {
+ int main()
+ {
+ #ifdef __MACH__
+ asm volatile ("ps_mul v0,v0,v0");
+ #else
+ asm volatile ("ps_mul 0,0,0");
+ #endif
+ return 0;
+ }
+ } "-mpaired"
+ }
+ }]
+}
+
# Return 1 if the target supports executing power8 vector instructions, 0
# otherwise. Cache the result.