Comments (3)
For whatever reason, these .ll
files contain vector types (<16 x 18>
), which we don't support yet.
rs/target/release/deps/chirp8_c64-1e21b470aaa523b3.ll
; Function Attrs: noreturn nounwind nonlazybind
define void @run(ptr noundef %mem, ptr noundef %scr) unnamed_addr #7 {
start:
...
store <16 x i8> zeroinitializer, ptr %3, align 8, !alias.scope !63
%4 = getelementptr inbounds %"chirp8_engine::cpu::CPU", ptr %cpu, i64 0, i32 3
store i16 0, ptr %4, align 8, !alias.scope !63
%5 = getelementptr inbounds %"chirp8_engine::cpu::CPU", ptr %cpu, i64 0, i32 4
store i16 512, ptr %5, align 2, !alias.scope !63
store <16 x i16> zeroinitializer, ptr %cpu, align 8, !alias.scope !63
from llvm-mos.
I would assume this comes from my Rust code that operates on the following struct (note the regs
and stack
fields):
pub type Byte = u8;
pub type Addr = u16;
pub struct CPU {
quirks: Quirks,
regs: [Byte; 16],
ptr: Addr,
pc: Addr,
stack: [Addr; 16],
sp: usize,
rnd: Addr,
timer: Byte,
state: State,
}
So is this currently impossible to compile with llvm-mos
? Is there some known workaround to force the Rust compiler to represent these fields the same way as I imagine Clang must represent uint8_t[]
etc.?
from llvm-mos.
Is there some known workaround to force the Rust compiler to represent these fields the same way as I imagine Clang must represent
uint8_t[]
etc.?
I'm afraid I'm not extremely familiar with rustc, but I do know that it at least partially resembles clang, in that there's a backend target specification that describes what kind of LLVM IR the frontend is supposed to emit for a given Rust concept.
The rust-mos implement by mrk provides a partial implementation of one copied from AVR, but it's incomplete and out of date. If I recall your blog post correctly, this was from one of the more modern rust backends, so I wouldn't be surprised if there's some vectorization stuff present in those backends. If it's possible, compiling using the AVR backend or rust-mos might give better results.
from llvm-mos.
Related Issues (20)
- Support assembler sources in ca65 format
- Lower mem intrinsics to loops
- G_OR prevents selection of addressing mode HOT 1
- Don't copy single-use strings to the zero page
- rustc crash HOT 2
- Compilation failure on MacOS w. Apple silicon HOT 11
- Builder for Apple Silicon
- mos-sim crash HOT 1
- Triple selection doesn't accommodate mos-<platform>-<type>-<subtype> syntax
- [65C816, 65CE02] Long branch instructions not supported HOT 2
- ld.lld: error: undefined symbol: __rc4 to __rc24 HOT 3
- Missing G_SBC commutation for equality checks HOT 1
- [Assembler] Improved ergonomics for 65816 (and other) subtargets HOT 14
- [Assembler] .byte/.short don't support MOS expression parsing
- [Interrupts] Current interrupt C generation inadequate for CBM machines HOT 2
- Redundant copy and spilling HOT 1
- Compiler crashes when try to access a member variable of a class through inline assembly HOT 5
- Declaration order of member variables has a big impact on code optimization(!)
- Surface error messages for inline assembly
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 llvm-mos.