Comments (4)
After going through OSACA's parsing code, I noticed that it does parse lane selectors, but expects them in a different format (I'm feeding the parser from the output of objdump
in macOS), i.e. something like mov x21, v23.d[0]
. I've solved this for now in my code using a regex to rewrite the syntax of the affected instructions.
from osaca.
Hi @dgazzoni,
this is indeed something done in the parser, but I am currently hesitating to implement a fix for this because I cannot reproduce the behavior (unfortunately, I don't have a Mac available).
If I try to compile code with your instruction form, all compilers I can use throw an error stating an unknown mnemonic
and unexpected characters following instruction at operand 2
.
Can you provide me with more information about the compiler and OS you used? Also, which flags are you using for objdump?
Thanks!
from osaca.
This appears to be a quirk of Apple's syntax for aarch64 assembly, and probably not the only one. Here's the requested info:
% sw_vers
ProductName: macOS
ProductVersion: 13.2
BuildVersion: 22D49
% clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
% objdump --version
Apple LLVM version 14.0.0 (clang-1400.0.29.202)
Optimized build.
Default target: arm64-apple-darwin22.3.0
Host CPU: apple-a12
Registered Targets:
aarch64 - AArch64 (little endian)
aarch64_32 - AArch64 (little endian ILP32)
aarch64_be - AArch64 (big endian)
arm - ARM
arm64 - ARM64 (little endian)
arm64_32 - ARM64 (little endian ILP32)
armeb - ARM (big endian)
thumb - Thumb
thumbeb - Thumb (big endian)
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64
% echo "mov.d x21, v23[0]\numov x21, v23.d[0]" > test.S
% clang -c test.S
% objdump -d test.o
test.o: file format mach-o arm64
Disassembly of section __TEXT,__text:
0000000000000000 <ltmp0>:
0: f5 3e 08 4e mov.d x21, v23[0]
4: f5 3e 08 4e mov.d x21, v23[0]
from osaca.
Ok, with clang I could verify the correctness as well, thank you!
I now implemented the parser to take indexed registers without a shape/lanes and applied the database lookup in a similar way to the GAS suffixes. Whenever there is a mnemonic with a ".
", i.e., this also includes condition codes such as eq
, ne
, etc... , OSACA checks first for the specific instruction and - if nothing is found - then for the instruction excluding the suffix, i.e., b.ne
falls back to b
, mov.d
and mov.s
fall back to mov
if not specified explicitly in the DB.
All of this is included from commit 9f715c0 onwards.
If this isn't sufficient in your eyes, please let me know, reopen the issue and we can discuss other alternatives!
from osaca.
Related Issues (20)
- Import asmbench result HOT 1
- Instruction is missing HOT 1
- x86 OR instruction breaks LCD analysis HOT 1
- x86 NOT instruction doesn't add a cycle to the critical path HOT 1
- [ARM] Multiply-accumulate output register dependency not recognized HOT 1
- iacaMarks.h compatibility HOT 1
- [ARM] Incorrect dependency graph for store dependent on post-indexed load HOT 1
- Parallel LCD computation fails on macOS HOT 1
- OSACA fails on godbolt.org with KeyError: "Port 'D' not in port list." HOT 1
- Profile OSACA to find out what parts are slow and where we have to change code for performance improvements HOT 2
- Add new u-arch: AMD Zen4 (Genoa)
- Add new u-arch: Intel Sapphire Rapids (SPR)
- Add new u-arch: Neoverse N1 (Ampere Altra Max) HOT 1
- No throughput/latency information for vbroadcast HOT 2
- [REQUEST] Add support for handling comments generated by fcc compiler at the beginning of instruction code.
- [BUG] Register dependency not detected with x86 conditional move instructions
- [REQUEST] Support Intel assembly syntax HOT 2
- [BUG] OSACA cannot parse some instructions generated by AdaptiveCpp/Clang HOT 2
- [BUG] Uppercase register names causes instructions to not match properly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osaca.