mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
make integer multiplication work for quadwords and lower
This commit is contained in:
parent
07eed2c4a6
commit
038ba47409
2 changed files with 26 additions and 21 deletions
|
@ -339,6 +339,19 @@ pub fn new_backend_64bit<
|
|||
}
|
||||
}
|
||||
|
||||
macro_rules! quadword_and_smaller {
|
||||
() => {
|
||||
IntWidth::I64
|
||||
| IntWidth::U64
|
||||
| IntWidth::I32
|
||||
| IntWidth::U32
|
||||
| IntWidth::I16
|
||||
| IntWidth::U16
|
||||
| IntWidth::I8
|
||||
| IntWidth::U8
|
||||
};
|
||||
}
|
||||
|
||||
impl<
|
||||
'a,
|
||||
GeneralReg: RegTrait,
|
||||
|
@ -699,16 +712,7 @@ impl<
|
|||
|
||||
fn build_num_add(&mut self, dst: &Symbol, src1: &Symbol, src2: &Symbol, layout: &Layout<'a>) {
|
||||
match layout {
|
||||
Layout::Builtin(Builtin::Int(
|
||||
IntWidth::I64
|
||||
| IntWidth::U64
|
||||
| IntWidth::I32
|
||||
| IntWidth::U32
|
||||
| IntWidth::I16
|
||||
| IntWidth::U16
|
||||
| IntWidth::I8
|
||||
| IntWidth::U8,
|
||||
)) => {
|
||||
Layout::Builtin(Builtin::Int(quadword_and_smaller!())) => {
|
||||
let dst_reg = self.storage_manager.claim_general_reg(&mut self.buf, dst);
|
||||
let src1_reg = self
|
||||
.storage_manager
|
||||
|
@ -736,7 +740,7 @@ impl<
|
|||
|
||||
fn build_num_mul(&mut self, dst: &Symbol, src1: &Symbol, src2: &Symbol, layout: &Layout<'a>) {
|
||||
match layout {
|
||||
Layout::Builtin(Builtin::Int(IntWidth::I64 | IntWidth::U64)) => {
|
||||
Layout::Builtin(Builtin::Int(quadword_and_smaller!())) => {
|
||||
let dst_reg = self.storage_manager.claim_general_reg(&mut self.buf, dst);
|
||||
let src1_reg = self
|
||||
.storage_manager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue