+2008-11-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/37812
+ * gcc.target/powerpc/altivec_check.h (altivec_cell_check): Abort
+ if __PPU__ isn't defined.
+ * lib/target-supports.exp (check_effective_target_powerpc_ppu_ok):
+ New.
+ * gcc.target/powerpc/altivec-cell-8.c: Use powerpc_ppu_ok.
+
2008-11-03 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20081103-1.c: New test.
void altivec_cell_check (void)
{
+#ifdef __PPU__
/* Exit on systems without the Cell Altivec instructions. */
signal (SIGILL, sig_ill_handler);
#ifdef __MACH__
asm volatile ("lvlx 0,0,0");
#endif
signal (SIGILL, SIG_DFL);
+#else
+ /* altivec_cell_check shouldn't be called without -mcpu=cell. */
+ abort ();
+#endif
}
-# Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007
+# Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
}
}
+# Return 1 if this is a PowerPC target supporting -mcpu=cell.
+
+proc check_effective_target_powerpc_ppu_ok { } {
+ if [check_effective_target_powerpc_altivec_ok] {
+ return [check_no_compiler_messages cell_asm_available object {
+ int main (void) {
+#ifdef __MACH__
+ asm volatile ("lvlx v0,v0,v0");
+#else
+ asm volatile ("lvlx 0,0,0");
+#endif
+ return 0;
+ }
+ }]
+ } else {
+ return 0
+ }
+}
+
# Return 1 if this is a PowerPC target that supports SPU.
proc check_effective_target_powerpc_spu { } {