aboutsummaryrefslogtreecommitdiff
path: root/gas/config
AgeCommit message (Collapse)AuthorFilesLines
2025-02-03RISC-V: use is_whitespace()Jan Beulich1-8/+9
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Switch places already checking for tabs to use the macro, too.
2025-02-03pru: use is_whitespace()Jan Beulich1-2/+2
Convert open-coded checks as well as an ISSPACE() use.
2025-02-03PPC: use is_whitespace()Jan Beulich1-5/+5
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also switch ISSPACE() uses over. At the same time use is_end_of_stmt() instead of an open-coded nul char check.
2025-02-03PicoJava: use is_whitespace()Jan Beulich1-3/+3
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert ISSPACE(). At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code.
2025-02-03PDP11: use is_whitespace()Jan Beulich1-2/+2
Convert open-coded checks.
2025-02-03NS32k: use is_whitespace()Jan Beulich1-1/+3
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input).
2025-02-03nds32: use is_whitespace()Jan Beulich1-5/+5
Convert ISSPACE() uses.
2025-02-03msp430: use is_whitespace()Jan Beulich1-12/+10
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert ISSPACE() uses. At the same time use is_end_of_stmt() instead of open-coded checking in code needing touching anyway.
2025-02-03Moxie: use is_whitespace()Jan Beulich1-29/+26
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert ISSPACE() uses. At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code. While at it also drop a redundant whitespace skipping loop.
2025-02-03mn10300: use is_whitespace()Jan Beulich1-6/+6
Convert open-coded checks as well as ISSPACE() uses. At the same time use is_end_of_stmt() instead of kind-of-open-coded checks in adjacent code.
2025-02-03mn10200: use is_whitespace()Jan Beulich1-6/+6
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert open-coded checks as well as ISSPACE() uses. At the same time use is_end_of_stmt() instead of kind-of-open- coded checks in adjacent code.
2025-02-03MIPS: use is_whitespace()Jan Beulich1-9/+12
... for consistency of recognition of what is deemed whitespace. At the same time use is_end_of_stmt() instead of an open-coded nul char check, and check for statement end in the first place in parse_relocation().
2025-02-03MicroBlaze: use is_whitespace()Jan Beulich1-5/+5
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert ISSPACE() uses. At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code.
2025-02-03metag: use is_whitespace()Jan Beulich1-5/+4
Replace the custom is_whitespace_char().
2025-02-03M*Core: use is_whitespace()Jan Beulich1-36/+36
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert ISSPACE() uses. At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code.
2025-02-03M68k: use is_whitespace()Jan Beulich2-29/+30
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert open-coded checks where tabs were already included. At the same time use is_end_of_stmt() instead of open- coded checks in adjacent code.
2025-02-03M68HC1x: use is_whitespace()Jan Beulich1-10/+10
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert open-coded checks where tabs were already included. At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code.
2025-02-03m32r: use is_whitespace()Jan Beulich1-1/+1
Convert a lonely ISSPACE().
2025-02-03m32c: use is_whitespace()Jan Beulich1-5/+5
Convert open-coded checks as well as the sole ISBLANK() use throughout the gas/ tree.
2025-02-03LoongArch: use is_whitespace()Jan Beulich1-2/+2
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input).
2025-02-03kvx: use is_whitespace()Jan Beulich2-8/+11
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert open-coded checks where tabs were already included. At the same time use is_end_of_stmt() instead of open- coded checks in adjacent code.
2025-02-03HP-PA: use is_whitespace()Jan Beulich1-23/+29
Convert open-coded checks. At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code.
2025-02-03H8/300: use is_whitespace()Jan Beulich1-2/+2
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code.
2025-02-03ft32: use is_whitespace()Jan Beulich1-10/+9
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also switch ISSPACE() uses over. At the same time use is_end_of_stmt() instead of open-coded checks in adjacent code.
2025-02-03fr30: use is_whitespace()Jan Beulich1-4/+4
Convert open-coded checks. At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code.
2025-02-03Epiphany: use is_whitespace()Jan Beulich1-2/+2
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input).
2025-02-03CRx: use is_whitespace()Jan Beulich1-6/+6
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also switch ISSPACE() uses over.
2025-02-03cris: use is_whitespace()Jan Beulich1-3/+3
Switch ISSPACE() uses over. Unlike many other targets, limiting whitespace checks to just blanks is deemed okay here: Compilers wanting to use -f / #NO_APP are apparently required to emit only blanks (without this being written down anywhere).
2025-02-03CR16: use is_whitespace()Jan Beulich1-4/+5
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also switch ISSPACE() uses over.
2025-02-03C-Sky: use is_whitespace()Jan Beulich1-11/+11
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also switch ISSPACE() uses over. At the same time use is_end_of_stmt() instead of kind-of-open-coded checks.
2025-02-03dlx: use is_whitespace()Jan Beulich1-7/+7
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert open-coded checks where tabs were already included.
2025-02-03d30v: use is_whitespace()Jan Beulich1-6/+6
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert open-coded checks where tabs were already included. At the same time use is_end_of_stmt() instead of open- coded checks in adjacent code.
2025-02-03d10v: use is_whitespace()Jan Beulich1-6/+5
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert open-coded checks where tabs were already included. At the same time use is_end_of_stmt() instead of open- coded checks in adjacent code.
2025-02-03bpf: use is_whitespace()Jan Beulich1-9/+9
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Various redundant nul char checks are also dropped, where adjacent. At the same time use is_end_of_stmt() instead of an open-coded nul char check.
2025-02-03bfin: use is_whitespace()Jan Beulich1-1/+2
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input).
2025-02-03gas/obj-*.c: use is_whitespace()Jan Beulich4-12/+10
... for consistency of recognition of what is deemed whitespace. In obj_elf_section_name() also generalize end-of-statement recognition at the same time. Conversely drop the unused SKIP_SEMI_COLON() for COFF.
2025-02-03avr: use is_whitespace()Jan Beulich1-1/+1
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input).
2025-02-03aarch64: use is_whitespace()Jan Beulich1-1/+1
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input).
2025-02-03Arm: use is_whitespace()Jan Beulich1-21/+15
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). At the same time use is_end_of_stmt() instead of an open-coded nul char check. In parse_neon_type() be more aggressive and remove the special casing of certain characters altogether. The original default case simply having "break" can't have been correct.
2025-02-03arc: use is_whitespace()Jan Beulich1-6/+6
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). At the same time use is_end_of_stmt() instead of open-coded nul char checks.
2025-02-03Alpha/EVAX: use is_whitespace() / is_end_of_stmt()Jan Beulich1-1/+1
Don't open-code checking for ' ', '\t', and statement ending chars.
2025-01-31aarch64: Support +sme+nosve permissivelyAndrew Carlotti1-1/+22
There is inconsistency regarding whether or not +sme implies +sve2 and whether +nosve2 implies +nosme. In particular, GCC 14 assumes the dependency exists, and canonicalises target strings accordingly, whereas LLVM treats the features as independent. This patch removes the positive implication while retaining the negative implication. This is the more permissive choice in each case, and allows us to support target strings written with either interpretation in mind. This reduces our ability to detect invalid instructions, but we already can't rely on this detection because gas doesn't know whether functions might be executed in streaming mode and/or non-streaming mode. The aarch64_feature_enable_set change is functionally redundant within this patch. It is included because the longer term intention is to instead remove the workaround in aarch64_parse_features, once the internal feature checks have been modified to support having both AARCH64_FEATURE_SME set and AARCH64_FEATURE_SVE unset. Similarly, the dependency from +sme to +fp16 is currently redundant, but this redundancy relies upon an incorrect dependency from +fcma to +fp16. This can be fixed in the future, but it might require modifying internal feature checks for a few FCMA instructions, so it's left unchanged for now.
2025-01-31aarch64: Fix fp8 feature dependenciesAndrew Carlotti1-5/+5
We agreed with LLVM that we shouldn't enforce the architectural dependencies between fp8 muliplication features, so remove them. Additionally, fix a typo in the gating for FEAT_SME_F8F16 instructions, which were mistakenly gated by +sme-f8f32 instead. Until now this mistake had been masked by the dependency between the features.
2025-01-31aarch64: Fix overly lax +frintts dependencyAndrew Carlotti1-1/+1
We agreed with LLVM that +frintts should only enable +fp, not +simd. This also matches the dependency used in GCC.
2025-01-31x86: support RMPREAD insnJan Beulich1-0/+1
Like for RMPUPDATE documentation is about to change as far as operands are concerned. They're merely the other way around here. While adjustind gas documentation, also add the missing RMPQUERY counterparts there.
2025-01-31x86: RMPUPDATE wants operands in different formJan Beulich1-9/+24
AMD are about to update their doc, to help clarify that what we currently do isn't quite right: In particular it is not %rax but %rcx which is affected by address size. In fact, that's a normal memory operand, just not expressed via ModR/M byte, but fixed to (%rcx) (or (%ecx) with 32-bit addressing). To support this in the assembler, generalize memory operand handling so far specific to XLAT (which isn't really a string insn, but requires its memory operand to be (%bx) / (%ebx) / (%rbx)). In the disassembler mimic handling after XLAT's, too.
2025-01-31RISC-V: widen LEB128 supportJan Beulich1-10/+13
Do away with at least one of the limitations - all other targets permit multiple values to be specified with a single directive. Re-arrange the logic further to also overcome an internal error in riscv_insert_uleb128_fixes(), as e.g. observed by the all/sleb128-2 testcase. This way there's also no need to parse expressions twice, thus also not raising the same diagnostics (if any) twice. Note how this addresses a pre-existing XFAIL (where the comment wasn't really applicable either for RISC-V). Also update documentation, also to mention that differences between symbols may be used with .uleb128 (albeit I'm uncertain whether there are limitations).
2025-01-27s390: Error if vector index register omitted in assemblyJens Remus1-2/+10
Vector index registers are currently only used in the VRV instruction format. Unlike general purpose index registers an operand value of zero (e.g. %v0, 0, or omitted) does not imply a zero value: "For VRV format instructions, a vector element is used in the formation of the intermediate value. This vector element is an unsigned binary integer value that is added to the base address and 12-bit displacement to form a 64-bit intermediate sum. The vector element is designated by a vector register and an element index. A zero V field accesses the element in vector register zero and does not imply a zero value." [1] Therefore require vector index register operands to be specified in assembler source. That is do require coding of D(VX,B) instead of allowing to omit VX=0 as D(,B), D(B), or D. Emit an error message if a mandatory vector index register is omitted: Error: operand <n>: missing vector index register operand Note that this change is not backwards compatible. But any code that omitted the specification of the vector index register is likely to be in error. Therefore it is favorable to report an error than to stay backward compatible. [1]: IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16, https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf gas/ * config/tc-s390.c (md_gather_operands): Do not allow vector index register operands to be optionally omitted. gas/testsuite/ * gas/s390/zarch-base-index-0.d (vgef): Remove tests with omitted vector index register operands. * gas/s390/zarch-base-index-0.s (vgef): Move tests with omitted vector index register operands ... * gas/s390/zarch-base-index-0-err.s (vgef): ... to here. * gas/s390/zarch-base-index-0-err.l (vgef): Expect error for omitted vector index register operands. * gas/s390/zarch-omitted-base-index.d (vgef): Remove tests with omitted vector index register operands. * gas/s390/zarch-omitted-base-index.s (vgef): Move tests with omitted vector index register operands ... * gas/s390/zarch-omitted-base-index-err.s (vgef): ... to here. * gas/s390/zarch-omitted-base-index-err.l (vgef): Expect error for omitted vector index register operands. * gas/s390/zarch-warn-areg-zero.l (vgef): Remove tests with omitted vector index register operands. * gas/s390/zarch-warn-areg-zero.s (vgef): Likewise. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-01-27s390: Do not warn about vector index register 0 in assemblyJens Remus1-0/+1
Vector index registers are currently only used in the VRV instruction format. Unlike general purpose index registers an operand value of zero (e.g. %v0, 0, or omitted) does not imply a zero value: "For VRV format instructions, a vector element is used in the formation of the intermediate value. This vector element is an unsigned binary integer value that is added to the base address and 12-bit displacement to form a 64-bit intermediate sum. The vector element is designated by a vector register and an element index. A zero V field accesses the element in vector register zero and does not imply a zero value." [1] Therefore when using s390-specific assembler option "-mwarn-areg-zero" do not warn if vector index register 0 is specified. [1]: IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16, https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf gas/ * config/tc-s390.c (md_gather_operands): Do not warn about vector index register 0. gas/testsuite/ * gas/s390/zarch-warn-areg-zero.l (vgef): Do not expect warning about vector index register 0. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-01-27s390: s390_machine leakJens Remus1-24/+14
Simplify the .machine directive parsing logic, so that cpu_string is always xstrdup'd and can therefore always be xfree'd before returning to the caller. This resolves the following memory leak reported by ASAN: Direct leak of 13 byte(s) in 3 object(s) allocated from: #0 0x3ff8aafbb1d in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x2aa338861cf in xmalloc ../../libiberty/xmalloc.c:149 #2 0x2aa338868ff in xstrdup ../../libiberty/xstrdup.c:34 #3 0x2aa320253cb in s390_machine ../../gas/config/tc-s390.c:2172 #4 0x2aa31fddc7b in read_a_source_file ../../gas/read.c:1293 #5 0x2aa31f4f7bf in perform_an_assembly_pass ../../gas/as.c:1223 #6 0x2aa31f4f7bf in main ../../gas/as.c:1436 #7 0x3ff8a02be35 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #8 0x3ff8a02bf33 in __libc_start_main_impl ../csu/libc-start.c:360 #9 0x2aa31f5758f (/home/jremus/git/binutils/build-asan/gas/as-new+0x2d5758f) (BuildId: ...) While at it add tests with double quoted .machine "<cpu>[+<extension>...]" values. gas/ * config/tc-s390.c (s390_machine): Simplify parsing and free cpu_string before returning. gas/testsuite/ * gas/s390/machine-parsing-1.l: Add tests with double quoted values. * gas/s390/machine-parsing-1.s: Likewise. Signed-off-by: Jens Remus <jremus@linux.ibm.com>