- struct type *type;
-
- type = init_flags_type ("builtin_type_sparc_psr", 4);
- append_flags_type_flag (type, 5, "ET");
- append_flags_type_flag (type, 6, "PS");
- append_flags_type_flag (type, 7, "S");
- append_flags_type_flag (type, 12, "EF");
- append_flags_type_flag (type, 13, "EC");
- sparc_psr_type = type;
-
- type = init_flags_type ("builtin_type_sparc_fsr", 4);
- append_flags_type_flag (type, 0, "NXA");
- append_flags_type_flag (type, 1, "DZA");
- append_flags_type_flag (type, 2, "UFA");
- append_flags_type_flag (type, 3, "OFA");
- append_flags_type_flag (type, 4, "NVA");
- append_flags_type_flag (type, 5, "NXC");
- append_flags_type_flag (type, 6, "DZC");
- append_flags_type_flag (type, 7, "UFC");
- append_flags_type_flag (type, 8, "OFC");
- append_flags_type_flag (type, 9, "NVC");
- append_flags_type_flag (type, 22, "NS");
- append_flags_type_flag (type, 23, "NXM");
- append_flags_type_flag (type, 24, "DZM");
- append_flags_type_flag (type, 25, "UFM");
- append_flags_type_flag (type, 26, "OFM");
- append_flags_type_flag (type, 27, "NVM");
- sparc_fsr_type = type;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (!tdep->sparc_fsr_type)
+ {
+ struct type *type;
+
+ type = arch_flags_type (gdbarch, "builtin_type_sparc_fsr", 4);
+ append_flags_type_flag (type, 0, "NXA");
+ append_flags_type_flag (type, 1, "DZA");
+ append_flags_type_flag (type, 2, "UFA");
+ append_flags_type_flag (type, 3, "OFA");
+ append_flags_type_flag (type, 4, "NVA");
+ append_flags_type_flag (type, 5, "NXC");
+ append_flags_type_flag (type, 6, "DZC");
+ append_flags_type_flag (type, 7, "UFC");
+ append_flags_type_flag (type, 8, "OFC");
+ append_flags_type_flag (type, 9, "NVC");
+ append_flags_type_flag (type, 22, "NS");
+ append_flags_type_flag (type, 23, "NXM");
+ append_flags_type_flag (type, 24, "DZM");
+ append_flags_type_flag (type, 25, "UFM");
+ append_flags_type_flag (type, 26, "OFM");
+ append_flags_type_flag (type, 27, "NVM");
+
+ tdep->sparc_fsr_type = type;
+ }
+
+ return tdep->sparc_fsr_type;