From: Alan Modra Date: Wed, 31 Mar 2021 00:06:19 +0000 (+1030) Subject: Use bool in opcodes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78933a4ad9ae9c2e274d41e6b3036ea582c47810;p=binutils-gdb.git Use bool in opcodes cpu/ * frv.opc: Replace bfd_boolean with bool, FALSE with false, and TRUE with true throughout. opcodes/ * sysdep.h (POISON_BFD_BOOLEAN): Define. * aarch64-asm-2.c, * aarch64-asm.c, * aarch64-asm.h, * aarch64-dis-2.c, * aarch64-dis.c, * aarch64-dis.h, * aarch64-gen.c, * aarch64-opc.c, * aarch64-opc.h, * arc-dis.c, * arc-dis.h, * arc-fxi.h, * arc-opc.c, * arm-dis.c, * bfin-dis.c, * cris-dis.c, * csky-dis.c, * csky-opc.h, * dis-buf.c, * disassemble.c, * frv-opc.c, * frv-opc.h, * h8300-dis.c, * i386-dis.c, * m68k-dis.c, * metag-dis.c, * microblaze-dis.c, * microblaze-dis.h, * micromips-opc.c, * mips-dis.c, * mips-formats.h, * mips-opc.c, * mips16-opc.c, * mmix-dis.c, * msp430-dis.c, * nds32-dis.c, * nfp-dis.c, * nios2-dis.c, * ppc-dis.c, * riscv-dis.c, * score-dis.c, * score7-dis.c, * tic6x-dis.c, * v850-dis.c, * vax-dis.c, * wasm32-dis.c, * xtensa-dis.c: Replace bfd_boolean with bool, FALSE with false, and TRUE with true throughout. --- diff --git a/cpu/ChangeLog b/cpu/ChangeLog index 1684d261119..f6e50879c23 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,3 +1,8 @@ +2021-03-31 Alan Modra + + * frv.opc: Replace bfd_boolean with bool, FALSE with false, and + TRUE with true throughout. + 2021-03-29 Alan Modra * frv.opc (frv_is_branch_major, frv_is_float_major), diff --git a/cpu/frv.opc b/cpu/frv.opc index 7863462dafe..54acb9c902a 100644 --- a/cpu/frv.opc +++ b/cpu/frv.opc @@ -66,15 +66,15 @@ typedef struct const CGEN_INSN * insn[FRV_VLIW_SIZE]; } FRV_VLIW; -bfd_boolean frv_is_branch_major (CGEN_ATTR_VALUE_ENUM_TYPE, unsigned long); -bfd_boolean frv_is_float_major (CGEN_ATTR_VALUE_ENUM_TYPE, unsigned long); -bfd_boolean frv_is_media_major (CGEN_ATTR_VALUE_ENUM_TYPE, unsigned long); -bfd_boolean frv_is_branch_insn (const CGEN_INSN *); -bfd_boolean frv_is_float_insn (const CGEN_INSN *); -bfd_boolean frv_is_media_insn (const CGEN_INSN *); -void frv_vliw_reset (FRV_VLIW *, unsigned long, unsigned long); -int frv_vliw_add_insn (FRV_VLIW *, const CGEN_INSN *); -bfd_boolean spr_valid (long); +bool frv_is_branch_major (CGEN_ATTR_VALUE_ENUM_TYPE, unsigned long); +bool frv_is_float_major (CGEN_ATTR_VALUE_ENUM_TYPE, unsigned long); +bool frv_is_media_major (CGEN_ATTR_VALUE_ENUM_TYPE, unsigned long); +bool frv_is_branch_insn (const CGEN_INSN *); +bool frv_is_float_insn (const CGEN_INSN *); +bool frv_is_media_insn (const CGEN_INSN *); +void frv_vliw_reset (FRV_VLIW *, unsigned long, unsigned long); +int frv_vliw_add_insn (FRV_VLIW *, const CGEN_INSN *); +bool spr_valid (long); /* -- */ /* -- opc.c */ @@ -88,117 +88,117 @@ bfd_boolean spr_valid (long); /* Returns TRUE if {MAJOR,MACH} is a major branch of the FRV development tree. */ -bfd_boolean +bool frv_is_branch_major (CGEN_ATTR_VALUE_ENUM_TYPE major, unsigned long mach) { switch (mach) { case bfd_mach_fr400: if (major >= FR400_MAJOR_B_1 && major <= FR400_MAJOR_B_6) - return TRUE; + return true; break; case bfd_mach_fr450: if (major >= FR450_MAJOR_B_1 && major <= FR450_MAJOR_B_6) - return TRUE; + return true; break; default: if (major >= FR500_MAJOR_B_1 && major <= FR500_MAJOR_B_6) - return TRUE; + return true; break; } - return FALSE; + return false; } /* Returns TRUE if {MAJOR,MACH} supports floating point insns. */ -bfd_boolean +bool frv_is_float_major (CGEN_ATTR_VALUE_ENUM_TYPE major, unsigned long mach) { switch (mach) { case bfd_mach_fr400: case bfd_mach_fr450: - return FALSE; + return false; default: if (major >= FR500_MAJOR_F_1 && major <= FR500_MAJOR_F_8) - return TRUE; + return true; break; } - return FALSE; + return false; } /* Returns TRUE if {MAJOR,MACH} supports media insns. */ -bfd_boolean +bool frv_is_media_major (CGEN_ATTR_VALUE_ENUM_TYPE major, unsigned long mach) { switch (mach) { case bfd_mach_fr400: if (major >= FR400_MAJOR_M_1 && major <= FR400_MAJOR_M_2) - return TRUE; + return true; break; case bfd_mach_fr450: if (major >= FR450_MAJOR_M_1 && major <= FR450_MAJOR_M_6) - return TRUE; + return true; break; default: if (major >= FR500_MAJOR_M_1 && major <= FR500_MAJOR_M_8) - return TRUE; + return true; break; } - return FALSE; + return false; } -bfd_boolean +bool frv_is_branch_insn (const CGEN_INSN *insn) { if (frv_is_branch_major (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR400_MAJOR), bfd_mach_fr400)) - return TRUE; + return true; if (frv_is_branch_major (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR450_MAJOR), bfd_mach_fr450)) - return TRUE; + return true; if (frv_is_branch_major (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR500_MAJOR), bfd_mach_fr500)) - return TRUE; + return true; - return FALSE; + return false; } -bfd_boolean +bool frv_is_float_insn (const CGEN_INSN *insn) { if (frv_is_float_major (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR400_MAJOR), bfd_mach_fr400)) - return TRUE; + return true; if (frv_is_float_major (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR450_MAJOR), bfd_mach_fr450)) - return TRUE; + return true; if (frv_is_float_major (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR500_MAJOR), bfd_mach_fr500)) - return TRUE; + return true; - return FALSE; + return false; } -bfd_boolean +bool frv_is_media_insn (const CGEN_INSN *insn) { if (frv_is_media_major (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR400_MAJOR), bfd_mach_fr400)) - return TRUE; + return true; if (frv_is_media_major (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR450_MAJOR), bfd_mach_fr450)) - return TRUE; + return true; if (frv_is_media_major (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR500_MAJOR), bfd_mach_fr500)) - return TRUE; + return true; - return FALSE; + return false; } /* This table represents the allowable packing for vliw insns for the fr400. @@ -439,7 +439,7 @@ frv_vliw_reset (FRV_VLIW *vliw, unsigned long mach, unsigned long elf_flags) /* Return TRUE if unit1 is a match for unit2. Unit1 comes from the insn's UNIT attribute. unit2 comes from one of the *_allowed_vliw tables above. */ -static bfd_boolean +static bool match_unit (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE unit1, CGEN_ATTR_VALUE_ENUM_TYPE unit2) { @@ -447,9 +447,9 @@ match_unit (FRV_VLIW *vliw, unit1 = vliw->unit_mapping[unit1]; if (unit1 == unit2) - return TRUE; + return true; if (unit1 < unit2) - return FALSE; + return false; switch (unit1) { @@ -459,34 +459,34 @@ match_unit (FRV_VLIW *vliw, /* The 01 versions of these units are within 2 enums of the 0 or 1 versions. */ if (unit1 - unit2 <= 2) - return TRUE; + return true; break; case UNIT_IALL: case UNIT_FMALL: /* The ALL versions of these units are within 5 enums of the 0, 1, 2 or 3 versions. */ if (unit1 - unit2 <= 5) - return TRUE; + return true; break; default: break; } - return FALSE; + return false; } /* Return TRUE if the vliws match, FALSE otherwise. */ -static bfd_boolean +static bool match_vliw (VLIW_COMBO *vliw1, VLIW_COMBO *vliw2, int vliw_size) { int i; for (i = 0; i < vliw_size; ++i) if ((*vliw1)[i] != (*vliw2)[i]) - return FALSE; + return false; - return TRUE; + return true; } /* Find the next vliw vliw in the table that can accomodate the new insn. @@ -523,22 +523,22 @@ add_next_to_vliw (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE unit) /* Look for the given major insn type in the given vliw. Returns TRUE if found, FALSE otherwise. */ -static bfd_boolean +static bool find_major_in_vliw (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major) { int i; for (i = 0; i < vliw->next_slot; ++i) if (vliw->major[i] == major) - return TRUE; + return true; - return FALSE; + return false; } /* Check for constraints between the insns in the vliw due to major insn types. */ -static bfd_boolean +static bool fr400_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major) { /* In the cpu file, all media insns are represented as being allowed in @@ -555,10 +555,10 @@ fr400_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE ma default: break; } - return TRUE; + return true; } -static bfd_boolean +static bool fr450_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major) { CGEN_ATTR_VALUE_ENUM_TYPE other_major; @@ -569,7 +569,7 @@ fr450_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE ma /* (M4, M5) and (M4, M6) are allowed. */ if (other_major == FR450_MAJOR_M_4) if (major == FR450_MAJOR_M_5 || major == FR450_MAJOR_M_6) - return TRUE; + return true; /* Otherwise, instructions in even-numbered media categories cannot be executed in parallel with other media instructions. */ @@ -589,23 +589,23 @@ fr450_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE ma || other_major == FR450_MAJOR_M_6); default: - return TRUE; + return true; } } -static bfd_boolean +static bool find_unit_in_vliw (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE unit) { int i; for (i = 0; i < vliw->next_slot; ++i) if (CGEN_INSN_ATTR_VALUE (vliw->insn[i], CGEN_INSN_UNIT) == unit) - return TRUE; + return true; - return FALSE; /* Not found. */ + return false; /* Not found. */ } -static bfd_boolean +static bool find_major_in_slot (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major, CGEN_ATTR_VALUE_ENUM_TYPE slot) @@ -614,12 +614,12 @@ find_major_in_slot (FRV_VLIW *vliw, for (i = 0; i < vliw->next_slot; ++i) if (vliw->major[i] == major && (*vliw->current_vliw)[i] == slot) - return TRUE; + return true; - return FALSE; + return false; } -static bfd_boolean +static bool fr550_find_media_in_vliw (FRV_VLIW *vliw) { int i; @@ -635,13 +635,13 @@ fr550_find_media_in_vliw (FRV_VLIW *vliw) || CGEN_INSN_NUM (vliw->insn[i]) == FRV_INSN_MCLRACC_1) continue; - return TRUE; /* Found one. */ + return true; /* Found one. */ } - return FALSE; + return false; } -static bfd_boolean +static bool fr550_find_float_in_vliw (FRV_VLIW *vliw) { int i; @@ -655,13 +655,13 @@ fr550_find_float_in_vliw (FRV_VLIW *vliw) if (CGEN_INSN_NUM (vliw->insn[i]) == FRV_INSN_FNOP) continue; - return TRUE; /* Found one. */ + return true; /* Found one. */ } - return FALSE; + return false; } -static bfd_boolean +static bool fr550_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major, const CGEN_INSN *insn) @@ -709,10 +709,10 @@ fr550_check_insn_major_constraints (FRV_VLIW *vliw, default: break; } - return TRUE; /* All OK. */ + return true; /* All OK. */ } -static bfd_boolean +static bool fr500_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major) { /* TODO: A table might be faster for some of the more complex instances @@ -732,7 +732,7 @@ fr500_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE ma case FR500_MAJOR_F_4: case FR500_MAJOR_F_8: case FR500_MAJOR_M_8: - return TRUE; /* OK */ + return true; /* OK */ case FR500_MAJOR_I_2: /* Cannot coexist with I-3 insn. */ return ! find_major_in_vliw (vliw, FR500_MAJOR_I_3); @@ -816,10 +816,10 @@ fr500_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE ma abort (); break; } - return TRUE; + return true; } -static bfd_boolean +static bool check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major, const CGEN_INSN *insn) @@ -919,12 +919,12 @@ frv_vliw_add_insn (FRV_VLIW *vliw, const CGEN_INSN *insn) return 1; } -bfd_boolean +bool spr_valid (long regno) { - if (regno < 0) return FALSE; - if (regno <= 4095) return TRUE; - return FALSE; + if (regno < 0) return false; + if (regno <= 4095) return true; + return false; } /* -- */ diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index ae4dea918cb..6d29147debe 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,21 @@ +2021-03-31 Alan Modra + + * sysdep.h (POISON_BFD_BOOLEAN): Define. + * aarch64-asm-2.c, * aarch64-asm.c, * aarch64-asm.h, + * aarch64-dis-2.c, * aarch64-dis.c, * aarch64-dis.h, + * aarch64-gen.c, * aarch64-opc.c, * aarch64-opc.h, * arc-dis.c, + * arc-dis.h, * arc-fxi.h, * arc-opc.c, * arm-dis.c, * bfin-dis.c, + * cris-dis.c, * csky-dis.c, * csky-opc.h, * dis-buf.c, + * disassemble.c, * frv-opc.c, * frv-opc.h, * h8300-dis.c, + * i386-dis.c, * m68k-dis.c, * metag-dis.c, * microblaze-dis.c, + * microblaze-dis.h, * micromips-opc.c, * mips-dis.c, + * mips-formats.h, * mips-opc.c, * mips16-opc.c, * mmix-dis.c, + * msp430-dis.c, * nds32-dis.c, * nfp-dis.c, * nios2-dis.c, + * ppc-dis.c, * riscv-dis.c, * score-dis.c, * score7-dis.c, + * tic6x-dis.c, * v850-dis.c, * vax-dis.c, * wasm32-dis.c, + * xtensa-dis.c: Replace bfd_boolean with bool, FALSE with false, + and TRUE with true throughout. + 2021-03-31 Alan Modra * aarch64-dis.c: Include stdint.h in place of bfd_stdint.h. diff --git a/opcodes/aarch64-asm-2.c b/opcodes/aarch64-asm-2.c index abc6d68d94e..26d61da4ff7 100644 --- a/opcodes/aarch64-asm-2.c +++ b/opcodes/aarch64-asm-2.c @@ -603,7 +603,7 @@ aarch64_find_real_opcode (const aarch64_opcode *opcode) return aarch64_opcode_table + value; } -bfd_boolean +bool aarch64_insert_operand (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, diff --git a/opcodes/aarch64-asm.c b/opcodes/aarch64-asm.c index eae652e2714..fa1612c0130 100644 --- a/opcodes/aarch64-asm.c +++ b/opcodes/aarch64-asm.c @@ -79,31 +79,31 @@ insert_all_fields (const aarch64_operand *self, aarch64_insn *code, /* Operand inserters. */ /* Insert nothing. */ -bfd_boolean +bool aarch64_ins_none (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info ATTRIBUTE_UNUSED, aarch64_insn *code ATTRIBUTE_UNUSED, const aarch64_inst *inst ATTRIBUTE_UNUSED, aarch64_operand_error *errors ATTRIBUTE_UNUSED) { - return TRUE; + return true; } /* Insert register number. */ -bfd_boolean +bool aarch64_ins_regno (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, aarch64_operand_error *errors ATTRIBUTE_UNUSED) { insert_field (self->fields[0], code, info->reg.regno, 0); - return TRUE; + return true; } /* Insert register number, index and/or other data for SIMD register element operand, e.g. the last source operand in SQDMLAL , , .[]. */ -bfd_boolean +bool aarch64_ins_reglane (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, aarch64_operand_error *errors ATTRIBUTE_UNUSED) @@ -188,11 +188,11 @@ aarch64_ins_reglane (const aarch64_operand *self, const aarch64_opnd_info *info, assert (0); } } - return TRUE; + return true; } /* Insert regno and len field of a register list operand, e.g. Vn in TBL. */ -bfd_boolean +bool aarch64_ins_reglist (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -202,12 +202,12 @@ aarch64_ins_reglist (const aarch64_operand *self, const aarch64_opnd_info *info, insert_field (self->fields[0], code, info->reglist.first_regno, 0); /* len */ insert_field (FLD_len, code, info->reglist.num_regs - 1, 0); - return TRUE; + return true; } /* Insert Rt and opcode fields for a register list operand, e.g. Vt in AdvSIMD load/store instructions. */ -bfd_boolean +bool aarch64_ins_ldst_reglist (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, @@ -246,12 +246,12 @@ aarch64_ins_ldst_reglist (const aarch64_operand *self ATTRIBUTE_UNUSED, } insert_field (FLD_opcode, code, value, 0); - return TRUE; + return true; } /* Insert Rt and S fields for a register list operand, e.g. Vt in AdvSIMD load single structure to all lanes instructions. */ -bfd_boolean +bool aarch64_ins_ldst_reglist_r (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, @@ -272,12 +272,12 @@ aarch64_ins_ldst_reglist_r (const aarch64_operand *self ATTRIBUTE_UNUSED, value = (aarch64_insn) 1; insert_field (FLD_S, code, value, 0); - return TRUE; + return true; } /* Insert Q, opcode<2:1>, S, size and Rt fields for a register element list operand e.g. Vt in AdvSIMD load/store single element instructions. */ -bfd_boolean +bool aarch64_ins_ldst_elemlist (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -321,13 +321,13 @@ aarch64_ins_ldst_elemlist (const aarch64_operand *self ATTRIBUTE_UNUSED, gen_sub_field (FLD_asisdlso_opcode, 1, 2, &field); insert_field_2 (&field, code, opcodeh2, 0); - return TRUE; + return true; } /* Insert fields immh:immb and/or Q for e.g. the shift immediate in SSHR ., ., # or SSHR , , #. */ -bfd_boolean +bool aarch64_ins_advsimd_imm_shift (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, @@ -377,12 +377,12 @@ aarch64_ins_advsimd_imm_shift (const aarch64_operand *self ATTRIBUTE_UNUSED, imm = info->imm.value + (8 << (unsigned)val); insert_fields (code, imm, 0, 2, FLD_immb, FLD_immh); - return TRUE; + return true; } /* Insert fields for e.g. the immediate operands in BFM , , #, #. */ -bfd_boolean +bool aarch64_ins_imm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -396,12 +396,12 @@ aarch64_ins_imm (const aarch64_operand *self, const aarch64_opnd_info *info, if (operand_need_shift_by_four (self)) imm >>= 4; insert_all_fields (self, code, imm); - return TRUE; + return true; } /* Insert immediate and its shift amount for e.g. the last operand in MOVZ , #{, LSL #}. */ -bfd_boolean +bool aarch64_ins_imm_half (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, aarch64_operand_error *errors) @@ -410,12 +410,12 @@ aarch64_ins_imm_half (const aarch64_operand *self, const aarch64_opnd_info *info aarch64_ins_imm (self, info, code, inst, errors); /* hw */ insert_field (FLD_hw, code, info->shifter.amount >> 4, 0); - return TRUE; + return true; } /* Insert cmode and "a:b:c:d:e:f:g:h" fields for e.g. the last operand in MOVI ., # {, LSL #}. */ -bfd_boolean +bool aarch64_ins_advsimd_imm_modified (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, @@ -443,7 +443,7 @@ aarch64_ins_advsimd_imm_modified (const aarch64_operand *self ATTRIBUTE_UNUSED, insert_fields (code, imm, 0, 2, FLD_defgh, FLD_abc); if (kind == AARCH64_MOD_NONE) - return TRUE; + return true; /* shift amount partially in cmode */ assert (kind == AARCH64_MOD_LSL || kind == AARCH64_MOD_MSL); @@ -455,7 +455,7 @@ aarch64_ins_advsimd_imm_modified (const aarch64_operand *self ATTRIBUTE_UNUSED, /* For 8-bit move immediate, the optional LSL #0 does not require encoding. */ if (esize == 1) - return TRUE; + return true; amount >>= 3; if (esize == 4) gen_sub_field (FLD_cmode, 1, 2, &field); /* per word */ @@ -470,22 +470,22 @@ aarch64_ins_advsimd_imm_modified (const aarch64_operand *self ATTRIBUTE_UNUSED, } insert_field_2 (&field, code, amount, 0); - return TRUE; + return true; } /* Insert fields for an 8-bit floating-point immediate. */ -bfd_boolean +bool aarch64_ins_fpimm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, aarch64_operand_error *errors ATTRIBUTE_UNUSED) { insert_all_fields (self, code, info->imm.value); - return TRUE; + return true; } /* Insert 1-bit rotation immediate (#90 or #270). */ -bfd_boolean +bool aarch64_ins_imm_rotate1 (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, @@ -494,11 +494,11 @@ aarch64_ins_imm_rotate1 (const aarch64_operand *self, uint64_t rot = (info->imm.value - 90) / 180; assert (rot < 2U); insert_field (self->fields[0], code, rot, inst->opcode->mask); - return TRUE; + return true; } /* Insert 2-bit rotation immediate (#0, #90, #180 or #270). */ -bfd_boolean +bool aarch64_ins_imm_rotate2 (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, @@ -507,24 +507,24 @@ aarch64_ins_imm_rotate2 (const aarch64_operand *self, uint64_t rot = info->imm.value / 90; assert (rot < 4U); insert_field (self->fields[0], code, rot, inst->opcode->mask); - return TRUE; + return true; } /* Insert # for the immediate operand in fp fix-point instructions, e.g. SCVTF
, , #. */ -bfd_boolean +bool aarch64_ins_fbits (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, aarch64_operand_error *errors ATTRIBUTE_UNUSED) { insert_field (self->fields[0], code, 64 - info->imm.value, 0); - return TRUE; + return true; } /* Insert arithmetic immediate for e.g. the last operand in SUBS , , # {, }. */ -bfd_boolean +bool aarch64_ins_aimm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, aarch64_operand_error *errors ATTRIBUTE_UNUSED) @@ -534,18 +534,18 @@ aarch64_ins_aimm (const aarch64_operand *self, const aarch64_opnd_info *info, insert_field (self->fields[0], code, value, 0); /* imm12 (unsigned) */ insert_field (self->fields[1], code, info->imm.value, 0); - return TRUE; + return true; } /* Common routine shared by aarch64_ins{,_inv}_limm. INVERT_P says whether the operand should be inverted before encoding. */ -static bfd_boolean +static bool aarch64_ins_limm_1 (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, - const aarch64_inst *inst, bfd_boolean invert_p, + const aarch64_inst *inst, bool invert_p, aarch64_operand_error *errors ATTRIBUTE_UNUSED) { - bfd_boolean res; + bool res; aarch64_insn value; uint64_t imm = info->imm.value; int esize = aarch64_get_qualifier_esize (inst->operands[0].qualifier); @@ -562,7 +562,7 @@ aarch64_ins_limm_1 (const aarch64_operand *self, /* Insert logical/bitmask immediate for e.g. the last operand in ORR , , #. */ -bfd_boolean +bool aarch64_ins_limm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, aarch64_operand_error *errors ATTRIBUTE_UNUSED) @@ -572,18 +572,18 @@ aarch64_ins_limm (const aarch64_operand *self, const aarch64_opnd_info *info, } /* Insert a logical/bitmask immediate for the BIC alias of AND (etc.). */ -bfd_boolean +bool aarch64_ins_inv_limm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, aarch64_operand_error *errors ATTRIBUTE_UNUSED) { - return aarch64_ins_limm_1 (self, info, code, inst, TRUE, errors); + return aarch64_ins_limm_1 (self, info, code, inst, true, errors); } /* Encode Ft for e.g. STR , [, {, {}}] or LDP , , [], #. */ -bfd_boolean +bool aarch64_ins_ft (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, aarch64_operand_error *errors) @@ -616,11 +616,11 @@ aarch64_ins_ft (const aarch64_operand *self, const aarch64_opnd_info *info, insert_fields (code, value, 0, 2, FLD_ldst_size, FLD_opc1); } - return TRUE; + return true; } /* Encode the address operand for e.g. STXRB , , [{,#0}]. */ -bfd_boolean +bool aarch64_ins_addr_simple (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -628,12 +628,12 @@ aarch64_ins_addr_simple (const aarch64_operand *self ATTRIBUTE_UNUSED, { /* Rn */ insert_field (FLD_Rn, code, info->addr.base_regno, 0); - return TRUE; + return true; } /* Encode the address operand for e.g. STR , [, {, {}}]. */ -bfd_boolean +bool aarch64_ins_addr_regoff (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -662,12 +662,12 @@ aarch64_ins_addr_regoff (const aarch64_operand *self ATTRIBUTE_UNUSED, S = info->shifter.operator_present && info->shifter.amount_present; insert_field (FLD_S, code, S, 0); - return TRUE; + return true; } /* Encode the address operand for e.g. stlur , [{, }]. */ -bfd_boolean +bool aarch64_ins_addr_offset (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -686,11 +686,11 @@ aarch64_ins_addr_offset (const aarch64_operand *self ATTRIBUTE_UNUSED, assert (info->addr.preind == 1 && info->addr.postind == 0); insert_field (self->fields[2], code, 1, 0); } - return TRUE; + return true; } /* Encode the address operand for e.g. LDRSW , [, #]!. */ -bfd_boolean +bool aarch64_ins_addr_simm (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, @@ -720,11 +720,11 @@ aarch64_ins_addr_simm (const aarch64_operand *self, insert_field (self->fields[1], code, 1, 0); } - return TRUE; + return true; } /* Encode the address operand for e.g. LDRAA , [{, #}]. */ -bfd_boolean +bool aarch64_ins_addr_simm10 (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, @@ -745,11 +745,11 @@ aarch64_ins_addr_simm10 (const aarch64_operand *self, assert (info->addr.preind == 1 && info->addr.postind == 0); insert_field (self->fields[3], code, 1, 0); } - return TRUE; + return true; } /* Encode the address operand for e.g. LDRSW , [{, #}]. */ -bfd_boolean +bool aarch64_ins_addr_uimm12 (const aarch64_operand *self, const aarch64_opnd_info *info, aarch64_insn *code, @@ -762,12 +762,12 @@ aarch64_ins_addr_uimm12 (const aarch64_operand *self, insert_field (self->fields[0], code, info->addr.base_regno, 0); /* uimm12 */ insert_field (self->fields[1], code,info->addr.offset.imm >> shift, 0); - return TRUE; + return true; } /* Encode the address operand for e.g. LD1 {., ., .}, [], >. */ -bfd_boolean +bool aarch64_ins_simd_addr_post (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -780,11 +780,11 @@ aarch64_ins_simd_addr_post (const aarch64_operand *self ATTRIBUTE_UNUSED, insert_field (FLD_Rm, code, info->addr.offset.regno, 0); else insert_field (FLD_Rm, code, 0x1f, 0); - return TRUE; + return true; } /* Encode the condition operand for e.g. CSEL , , , . */ -bfd_boolean +bool aarch64_ins_cond (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -792,11 +792,11 @@ aarch64_ins_cond (const aarch64_operand *self ATTRIBUTE_UNUSED, { /* cond */ insert_field (FLD_cond, code, info->cond->value, 0); - return TRUE; + return true; } /* Encode the system register operand for e.g. MRS , . */ -bfd_boolean +bool aarch64_ins_sysreg (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst, @@ -820,7 +820,7 @@ aarch64_ins_sysreg (const aarch64_operand *self ATTRIBUTE_UNUSED, detail->kind = AARCH64_OPDE_SYNTAX_ERROR; detail->error = _("specified register cannot be read from"); detail->index = info->idx; - detail->non_fatal = TRUE; + detail->non_fatal = true; } else if (opcode_flags == F_SYS_WRITE && sysreg_flags @@ -829,17 +829,17 @@ aarch64_ins_sysreg (const aarch64_operand *self ATTRIBUTE_UNUSED, detail->kind = AARCH64_OPDE_SYNTAX_ERROR; detail->error = _("specified register cannot be written to"); detail->index = info->idx; - detail->non_fatal = TRUE; + detail->non_fatal = true; } } /* op0:op1:CRn:CRm:op2 */ insert_fields (code, info->sysreg.value, inst->opcode->mask, 5, FLD_op2, FLD_CRm, FLD_CRn, FLD_op1, FLD_op0); - return TRUE; + return true; } /* Encode the PSTATE field operand for e.g. MSR , #. */ -bfd_boolean +bool aarch64_ins_pstatefield (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -848,11 +848,11 @@ aarch64_ins_pstatefield (const aarch64_operand *self ATTRIBUTE_UNUSED, /* op1:op2 */ insert_fields (code, info->pstatefield, inst->opcode->mask, 2, FLD_op2, FLD_op1); - return TRUE; + return true; } /* Encode the system instruction op operand for e.g. AT , . */ -bfd_boolean +bool aarch64_ins_sysins_op (const aarch64_operand *self ATTRIBUTE_UNUSED, const aarch64_opnd_info *info, aarch64_insn *code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -861,12 +861,12 @@ aarch64_ins_sysins_op (const aarch64_operand *self ATTRIBUTE_UNUSED, /* op1:CRn:CRm:op2 */ insert_fields (code, info->sysins_op->value, inst->opcode->mask, 4, FLD_op2, FLD_CRm, FLD_CRn, FLD_op1); - return TRUE; + return true; } /* Encode the memory barrier option operand for e.g. DMB
, , #. */ -bfd_boolean +bool aarch64_ext_fbits (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, const aarch64_insn code, const aarch64_inst *inst ATTRIBUTE_UNUSED, aarch64_operand_error *errors ATTRIBUTE_UNUSED) { info->imm.value = 64- extract_field (FLD_scale, code, 0); - return TRUE; + return true; } /* Decode arithmetic immediate for e.g. SUBS , , # {, }. */ -bfd_boolean +bool aarch64_ext_aimm (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, const aarch64_insn code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -831,18 +831,18 @@ aarch64_ext_aimm (const aarch64_operand *self ATTRIBUTE_UNUSED, /* shift */ value = extract_field (FLD_shift, code, 0); if (value >= 2) - return FALSE; + return false; info->shifter.amount = value ? 12 : 0; /* imm12 (unsigned) */ info->imm.value = extract_field (FLD_imm12, code, 0); - return TRUE; + return true; } /* Return true if VALUE is a valid logical immediate encoding, storing the decoded value in *RESULT if so. ESIZE is the number of bytes in the decoded immediate. */ -static bfd_boolean +static bool decode_limm (uint32_t esize, aarch64_insn value, int64_t *result) { uint64_t imm, mask; @@ -870,7 +870,7 @@ decode_limm (uint32_t esize, aarch64_insn value, int64_t *result) case 0x30 ... 0x37: /* 110xxx */ simd_size = 8; S &= 0x7; break; case 0x38 ... 0x3b: /* 1110xx */ simd_size = 4; S &= 0x3; break; case 0x3c ... 0x3d: /* 11110x */ simd_size = 2; S &= 0x1; break; - default: return FALSE; + default: return false; } mask = (1ull << simd_size) - 1; /* Top bits are IGNORED. */ @@ -878,11 +878,11 @@ decode_limm (uint32_t esize, aarch64_insn value, int64_t *result) } if (simd_size > esize * 8) - return FALSE; + return false; /* NOTE: if S = simd_size - 1 we get 0xf..f which is rejected. */ if (S == simd_size - 1) - return FALSE; + return false; /* S+1 consecutive bits to 1. */ /* NOTE: S can't be 63 due to detection above. */ imm = (1ull << (S + 1)) - 1; @@ -908,11 +908,11 @@ decode_limm (uint32_t esize, aarch64_insn value, int64_t *result) *result = imm & ~((uint64_t) -1 << (esize * 4) << (esize * 4)); - return TRUE; + return true; } /* Decode a logical immediate for e.g. ORR , , #. */ -bfd_boolean +bool aarch64_ext_limm (const aarch64_operand *self, aarch64_opnd_info *info, const aarch64_insn code, const aarch64_inst *inst, @@ -928,21 +928,21 @@ aarch64_ext_limm (const aarch64_operand *self, } /* Decode a logical immediate for the BIC alias of AND (etc.). */ -bfd_boolean +bool aarch64_ext_inv_limm (const aarch64_operand *self, aarch64_opnd_info *info, const aarch64_insn code, const aarch64_inst *inst, aarch64_operand_error *errors) { if (!aarch64_ext_limm (self, info, code, inst, errors)) - return FALSE; + return false; info->imm.value = ~info->imm.value; - return TRUE; + return true; } /* Decode Ft for e.g. STR , [, {, {}}] or LDP , , [], #. */ -bfd_boolean +bool aarch64_ext_ft (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, const aarch64_insn code, const aarch64_inst *inst, @@ -966,7 +966,7 @@ aarch64_ext_ft (const aarch64_operand *self ATTRIBUTE_UNUSED, case 0: qualifier = AARCH64_OPND_QLF_S_S; break; case 1: qualifier = AARCH64_OPND_QLF_S_D; break; case 2: qualifier = AARCH64_OPND_QLF_S_Q; break; - default: return FALSE; + default: return false; } info->qualifier = qualifier; } @@ -975,15 +975,15 @@ aarch64_ext_ft (const aarch64_operand *self ATTRIBUTE_UNUSED, /* opc1:size */ value = extract_fields (code, 0, 2, FLD_opc1, FLD_ldst_size); if (value > 0x4) - return FALSE; + return false; info->qualifier = get_sreg_qualifier_from_value (value); } - return TRUE; + return true; } /* Decode the address operand for e.g. STXRB , , [{,#0}]. */ -bfd_boolean +bool aarch64_ext_addr_simple (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, aarch64_insn code, @@ -992,12 +992,12 @@ aarch64_ext_addr_simple (const aarch64_operand *self ATTRIBUTE_UNUSED, { /* Rn */ info->addr.base_regno = extract_field (FLD_Rn, code, 0); - return TRUE; + return true; } /* Decode the address operand for e.g. stlur , [{, }]. */ -bfd_boolean +bool aarch64_ext_addr_offset (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, aarch64_insn code, const aarch64_inst *inst, @@ -1015,12 +1015,12 @@ aarch64_ext_addr_offset (const aarch64_operand *self ATTRIBUTE_UNUSED, info->addr.writeback = 1; info->addr.preind = 1; } - return TRUE; + return true; } /* Decode the address operand for e.g. STR , [, {, {}}]. */ -bfd_boolean +bool aarch64_ext_addr_regoff (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, aarch64_insn code, const aarch64_inst *inst, @@ -1035,7 +1035,7 @@ aarch64_ext_addr_regoff (const aarch64_operand *self ATTRIBUTE_UNUSED, /* option */ value = extract_field (FLD_option, code, 0); info->shifter.kind = - aarch64_get_operand_modifier_from_value (value, TRUE /* extend_p */); + aarch64_get_operand_modifier_from_value (value, true /* extend_p */); /* Fix-up the shifter kind; although the table-driven approach is efficient, it is slightly inflexible, thus needing this fix-up. */ if (info->shifter.kind == AARCH64_MOD_UXTX) @@ -1060,11 +1060,11 @@ aarch64_ext_addr_regoff (const aarch64_operand *self ATTRIBUTE_UNUSED, info->shifter.amount_present = 1; } - return TRUE; + return true; } /* Decode the address operand for e.g. LDRSW , [], #. */ -bfd_boolean +bool aarch64_ext_addr_simm (const aarch64_operand *self, aarch64_opnd_info *info, aarch64_insn code, const aarch64_inst *inst, aarch64_operand_error *errors ATTRIBUTE_UNUSED) @@ -1097,11 +1097,11 @@ aarch64_ext_addr_simm (const aarch64_operand *self, aarch64_opnd_info *info, info->addr.postind = 1; } - return TRUE; + return true; } /* Decode the address operand for e.g. LDRSW , [{, #}]. */ -bfd_boolean +bool aarch64_ext_addr_uimm12 (const aarch64_operand *self, aarch64_opnd_info *info, aarch64_insn code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -1114,11 +1114,11 @@ aarch64_ext_addr_uimm12 (const aarch64_operand *self, aarch64_opnd_info *info, info->addr.base_regno = extract_field (self->fields[0], code, 0); /* uimm12 */ info->addr.offset.imm = extract_field (self->fields[1], code, 0) << shift; - return TRUE; + return true; } /* Decode the address operand for e.g. LDRAA , [{, #}]. */ -bfd_boolean +bool aarch64_ext_addr_simm10 (const aarch64_operand *self, aarch64_opnd_info *info, aarch64_insn code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -1136,12 +1136,12 @@ aarch64_ext_addr_simm10 (const aarch64_operand *self, aarch64_opnd_info *info, info->addr.writeback = 1; info->addr.preind = 1; } - return TRUE; + return true; } /* Decode the address operand for e.g. LD1 {., ., .}, [], >. */ -bfd_boolean +bool aarch64_ext_simd_addr_post (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, aarch64_insn code, const aarch64_inst *inst, @@ -1171,11 +1171,11 @@ aarch64_ext_simd_addr_post (const aarch64_operand *self ATTRIBUTE_UNUSED, info->addr.offset.is_reg = 1; info->addr.writeback = 1; - return TRUE; + return true; } /* Decode the condition operand for e.g. CSEL , , , . */ -bfd_boolean +bool aarch64_ext_cond (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, aarch64_insn code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -1185,11 +1185,11 @@ aarch64_ext_cond (const aarch64_operand *self ATTRIBUTE_UNUSED, /* cond */ value = extract_field (FLD_cond, code, 0); info->cond = get_cond_from_value (value); - return TRUE; + return true; } /* Decode the system register operand for e.g. MRS , . */ -bfd_boolean +bool aarch64_ext_sysreg (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, aarch64_insn code, @@ -1214,11 +1214,11 @@ aarch64_ext_sysreg (const aarch64_operand *self ATTRIBUTE_UNUSED, info->sysreg.flags = F_REG_WRITE; } - return TRUE; + return true; } /* Decode the PSTATE field operand for e.g. MSR , #. */ -bfd_boolean +bool aarch64_ext_pstatefield (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, aarch64_insn code, const aarch64_inst *inst ATTRIBUTE_UNUSED, @@ -1229,13 +1229,13 @@ aarch64_ext_pstatefield (const aarch64_operand *self ATTRIBUTE_UNUSED, info->pstatefield = extract_fields (code, 0, 2, FLD_op1, FLD_op2); for (i = 0; aarch64_pstatefields[i].name != NULL; ++i) if (aarch64_pstatefields[i].value == (aarch64_insn)info->pstatefield) - return TRUE; + return true; /* Reserved value in . */ - return FALSE; + return false; } /* Decode the system instruction op operand for e.g. AT , . */ -bfd_boolean +bool aarch64_ext_sysins_op (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_opnd_info *info, aarch64_insn code, @@ -1262,7 +1262,7 @@ aarch64_ext_sysins_op (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_sys_regs_sr[]. */ value = value & ~(0x7); break; - default: assert (0); return FALSE; + default: assert (0); return false; } for (i = 0; sysins_ops[i].name != NULL; ++i) @@ -1273,15 +1273,15 @@ aarch64_ext_sysins_op (const aarch64_operand *self ATTRIBUTE_UNUSED, info->sysins_op->name, (unsigned)info->sysins_op->value, aarch64_sys_ins_reg_has_xt (info->sysins_op), i); - return TRUE; + return true; } - return FALSE; + return false; } /* Decode the memory barrier option operand for e.g. DMB