Replace ../include/wait.h with gdb_wait.h.
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index ffed1e6e2e8f8b26d995cc30528526d0b9aab19c..20166722d3f3d4b8de0524f7c9c9b5f29f60fa25 100644 (file)
@@ -66,6 +66,13 @@ struct type *builtin_type_int64;
 struct type *builtin_type_uint64;
 struct type *builtin_type_bool;
 struct type *builtin_type_v4sf;
+struct type *builtin_type_v4si;
+struct type *builtin_type_v8qi;
+struct type *builtin_type_v4hi;
+struct type *builtin_type_v2si;
+struct type *builtin_type_ptr;
+struct type *builtin_type_CORE_ADDR;
+struct type *builtin_type_bfd_vma;
 
 int opaque_type_resolution = 1;
 
@@ -644,7 +651,7 @@ create_set_type (result_type, domain_type)
        init_simd_type ("__builtin_v4sf", builtin_type_float, "f", 4)
    The type returned is a permanent type, allocated using malloc; it
    doesn't live in any objfile's obstack.  */
-struct type *
+static struct type *
 init_simd_type (char *name,
                struct type *elt_type,
                char *elt_name,
@@ -658,7 +665,8 @@ init_simd_type (char *name,
   memset (f, 0, sizeof (*f));
   f->loc.bitpos = 0;
   f->type = create_array_type (0, elt_type,
-                              create_range_type (0, builtin_type_int, 0, n));
+                              create_range_type (0, builtin_type_int,
+                                                 0, n-1));
   f->name = elt_name;
 
   /* Build a struct type with that field.  */
@@ -2967,6 +2975,31 @@ build_gdbtypes ()
   /* Build SIMD types.  */
   builtin_type_v4sf
     = init_simd_type ("__builtin_v4sf", builtin_type_float, "f", 4);
+  builtin_type_v4si
+    = init_simd_type ("__builtin_v4si", builtin_type_int32, "f", 4);
+  builtin_type_v8qi
+    = init_simd_type ("__builtin_v8qi", builtin_type_int8, "f", 8);
+  builtin_type_v4hi
+    = init_simd_type ("__builtin_v4hi", builtin_type_int16, "f", 4);
+  builtin_type_v2si
+    = init_simd_type ("__builtin_v2si", builtin_type_int32, "f", 2);
+
+  /* Pointer/Address types. */
+  /* NOTE: At present there is no way of differentiating between at
+     target address and the target C language pointer type type even
+     though the two can be different (cf d10v) */
+  builtin_type_ptr =
+    init_type (TYPE_CODE_INT, TARGET_PTR_BIT / 8,
+              TYPE_FLAG_UNSIGNED,
+              "__ptr", (struct objfile *) NULL);
+  builtin_type_CORE_ADDR =
+    init_type (TYPE_CODE_INT, TARGET_PTR_BIT / 8,
+              TYPE_FLAG_UNSIGNED,
+              "__CORE_ADDR", (struct objfile *) NULL);
+  builtin_type_bfd_vma =
+    init_type (TYPE_CODE_INT, TARGET_BFD_VMA_BIT / 8,
+              TYPE_FLAG_UNSIGNED,
+              "__bfd_vma", (struct objfile *) NULL);
 }
 
 
@@ -3006,5 +3039,12 @@ _initialize_gdbtypes ()
   register_gdbarch_swap (&builtin_type_int64, sizeof (struct type *), NULL);
   register_gdbarch_swap (&builtin_type_uint64, sizeof (struct type *), NULL);
   register_gdbarch_swap (&builtin_type_v4sf, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_v4si, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_v8qi, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_v4hi, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_v2si, sizeof (struct type *), NULL);
+  REGISTER_GDBARCH_SWAP (builtin_type_ptr);
+  REGISTER_GDBARCH_SWAP (builtin_type_CORE_ADDR);
+  REGISTER_GDBARCH_SWAP (builtin_type_bfd_vma);
   register_gdbarch_swap (NULL, 0, build_gdbtypes);
 }
This page took 0.024811 seconds and 4 git commands to generate.