Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using ASM (x86) with Qt on MacOS with CMake. How?
Forum Updated to NodeBB v4.3 + New Features

Using ASM (x86) with Qt on MacOS with CMake. How?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 75 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bogong
    wrote last edited by bogong
    #1

    Hello all!

    Trying to find any examples of how to setup using ASM (x86) in Qt project with CMake. Is there any manuals or examples?

    For now trying to run this examples https://firexfly.com/clang-inline-assembly/

    Have this kind of errors:

    error: unknown register name '%eax' in asm
    

    or

    error: unrecognized instruction mnemonic, did you mean: fmov, mov, movi, movk, movn, movz, smov, umov?
    

    What is missing by me?

    I 1 Reply Last reply
    0
    • B bogong

      Hello all!

      Trying to find any examples of how to setup using ASM (x86) in Qt project with CMake. Is there any manuals or examples?

      For now trying to run this examples https://firexfly.com/clang-inline-assembly/

      Have this kind of errors:

      error: unknown register name '%eax' in asm
      

      or

      error: unrecognized instruction mnemonic, did you mean: fmov, mov, movi, movk, movn, movz, smov, umov?
      

      What is missing by me?

      I Offline
      I Offline
      IgKh
      wrote last edited by
      #2

      @bogong said in Using ASM (x86) with Qt on MacOS with CMake. How?:

      What is missing by me?

      That the error messages imply that you try to use x86 assembly but your compilation is targeting arm64 (hence the assembler's complaints about the eax register not existing; and you getting offered ARM mnemonics like movz, probably in response to you trying to use the movl mnemonic which is x86 only).

      • Make sure you target only x86_64 in your build (in CMake, you have CMAKE_OSX_ARCHITECTURES).
      • Or if you want to target ARM, you need to use ARM assembly code which is completely different to x86 assembly.
      • If you are building universal binaries, then you need to write a different version of the inline assembly block for each architecture, and direct to the correct one with preprocessor macros.

      May I ask why you think you need inline assembly? There is quite possibly an easier approach.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved