+2021-03-29 Alan Modra <amodra@gmail.com>
+
+ * aoutx.h (aout_link_write_symbols): Don't cast boolean expression
+ to bfd_boolean.
+ * elf32-or1k.c (or1k_set_got_and_rela_sizes): Dont compare booleans
+ against FALSE.
+ * elf32-arc.c (name_for_global_symbol): Don't compare boolean to TRUE.
+ (is_reloc_PC_relative): Don't use "boolean_condition ? TRUE : FALSE".
+ (is_reloc_SDA_relative, is_reloc_for_GOT): Likewise.
+ (is_reloc_for_PLT, is_reloc_for_TLS): Likewise.
+ * elf32-arm.c (stm32l4xx_need_create_replacing_stub): Likewise.
+ * elf32-nds32.c (insert_nds32_elf_blank): Likewise.
+ * elf32-rx.c (rx_set_section_contents): Likewise.
+ * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_ignore_undef_symbol): Likewise.
+ * mach-o.c (bfd_mach_o_read_command): Likewise.
+ * targets.c (bfd_get_target_info): Likewise.
+
2021-03-29 Alan Modra <amodra@gmail.com>
* coff-z80.c (z80_is_local_label_name): Return bfd_boolean.
/* If we have already included a header file with the
same value, then replace this one with an N_EXCL
symbol. */
- copy = (bfd_boolean) (! flaginfo->info->keep_memory);
+ copy = !flaginfo->info->keep_memory;
incl_entry = aout_link_includes_lookup (&flaginfo->includes,
name, TRUE, copy);
if (incl_entry == NULL)
Elf_Internal_Rela _rel; \
bfd_byte * _loc; \
\
- if (_htab->dynamic_sections_created == TRUE) \
+ if (_htab->dynamic_sections_created) \
{ \
BFD_ASSERT (_htab->srel##SECTION &&_htab->srel##SECTION->contents); \
_loc = _htab->srel##SECTION->contents \
static ATTRIBUTE_UNUSED bfd_boolean
is_reloc_PC_relative (reloc_howto_type *howto)
{
- return (strstr (howto->name, "PC") != NULL) ? TRUE : FALSE;
+ return strstr (howto->name, "PC") != NULL;
}
static bfd_boolean
is_reloc_SDA_relative (reloc_howto_type *howto)
{
- return (strstr (howto->name, "SDA") != NULL) ? TRUE : FALSE;
+ return strstr (howto->name, "SDA") != NULL;
}
static bfd_boolean
{
if (strstr (howto->name, "TLS") != NULL)
return FALSE;
- return (strstr (howto->name, "GOT") != NULL) ? TRUE : FALSE;
+ return strstr (howto->name, "GOT") != NULL;
}
static bfd_boolean
is_reloc_for_PLT (reloc_howto_type * howto)
{
- return (strstr (howto->name, "PLT") != NULL) ? TRUE : FALSE;
+ return strstr (howto->name, "PLT") != NULL;
}
static bfd_boolean
is_reloc_for_TLS (reloc_howto_type *howto)
{
- return (strstr (howto->name, "TLS") != NULL) ? TRUE : FALSE;
+ return strstr (howto->name, "TLS") != NULL;
}
struct arc_relocation_data
/* DEFAULT mode accounts for the real bug condition situation,
ALL mode inserts stubs for each LDM/VLDM instruction (testing). */
- return
- (stm32l4xx_fix == BFD_ARM_STM32L4XX_FIX_DEFAULT) ? nb_words > 8 :
- (stm32l4xx_fix == BFD_ARM_STM32L4XX_FIX_ALL) ? TRUE : FALSE;
+ return (stm32l4xx_fix == BFD_ARM_STM32L4XX_FIX_DEFAULT
+ ? nb_words > 8
+ : stm32l4xx_fix == BFD_ARM_STM32L4XX_FIX_ALL);
}
/* Look for potentially-troublesome code sequences which might trigger
if (!*blank_p)
{
*blank_p = create_nds32_elf_blank (addr, len);
- return *blank_p ? TRUE : FALSE;
+ return *blank_p != NULL;
}
blank_t = search_nds32_elf_blank (*blank_p, addr);
is_tls_entry = TRUE;
}
- if (is_tls_entry == FALSE)
+ if (!is_tls_entry)
*got_size += 4;
if (dynamic)
if ((tls_type & TLS_IE) != 0)
*rela_size += sizeof (Elf32_External_Rela);
- if (is_tls_entry == FALSE)
+ if (!is_tls_entry)
*rela_size += sizeof (Elf32_External_Rela);
}
}
file_ptr offset,
bfd_size_type count)
{
- bfd_boolean exec = (abfd->flags & EXEC_P) ? TRUE : FALSE;
- bfd_boolean s_code = (section->flags & SEC_CODE) ? TRUE : FALSE;
+ bfd_boolean exec = (abfd->flags & EXEC_P) != 0;
+ bfd_boolean s_code = (section->flags & SEC_CODE) != 0;
bfd_boolean rv;
char * swapped_data = NULL;
bfd_size_type i;
relocate the text and data segments independently,
so the symbol does not matter. */
symbol = 0;
- relocate = globals->no_apply_dynamic_relocs ? FALSE : TRUE;
+ relocate = !globals->no_apply_dynamic_relocs;
outrel.r_info = ELFNN_R_INFO (symbol, AARCH64_R (RELATIVE));
outrel.r_addend += value;
}
bfd_boolean
_bfd_mips_elf_ignore_undef_symbol (struct elf_link_hash_entry *h)
{
- return ELF_MIPS_IS_OPTIONAL (h->other) ? TRUE : FALSE;
+ return ELF_MIPS_IS_OPTIONAL (h->other) != 0;
}
bfd_boolean
cmd = bfd_h_get_32 (abfd, raw.cmd);
command->type = cmd & ~BFD_MACH_O_LC_REQ_DYLD;
- command->type_required = cmd & BFD_MACH_O_LC_REQ_DYLD ? TRUE : FALSE;
+ command->type_required = (cmd & BFD_MACH_O_LC_REQ_DYLD) != 0;
command->len = bfd_h_get_32 (abfd, raw.cmdsize);
if (command->len < 8 || command->len % 4 != 0)
return FALSE;
if (! target_vec)
return NULL;
if (is_bigendian)
- *is_bigendian = ((target_vec->byteorder == BFD_ENDIAN_BIG) ? TRUE
- : FALSE);
+ *is_bigendian = target_vec->byteorder == BFD_ENDIAN_BIG;
if (underscoring)
*underscoring = ((int) target_vec->symbol_leading_char) & 0xff;
+2021-03-29 Alan Modra <amodra@gmail.com>
+
+ * dlltool.c (main): Don't use "boolean_condition ? TRUE : FALSE".
+ * dwarf.c (read_and_display_attr_value): Likewise.
+ (display_debug_str_offsets): Likewise.
+ * objdump.c (dump_bfd): Likewise.
+ * readelf.c (dump_section_as_strings): Likewise.
+ (dump_section_as_bytes): Likewise.
+
2021-03-29 Alan Modra <amodra@gmail.com>
* objdump.c (process_links): Use type int.
bfd_get_target_info (mtable[machine].how_bfd_target, NULL,
NULL, &u, NULL);
if (u != -1)
- leading_underscore = (u != 0 ? TRUE : FALSE);
+ leading_underscore = u != 0;
}
if (!dll_name && exp_name)
case DW_FORM_strx4:
if (!do_loc)
{
- const char * suffix = strrchr (section->name, '.');
- bfd_boolean dwo = (suffix && strcmp (suffix, ".dwo") == 0) ? TRUE : FALSE;
+ const char *suffix = strrchr (section->name, '.');
+ bfd_boolean dwo = suffix && strcmp (suffix, ".dwo") == 0;
if (do_wide)
/* We have already displayed the form name. */
unsigned char *end = start + section->size;
unsigned char *curr = start;
- const char * suffix = strrchr (section->name, '.');
- bfd_boolean dwo = (suffix && strcmp (suffix, ".dwo") == 0) ? TRUE : FALSE;
+ const char *suffix = strrchr (section->name, '.');
+ bfd_boolean dwo = suffix && strcmp (suffix, ".dwo") == 0;
if (dwo)
load_debug_section_with_follow (str_dwo, file);
{
if (!print_debugging_info (stdout, dhandle, abfd, syms,
bfd_demangle,
- dump_debugging_tags ? TRUE : FALSE))
+ dump_debugging_tags != 0))
{
non_fatal (_("%s: printing debugging information failed"),
bfd_get_filename (abfd));
real_start = start = (unsigned char *) get_section_contents (section, filedata);
if (start == NULL)
/* PR 21820: Do not fail if the section was empty. */
- return (section->sh_size == 0 || section->sh_type == SHT_NOBITS) ? TRUE : FALSE;
+ return section->sh_size == 0 || section->sh_type == SHT_NOBITS;
num_bytes = section->sh_size;
real_start = start = (unsigned char *) get_section_contents (section, filedata);
if (start == NULL)
/* PR 21820: Do not fail if the section was empty. */
- return (section->sh_size == 0 || section->sh_type == SHT_NOBITS) ? TRUE : FALSE;
+ return section->sh_size == 0 || section->sh_type == SHT_NOBITS;
section_size = section->sh_size;
+2021-03-29 Alan Modra <amodra@gmail.com>
+
+ * atof-generic.c (FALSE, TRUE): Don't define.
+ * config/obj-elf.h (FALSE, TRUE): Don't define.
+ * config/obj-som.h (FALSE, TRUE): Don't define.
+ * config/tc-hppa.h (FALSE, TRUE): Don't define.
+ * config/tc-pdp11.c (FALSE, TRUE): Don't define.
+ * config/tc-iq2000.h (obj_fix_adjustable): Delete.
+ * config/tc-m32r.h (TC_FIX_ADJUSTABLE): Delete.
+ * config/tc-mt.h (obj_fix_adjustable): Delete.
+ * config/tc-nds32.h (TC_FIX_ADJUSTABLE): Delete.
+ * config/tc-arc.c (parse_opcode_flags): Simplify boolean expression.
+ (relaxable_flag, relaxable_operand, assemble_insn): Likewise.
+ (tokenize_extregister): Likewise.
+ * config/tc-csky.c (parse_opcode, get_operand_value): Likewise.
+ (parse_operands_op, parse_operands, md_assemble): Likewise.
+ * config/tc-d10v.c (build_insn): Likewise.
+ * config/tc-score.c (s3_gen_insn_frag): Likewise.
+ * config/tc-score7.c (s7_gen_insn_frag, s7_relax_frag): Likewise.
+ * config/tc-tic6x.c (tic6x_update_features, md_assemble): Likewise.
+ * config/tc-z80.c (emit_byte): Likewise.
+
2021-03-29 Alan Modra <amodra@gmail.com>
* config/tc-arm.c (struct arm_long_option_table <func>): Return
#include "as.h"
#include "safe-ctype.h"
-#ifndef FALSE
-#define FALSE (0)
-#endif
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
#ifdef TRACE
static void flonum_print (const FLONUM_TYPE *);
#endif
#define OBJ_SYMFIELD_TYPE struct elf_obj_sy
-#ifndef FALSE
-#define FALSE 0
-#define TRUE !FALSE
-#endif
-
#ifndef obj_begin
#define obj_begin() elf_begin ()
#endif
#include "som/reloc.h"
#include "targ-cpu.h"
-#ifndef FALSE
-#define FALSE 0
-#define TRUE !FALSE
-#endif
-
/* should be conditional on address size! */
#define som_symbol(asymbol) ((som_symbol_type *) (&(asymbol)->the_bfd))
}
/* Did I check all the parsed flags? */
- return lnflg ? FALSE : TRUE;
+ return lnflg == 0;
}
}
/* If counttrue == nflgs, then all flags have been found. */
- return (counttrue == nflgs ? TRUE : FALSE);
+ return counttrue == nflgs;
}
/* Checks if operands are in line with relaxable insn. */
operand = &ins->operands[i];
}
- return (i == ntok ? TRUE : FALSE);
+ return i == ntok;
}
/* Return TRUE if this OPDCODE is a candidate for relaxation. */
pcrel = reloc_howto->pc_relative;
}
fixup->pcrel = pcrel;
- fixup->islong = (operand->flags & ARC_OPERAND_LIMM) ?
- TRUE : FALSE;
+ fixup->islong = (operand->flags & ARC_OPERAND_LIMM) != 0;
break;
}
}
char c;
char *p;
int number, imode = 0;
- bfd_boolean isCore_p = (opertype == EXT_CORE_REGISTER) ? TRUE : FALSE;
- bfd_boolean isReg_p = (opertype == EXT_CORE_REGISTER
- || opertype == EXT_AUX_REGISTER) ? TRUE : FALSE;
+ bfd_boolean isCore_p = opertype == EXT_CORE_REGISTER;
+ bfd_boolean isReg_p = opertype == EXT_CORE_REGISTER || opertype == EXT_AUX_REGISTER;
/* 1st: get register name. */
SKIP_WHITESPACE ();
{
/* Is csky force 32 or 16 instruction? */
if (IS_CSKY_V2 (mach_flag)
- && *opcode_end == '.' && has_suffix == FALSE)
+ && *opcode_end == '.' && !has_suffix)
{
has_suffix = TRUE;
if (IS_OPCODE32F (opcode_end))
}
/* Is csky force 32 or 16 instruction? */
- if (has_suffix == FALSE)
+ if (!has_suffix)
{
if (IS_CSKY_V2 (mach_flag) && IS_OPCODE32F (opcode_end))
{
name[nlen] = '\0';
/* Generate macro_name for finding hash in macro hash_table. */
- if (has_suffix == TRUE)
+ if (has_suffix)
nlen += 2;
strncpy (macro_name, str, nlen);
macro_name[nlen] = '\0';
return FALSE;
}
- if (get_operand_value (op, oper, &soprnd->subs[0]) == FALSE)
+ if (!get_operand_value (op, oper, &soprnd->subs[0]))
{
*s = rc;
return FALSE;
return FALSE;
}
- if (get_operand_value (op, oper, &soprnd->subs[1]) == FALSE)
+ if (!get_operand_value (op, oper, &soprnd->subs[1]))
{
*s = rc;
return FALSE;
int val = csky_insn.val[csky_insn.idx - 1];
log = csky_log_2 (val);
csky_insn.val[csky_insn.idx - 1] = log;
- return (log == -1 ? FALSE : TRUE);
+ return log != -1;
}
else
return FALSE;
}
else
csky_insn.val[csky_insn.idx - 1] = log;
- return (log == -1 ? FALSE : TRUE);
+ return log != -1;
}
else
return FALSE;
else
{
csky_insn.val[csky_insn.idx] = 0;
- if (is_psr_bit (oper) != FALSE)
+ if (is_psr_bit (oper))
while (**oper == ',')
{
*oper += 1;
- if (is_psr_bit (oper) == FALSE)
+ if (!is_psr_bit (oper))
{
ret = FALSE;
break;
}
else
ret = FALSE;
- if (ret == TRUE && IS_CSKY_V1 (mach_flag)
+ if (ret && IS_CSKY_V1 (mach_flag)
&& csky_insn.val[csky_insn.idx] > 8)
ret = FALSE;
}
oper++;
flag_pass = get_operand_value (&op[i], &oper,
&op[i].oprnd.oprnds[j]);
- if (flag_pass == FALSE)
+ if (!flag_pass)
break;
while (ISSPACE (*oper))
oper++;
}
/* Parse operands in one table end. */
- if (flag_pass == TRUE)
+ if (flag_pass)
{
/* Parse operands success, set opcode_idx. */
csky_insn.opcode_idx = i;
if (csky_insn.flag_force == INSN_OPCODE16F
&& (csky_insn.opcode->isa_flag16 & isa_flag) != 0)
{
- if (parse_operands_op (oper, csky_insn.opcode->op16) == TRUE)
+ if (parse_operands_op (oper, csky_insn.opcode->op16))
{
csky_insn.isize = 2;
return TRUE;
else if (csky_insn.flag_force == INSN_OPCODE32F
&& (csky_insn.opcode->isa_flag32 & isa_flag) != 0)
{
- if (parse_operands_op (oper, csky_insn.opcode->op32) == TRUE)
+ if (parse_operands_op (oper, csky_insn.opcode->op32))
{
csky_insn.isize = 4;
return TRUE;
else
{
if ((csky_insn.opcode->isa_flag16 & isa_flag) != 0
- && parse_operands_op (oper, csky_insn.opcode->op16) == TRUE)
+ && parse_operands_op (oper, csky_insn.opcode->op16))
{
csky_insn.isize = 2;
return TRUE;
}
if ((csky_insn.opcode->isa_flag32 & isa_flag) != 0
- && parse_operands_op (oper, csky_insn.opcode->op32) == TRUE)
+ && parse_operands_op (oper, csky_insn.opcode->op32))
{
csky_insn.isize = 4;
return TRUE;
while (ISSPACE (* str))
str++;
/* Get opcode from str. */
- if (parse_opcode (str) == FALSE)
+ if (!parse_opcode (str))
{
csky_show_error (ERROR_OPCODE_ILLEGAL, 0, NULL, NULL);
return;
}
/* Parse the operands according to operand type. */
- if (parse_operands (csky_insn.opcode_end) == FALSE)
+ if (!parse_operands (csky_insn.opcode_end))
{
csky_show_error (error_state.err_num, error_state.opnum,
(void *)error_state.arg1, (void *)error_state.arg1);
}
/* Adjust for xtrb0/xtrb1/xtrb2/xtrb3/divs/divu in csky v1 ISA. */
- if (mov_r1_after == TRUE)
+ if (mov_r1_after)
{
unsigned int mov_insn = CSKYV1_INST_MOV_RX_R1;
mov_insn |= csky_insn.val[0];
md_number_to_chars (csky_insn.output, mov_insn, 2);
csky_insn.isize += 2;
}
- if (mov_r1_before == TRUE)
+ if (mov_r1_before)
csky_insn.isize += 2;
/* Check literal. */
fixups->fix[fixups->fc].exp = opers[i];
fixups->fix[fixups->fc].operand = opcode->operands[i];
- fixups->fix[fixups->fc].pcrel =
- (flags & OPERAND_ADDR) ? TRUE : FALSE;
+ fixups->fix[fixups->fc].pcrel = (flags & OPERAND_ADDR) != 0;
(fixups->fc)++;
}
#define WARN_COMMENTS 1
#endif
-/* FIXME. Why oh why aren't these defined somewhere globally? */
-#ifndef FALSE
-#define FALSE (0)
-#define TRUE (!FALSE)
-#endif
-
#define ASEC_NULL (asection *)0
/* pa_define_label gets used outside of tc-hppa.c via tc_frob_label. */
#define tc_frob_file() iq2000_frob_file ()
-#define obj_fix_adjustable(fixP) iq2000_fix_adjustable (fixP)
-
/* After creating a fixup for an instruction operand, we need to check
for HI16 relocs and queue them up for later sorting. */
#define md_cgen_record_fixup_exp iq2000_cgen_record_fixup_exp
#define md_apply_fix gas_cgen_md_apply_fix
#define tc_fix_adjustable(FIX) m32r_fix_adjustable (FIX)
-bfd_boolean m32r_fix_adjustable (struct fix *);
+extern bfd_boolean m32r_fix_adjustable (struct fix *);
/* After creating a fixup for an instruction operand, we need to check for
HI16 relocs and queue them up for later sorting. */
extern int pic_code;
-extern bfd_boolean m32r_fix_adjustable (struct fix *);
-
-/* This arranges for gas/write.c to not apply a relocation if
- obj_fix_adjustable() says it is not adjustable. */
-#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP)
-
#define tc_frob_file_before_fix() m32r_frob_file ()
extern void m32r_frob_file (void);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
-#define obj_fix_adjustable(fixP) iq2000_fix_adjustable (fixP)
-extern bfd_boolean mt_fix_adjustable (struct fix *);
-
/* Values passed to md_apply_fix don't include the symbol value. */
#define MD_APPLY_SYM_VALUE(FIX) 0
&& S_IS_DEFINED ((FIX)->fx_addsy) \
&& ! S_IS_COMMON ((FIX)->fx_addsy)))
#define TC_HANDLES_FX_DONE
-/* This arranges for gas/write.c to not apply a relocation if
- obj_fix_adjustable() says it is not adjustable. */
-#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP)
#endif
/* Because linker may relax the code, assemble-time expression
extern int flonum_gen2vax (int, FLONUM_TYPE * f, LITTLENUM_TYPE *);
-#define TRUE 1
-#define FALSE 0
-
/* A representation for PDP-11 machine code. */
struct pdp11_code
{
struct s3_score_it *inst2 = part_2;
struct s3_score_it backup_inst1;
- pce_p = (inst2) ? TRUE : FALSE;
+ pce_p = inst2 != NULL;
memcpy (&backup_inst1, inst1, sizeof (struct s3_score_it));
/* Adjust instruction opcode and to be relaxed instruction opcode. */
struct s7_score_it *inst2 = part_2;
struct s7_score_it backup_inst1;
- pce_p = (inst2) ? TRUE : FALSE;
+ pce_p = inst2 != NULL;
memcpy (&backup_inst1, inst1, sizeof (struct s7_score_it));
/* Adjust instruction opcode and to be relaxed instruction opcode. */
}
}
- word_align_p = ((fragp->fr_address + fragp->insn_addr) % 4 == 0) ? TRUE : FALSE;
+ word_align_p = (fragp->fr_address + fragp->insn_addr) % 4 == 0;
/* Get instruction size and relax size after the last relaxation. */
if (fragp->fr_opcode)
tic6x_num_registers
= (tic6x_arch_enable & (TIC6X_INSN_C64X | TIC6X_INSN_C67XP)) ? 32 : 16;
- tic6x_predicate_a0 = (tic6x_arch_enable & TIC6X_INSN_C64X) ? TRUE : FALSE;
+ tic6x_predicate_a0 = (tic6x_arch_enable & TIC6X_INSN_C64X) != 0;
tic6x_can_cross_fp_boundary
- = (tic6x_arch_enable
- & (TIC6X_INSN_C64X | TIC6X_INSN_C67XP)) ? TRUE : FALSE;
+ = (tic6x_arch_enable & (TIC6X_INSN_C64X | TIC6X_INSN_C67XP)) != 0;
- tic6x_long_data_constraints
- = (tic6x_arch_enable & TIC6X_INSN_C64X) ? FALSE : TRUE;
+ tic6x_long_data_constraints = (tic6x_arch_enable & TIC6X_INSN_C64X) == 0;
- tic6x_compact_insns = (tic6x_arch_enable & TIC6X_INSN_C64XP) ? TRUE : FALSE;
+ tic6x_compact_insns = (tic6x_arch_enable & TIC6X_INSN_C64XP) != 0;
}
/* Do configuration after all options have been parsed. */
seginfo->tc_segment_info_data.sploop_ii,
&fix_exp, &fix_pcrel, &fx_r_type,
&fix_adda, &fix_needed, &encoded_ok,
- (try_rank == min_rank ? TRUE : FALSE),
+ try_rank == min_rank,
str, opc_len);
if (encoded_ok)
{
{
/* For symbols only, constants are stored at begin of function. */
fix_new_exp (frag_now, p - frag_now->fr_literal, 1, val,
- (r_type == BFD_RELOC_8_PCREL) ? TRUE : FALSE, r_type);
+ r_type == BFD_RELOC_8_PCREL, r_type);
}
}
+2021-03-29 Alan Modra <amodra@gmail.com>
+
+ * opcode/aarch64.h (alias_opcode_p): Simplify boolean expression.
+ (opcode_has_alias, pseudo_opcode_p, optional_operand_p): Likewise.
+ (opcode_has_special_coder): Likewise.
+
2021-03-29 Alan Modra <amodra@gmail.com>
* opcode/aarch64.h (aarch64_opcode_encode): Correct prototype.
static inline bfd_boolean
alias_opcode_p (const aarch64_opcode *opcode)
{
- return (opcode->flags & F_ALIAS) ? TRUE : FALSE;
+ return (opcode->flags & F_ALIAS) != 0;
}
static inline bfd_boolean
opcode_has_alias (const aarch64_opcode *opcode)
{
- return (opcode->flags & F_HAS_ALIAS) ? TRUE : FALSE;
+ return (opcode->flags & F_HAS_ALIAS) != 0;
}
/* Priority for disassembling preference. */
static inline bfd_boolean
pseudo_opcode_p (const aarch64_opcode *opcode)
{
- return (opcode->flags & F_PSEUDO) != 0lu ? TRUE : FALSE;
+ return (opcode->flags & F_PSEUDO) != 0lu;
}
static inline bfd_boolean
optional_operand_p (const aarch64_opcode *opcode, unsigned int idx)
{
- return (((opcode->flags >> 12) & 0x7) == idx + 1)
- ? TRUE : FALSE;
+ return ((opcode->flags >> 12) & 0x7) == idx + 1;
}
static inline aarch64_insn
opcode_has_special_coder (const aarch64_opcode *opcode)
{
return (opcode->flags & (F_SF | F_LSE_SZ | F_SIZEQ | F_FPTYPE | F_SSIZE | F_T
- | F_GPRSIZE_IN_Q | F_LDS_SIZE | F_MISC | F_N | F_COND)) ? TRUE
- : FALSE;
+ | F_GPRSIZE_IN_Q | F_LDS_SIZE | F_MISC | F_N | F_COND)) != 0;
}
\f
struct aarch64_name_value_pair
+2021-03-29 Alan Modra <amodra@gmail.com>
+
+ * emultempl/aix.em (gld${EMULATION_NAME}_before_allocation): Simplify
+ boolean expression.
+ * lexsup.c (parse_args): Likewise.
+ * pe-dll.c (pe_dll_id_target): Likewise.
+
2021-03-25 Nick Alcock <nick.alcock@oracle.com>
* testsuite/ld-ctf/array.d: Only check that the data object
/* Let the XCOFF backend set up the .loader section. */
if (!bfd_xcoff_size_dynamic_sections
(link_info.output_bfd, &link_info, libpath, entry_symbol.name, file_align,
- maxstack, maxdata, gc && !unix_ld ? TRUE : FALSE,
- modtype, textro ? TRUE : FALSE, flags, special_sections,
- rtld ? TRUE : FALSE))
+ maxstack, maxdata, gc && !unix_ld,
+ modtype, textro, flags, special_sections, rtld))
einfo (_("%F%P: failed to set dynamic section sizes: %E\n"));
/* Look through the special sections, and put them in the right
getopt can't handle two args to an option without kludges. */
/* Enable optimizations of output files. */
- link_info.optimize = strtoul (optarg, NULL, 0) ? TRUE : FALSE;
+ link_info.optimize = strtoul (optarg, NULL, 0) != 0;
break;
case 'o':
lang_add_output (optarg, 0);
bfd_get_target_info (target, NULL, NULL, &u, NULL);
if (u == -1)
abort ();
- pe_detail_list[i].underscored = (u != 0 ? TRUE : FALSE);
+ pe_detail_list[i].underscored = u != 0;
pe_details = pe_detail_list + i;
pe_leading_underscore = (u != 0 ? 1 : 0);
return;
+2021-03-29 Alan Modra <amodra@gmail.com>
+
+ * aarch64-opc.c (vector_qualifier_p): Simplify boolean expression.
+ (fp_qualifier_p, get_data_pattern): Likewise.
+ (aarch64_get_operand_modifier_from_value): Likewise.
+ (aarch64_extend_operator_p, aarch64_shift_operator_p): Likewise.
+ (operand_variant_qualifier_p): Likewise.
+ (qualifier_value_in_range_constraint_p): Likewise.
+ (aarch64_get_qualifier_esize): Likewise.
+ (aarch64_get_qualifier_nelem): Likewise.
+ (aarch64_get_qualifier_standard_value): Likewise.
+ (get_lower_bound, get_upper_bound): Likewise.
+ (aarch64_find_best_match, match_operands_qualifier): Likewise.
+ (aarch64_print_operand): Likewise.
+ * aarch64-opc.h (operand_has_inserter, operand_has_extractor): Likewise.
+ (operand_need_sign_extension, operand_need_shift_by_two): Likewise.
+ (operand_need_shift_by_four, operand_maybe_stack_pointer): Likewise.
+ * arm-dis.c (print_insn_mve, print_insn_thumb32): Likewise.
+ * tic6x-dis.c (tic6x_check_fetch_packet_header): Likewise.
+ (print_insn_tic6x): Likewise.
+
2021-03-29 Alan Modra <amodra@gmail.com>
* arc-dis.c (extract_operand_value): Correct NULL cast.
static inline bfd_boolean
vector_qualifier_p (enum aarch64_opnd_qualifier qualifier)
{
- return ((qualifier >= AARCH64_OPND_QLF_V_8B
- && qualifier <= AARCH64_OPND_QLF_V_1Q) ? TRUE
- : FALSE);
+ return (qualifier >= AARCH64_OPND_QLF_V_8B
+ && qualifier <= AARCH64_OPND_QLF_V_1Q);
}
static inline bfd_boolean
fp_qualifier_p (enum aarch64_opnd_qualifier qualifier)
{
- return ((qualifier >= AARCH64_OPND_QLF_S_B
- && qualifier <= AARCH64_OPND_QLF_S_Q) ? TRUE
- : FALSE);
+ return (qualifier >= AARCH64_OPND_QLF_S_B
+ && qualifier <= AARCH64_OPND_QLF_S_Q);
}
enum data_pattern
static enum data_pattern
get_data_pattern (const aarch64_opnd_qualifier_seq_t qualifiers)
{
- if (vector_qualifier_p (qualifiers[0]) == TRUE)
+ if (vector_qualifier_p (qualifiers[0]))
{
/* e.g. v.4s, v.4s, v.4s
or v.4h, v.4h, v.h[3]. */
if (qualifiers[0] == qualifiers[1]
- && vector_qualifier_p (qualifiers[2]) == TRUE
+ && vector_qualifier_p (qualifiers[2])
&& (aarch64_get_qualifier_esize (qualifiers[0])
== aarch64_get_qualifier_esize (qualifiers[1]))
&& (aarch64_get_qualifier_esize (qualifiers[0])
/* e.g. v.8h, v.8b, v.8b.
or v.4s, v.4h, v.h[2].
or v.8h, v.16b. */
- if (vector_qualifier_p (qualifiers[1]) == TRUE
+ if (vector_qualifier_p (qualifiers[1])
&& aarch64_get_qualifier_esize (qualifiers[0]) != 0
&& (aarch64_get_qualifier_esize (qualifiers[0])
== aarch64_get_qualifier_esize (qualifiers[1]) << 1))
return DP_VECTOR_LONG;
/* e.g. v.8h, v.8h, v.8b. */
if (qualifiers[0] == qualifiers[1]
- && vector_qualifier_p (qualifiers[2]) == TRUE
+ && vector_qualifier_p (qualifiers[2])
&& aarch64_get_qualifier_esize (qualifiers[0]) != 0
&& (aarch64_get_qualifier_esize (qualifiers[0])
== aarch64_get_qualifier_esize (qualifiers[2]) << 1)
== aarch64_get_qualifier_esize (qualifiers[1])))
return DP_VECTOR_WIDE;
}
- else if (fp_qualifier_p (qualifiers[0]) == TRUE)
+ else if (fp_qualifier_p (qualifiers[0]))
{
/* e.g. SADDLV <V><d>, <Vn>.<T>. */
- if (vector_qualifier_p (qualifiers[1]) == TRUE
+ if (vector_qualifier_p (qualifiers[1])
&& qualifiers[2] == AARCH64_OPND_QLF_NIL)
return DP_VECTOR_ACROSS_LANES;
}
aarch64_get_operand_modifier_from_value (aarch64_insn value,
bfd_boolean extend_p)
{
- if (extend_p == TRUE)
+ if (extend_p)
return AARCH64_MOD_UXTB + value;
else
return AARCH64_MOD_LSL - value;
bfd_boolean
aarch64_extend_operator_p (enum aarch64_modifier_kind kind)
{
- return (kind > AARCH64_MOD_LSL && kind <= AARCH64_MOD_SXTX)
- ? TRUE : FALSE;
+ return kind > AARCH64_MOD_LSL && kind <= AARCH64_MOD_SXTX;
}
static inline bfd_boolean
aarch64_shift_operator_p (enum aarch64_modifier_kind kind)
{
- return (kind >= AARCH64_MOD_ROR && kind <= AARCH64_MOD_LSL)
- ? TRUE : FALSE;
+ return kind >= AARCH64_MOD_ROR && kind <= AARCH64_MOD_LSL;
}
const struct aarch64_name_value_pair aarch64_barrier_options[16] =
static inline bfd_boolean
operand_variant_qualifier_p (aarch64_opnd_qualifier_t qualifier)
{
- return (aarch64_opnd_qualifiers[qualifier].kind == OQK_OPD_VARIANT)
- ? TRUE : FALSE;
+ return aarch64_opnd_qualifiers[qualifier].kind == OQK_OPD_VARIANT;
}
static inline bfd_boolean
qualifier_value_in_range_constraint_p (aarch64_opnd_qualifier_t qualifier)
{
- return (aarch64_opnd_qualifiers[qualifier].kind == OQK_VALUE_IN_RANGE)
- ? TRUE : FALSE;
+ return aarch64_opnd_qualifiers[qualifier].kind == OQK_VALUE_IN_RANGE;
}
const char*
unsigned char
aarch64_get_qualifier_esize (aarch64_opnd_qualifier_t qualifier)
{
- assert (operand_variant_qualifier_p (qualifier) == TRUE);
+ assert (operand_variant_qualifier_p (qualifier));
return aarch64_opnd_qualifiers[qualifier].data0;
}
unsigned char
aarch64_get_qualifier_nelem (aarch64_opnd_qualifier_t qualifier)
{
- assert (operand_variant_qualifier_p (qualifier) == TRUE);
+ assert (operand_variant_qualifier_p (qualifier));
return aarch64_opnd_qualifiers[qualifier].data1;
}
aarch64_insn
aarch64_get_qualifier_standard_value (aarch64_opnd_qualifier_t qualifier)
{
- assert (operand_variant_qualifier_p (qualifier) == TRUE);
+ assert (operand_variant_qualifier_p (qualifier));
return aarch64_opnd_qualifiers[qualifier].data2;
}
static int
get_lower_bound (aarch64_opnd_qualifier_t qualifier)
{
- assert (qualifier_value_in_range_constraint_p (qualifier) == TRUE);
+ assert (qualifier_value_in_range_constraint_p (qualifier));
return aarch64_opnd_qualifiers[qualifier].data0;
}
static int
get_upper_bound (aarch64_opnd_qualifier_t qualifier)
{
- assert (qualifier_value_in_range_constraint_p (qualifier) == TRUE);
+ assert (qualifier_value_in_range_constraint_p (qualifier));
return aarch64_opnd_qualifiers[qualifier].data1;
}
/* Most opcodes has much fewer patterns in the list.
First NIL qualifier indicates the end in the list. */
- if (empty_qualifier_sequence_p (qualifiers) == TRUE)
+ if (empty_qualifier_sequence_p (qualifiers))
{
DEBUG_TRACE_IF (i == 0, "SUCCEED: empty qualifier list");
if (i)
Return 1 if the operand qualifier(s) in *INST match one of the qualifier
sequences in INST->OPCODE->qualifiers_list; otherwise return 0.
- if UPDATE_P == TRUE, update the qualifier(s) in *INST after the matching
+ if UPDATE_P, update the qualifier(s) in *INST after the matching
succeeds. */
static int
}
/* Update the qualifiers. */
- if (update_p == TRUE)
+ if (update_p)
for (i = 0; i < AARCH64_MAX_OPND_NUM; ++i)
{
if (inst->opcode->operands[i] == AARCH64_OPND_NIL)
case AARCH64_OPND_UIMM4_ADDG:
case AARCH64_OPND_UIMM7:
case AARCH64_OPND_UIMM10:
- if (optional_operand_p (opcode, idx) == TRUE
+ if (optional_operand_p (opcode, idx)
&& (opnd->imm.value ==
(int64_t) get_optional_operand_default_value (opcode)))
/* Omit the operand, e.g. DCPS1. */
static inline bfd_boolean
operand_has_inserter (const aarch64_operand *operand)
{
- return (operand->flags & OPD_F_HAS_INSERTER) ? TRUE : FALSE;
+ return (operand->flags & OPD_F_HAS_INSERTER) != 0;
}
static inline bfd_boolean
operand_has_extractor (const aarch64_operand *operand)
{
- return (operand->flags & OPD_F_HAS_EXTRACTOR) ? TRUE : FALSE;
+ return (operand->flags & OPD_F_HAS_EXTRACTOR) != 0;
}
static inline bfd_boolean
operand_need_sign_extension (const aarch64_operand *operand)
{
- return (operand->flags & OPD_F_SEXT) ? TRUE : FALSE;
+ return (operand->flags & OPD_F_SEXT) != 0;
}
static inline bfd_boolean
operand_need_shift_by_two (const aarch64_operand *operand)
{
- return (operand->flags & OPD_F_SHIFT_BY_2) ? TRUE : FALSE;
+ return (operand->flags & OPD_F_SHIFT_BY_2) != 0;
}
static inline bfd_boolean
operand_need_shift_by_four (const aarch64_operand *operand)
{
- return (operand->flags & OPD_F_SHIFT_BY_4) ? TRUE : FALSE;
+ return (operand->flags & OPD_F_SHIFT_BY_4) != 0;
}
static inline bfd_boolean
operand_maybe_stack_pointer (const aarch64_operand *operand)
{
- return (operand->flags & OPD_F_MAYBE_SP) ? TRUE : FALSE;
+ return (operand->flags & OPD_F_MAYBE_SP) != 0;
}
/* Return the value of the operand-specific data field (OPD_F_OD_MASK). */
if (is_undefined)
print_mve_undefined (info, undefined_cond);
- if ((vpt_block_state.in_vpt_block == FALSE)
+ if (!vpt_block_state.in_vpt_block
&& !ifthen_state
- && (is_vpt_instruction (given) == TRUE))
+ && is_vpt_instruction (given))
mark_inside_vpt_block (given);
- else if (vpt_block_state.in_vpt_block == TRUE)
+ else if (vpt_block_state.in_vpt_block)
update_vpt_block_state ();
return TRUE;
if (print_insn_coprocessor (pc, info, given, TRUE))
return;
- if ((is_mve == FALSE) && print_insn_neon (info, given, TRUE))
+ if (!is_mve && print_insn_neon (info, given, TRUE))
return;
if (is_mve && print_insn_mve (info, given))
for (i = 0; i < 7; i++)
header->word_compact[i]
- = (header->header & (1u << (21 + i))) ? TRUE : FALSE;
+ = (header->header & (1u << (21 + i))) != 0;
- header->prot = (header->header & (1u << 20)) ? TRUE : FALSE;
- header->rs = (header->header & (1u << 19)) ? TRUE : FALSE;
+ header->prot = (header->header & (1u << 20)) != 0;
+ header->rs = (header->header & (1u << 19)) != 0;
header->dsz = (header->header >> 16) & 0x7;
- header->br = (header->header & (1u << 15)) ? TRUE : FALSE;
- header->sat = (header->header & (1u << 14)) ? TRUE : FALSE;
+ header->br = (header->header & (1u << 15)) != 0;
+ header->sat = (header->header & (1u << 14)) != 0;
for (i = 0; i < 14; i++)
- header->p_bits[i]
- = (header->header & (1u << i)) ? TRUE : FALSE;
+ header->p_bits[i] = (header->header & (1u << i)) != 0;
return TRUE;
}
{
unsigned int prev_opcode
= tic6x_extract_32 (fp + (fp_offset & 0x1c) - 4, info);
- p_bit = (prev_opcode & 0x1) ? TRUE : FALSE;
+ p_bit = (prev_opcode & 0x1) != 0;
}
}
else
{
unsigned int prev_opcode = tic6x_extract_32 (fp_prev + 24,
info);
- p_bit = (prev_opcode & 0x1) ? TRUE : FALSE;
+ p_bit = (prev_opcode & 0x1) != 0;
}
}
else
{
unsigned int prev_opcode = tic6x_extract_32 (fp_prev + 28,
info);
- p_bit = (prev_opcode & 0x1) ? TRUE : FALSE;
+ p_bit = (prev_opcode & 0x1) != 0;
}
}
}
printf ("opcode %x: illegal cross path specifier in adda opcode!\n", opcode);
abort ();
}
- func_unit_cross = (func_unit_side == 1 ? TRUE : FALSE);
+ func_unit_cross = func_unit_side == 1;
}
switch (opc->func_unit)
side = func_unit_side == 2 ? 'b' : 'a';
snprintf (base, 4, "%c%u", side, mem_base_reg);
- offset_is_reg = ((mem_mode & 4) ? TRUE : FALSE);
+ offset_is_reg = (mem_mode & 4) != 0;
if (offset_is_reg)
{
snprintf (offset, 4, "%c%u", side, reg_base + mem_offset);
if (opc->operand_info[op_num].form
== tic6x_operand_mem_ndw)
- offset_scaled = mem_scaled ? TRUE : FALSE;
+ offset_scaled = mem_scaled != 0;
else
offset_scaled = TRUE;
}
if (opc->operand_info[op_num].form
== tic6x_operand_mem_ndw)
{
- offset_scaled = mem_scaled ? TRUE : FALSE;
+ offset_scaled = mem_scaled != 0;
snprintf (offset, 4, "%u", mem_offset);
}
else