Skip to content

Compiling a new project on M4 Apple Mac "invalid operand for instruction" error #1563

@frederikhors

Description

@frederikhors

Compiling a new project on M4 Apple Mac gives me the below error.

I'm using this version:

cargo 1.87.0-nightly (2622e844b 2025-02-28)

cargo build stable works fine.

error: invalid operand for instruction
  |
note: instantiated into assembly here
 --> <inline asm>:8:9
  |
8 |     ldr v1, [x19, 0x0]
   Compiling rgb v0.8.50
  |         ^

error: invalid operand for instruction
   |
note: instantiated into assembly here
  --> <inline asm>:10:9
   |
10 |     str v0, [x19, 0x0]
   |         ^

error: invalid operand for instruction
   |
note: instantiated into assembly here
  --> <inline asm>:22:9
   |
22 |     ldr v1, [x19, 0x0]
   |         ^

error: invalid operand for instruction
   |
note: instantiated into assembly here
  --> <inline asm>:24:9
   |
24 |     str v0, [x19, 0x0]
   |         ^

error: invalid operand for instruction
   |
note: instantiated into assembly here
  --> <inline asm>:36:9
   |
36 |     ldr v1, [x19, 0x0]
   |         ^

error: invalid operand for instruction
   |
note: instantiated into assembly here
  --> <inline asm>:38:9
   |
38 |     str v0, [x19, 0x0]
   |         ^

error: invalid operand for instruction
   |
note: instantiated into assembly here
  --> <inline asm>:50:9
   |
50 |     ldr v1, [x19, 0x0]
   |         ^

error: invalid operand for instruction
   |
note: instantiated into assembly here
  --> <inline asm>:51:9
   |
51 |     ldr v2, [x19, 0x10]
   |         ^

error: invalid operand for instruction
   |
note: instantiated into assembly here
  --> <inline asm>:55:9
   |
55 |     str v1, [x19, 0x0]
   |         ^

error: aborting due to 9 previous errors

error: Failed to assemble `.globl ___inline_asm_half__3abd7bcd14180723_cgu__0_n0
       ___inline_asm_half__3abd7bcd14180723_cgu__0_n0:
           stp fp, lr, [sp, #-32]!
           mov fp, sp
           str x19, [sp, #24]
           mov x19, x0
           ldr v1, [x19, 0x0]
       fcvt s0, h1
           str v0, [x19, 0x0]
           ldr x19, [sp, #24]
           ldp fp, lr, [sp], #32
           ret


       .globl ___inline_asm_half__3abd7bcd14180723_cgu__0_n1
       ___inline_asm_half__3abd7bcd14180723_cgu__0_n1:
           stp fp, lr, [sp, #-32]!
           mov fp, sp
           str x19, [sp, #24]
           mov x19, x0
           ldr v1, [x19, 0x0]
       fcvt h0, s1
           str v0, [x19, 0x0]
           ldr x19, [sp, #24]
           ldp fp, lr, [sp], #32
           ret


       .globl ___inline_asm_half__3abd7bcd14180723_cgu__0_n2
       ___inline_asm_half__3abd7bcd14180723_cgu__0_n2:
           stp fp, lr, [sp, #-32]!
           mov fp, sp
           str x19, [sp, #24]
           mov x19, x0
           ldr v1, [x19, 0x0]
       fcvtn v0.4h, v1.4s
           str v0, [x19, 0x0]
           ldr x19, [sp, #24]
           ldp fp, lr, [sp], #32
           ret


       .globl ___inline_asm_half__3abd7bcd14180723_cgu__0_n3
       ___inline_asm_half__3abd7bcd14180723_cgu__0_n3:
           stp fp, lr, [sp, #-32]!
           mov fp, sp
           str x19, [sp, #24]
           mov x19, x0
           ldr v1, [x19, 0x0]
           ldr v2, [x19, 0x10]
       fcvtn v0.2s, v1.2d
       fcvtn2 v0.4s, v2.2d
       fcvtn v1.4h, v0.4s
           str v1, [x19, 0x0]
           ldr x19, [sp, #24]
           ldp fp, lr, [sp], #32
           ret


       `

error: could not compile `half` (lib) due to 1 previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-armTarget: ARM processors (arm, thumb and AArch64 targets)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions