Compare commits
No commits in common. "6085eb0d6e60116817e1677860b5f845c538b520" and "1f78ad0a7f9b80e46271928c0ec105a6b0b37283" have entirely different histories.
6085eb0d6e
...
1f78ad0a7f
@ -1,56 +0,0 @@
|
|||||||
//valid,6857
|
|
||||||
//:END:
|
|
||||||
import "../std.qbl"
|
|
||||||
|
|
||||||
600851475143 2 divHasLargerPF 3
|
|
||||||
while
|
|
||||||
{
|
|
||||||
// n p
|
|
||||||
req dup 2 req req +
|
|
||||||
// p n p+2
|
|
||||||
swp req
|
|
||||||
// n p p+2
|
|
||||||
divHasLargerPF
|
|
||||||
// p+2 hasLPF newN
|
|
||||||
req
|
|
||||||
}
|
|
||||||
deq 2 - intToStr println
|
|
||||||
|
|
||||||
function int int => bool int divHasLargerPF
|
|
||||||
{
|
|
||||||
req dup req divIfDivisible
|
|
||||||
// n newN
|
|
||||||
1 req dup
|
|
||||||
// newN 1 n newN
|
|
||||||
== req req
|
|
||||||
// is1 n newN
|
|
||||||
if
|
|
||||||
{
|
|
||||||
false req deq
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
true deq req
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function int int => int divIfDivisible
|
|
||||||
{
|
|
||||||
// p n
|
|
||||||
dup req dup swp
|
|
||||||
// p n p n
|
|
||||||
divmod 0
|
|
||||||
// p n p/n p%n 0
|
|
||||||
req req req ==
|
|
||||||
// p n p/n isDiv
|
|
||||||
req req req
|
|
||||||
if
|
|
||||||
{
|
|
||||||
deq req divIfDivisible
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
req deq deq
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
10
src/main.rs
10
src/main.rs
@ -501,15 +501,7 @@ fn generate_assembly_linux_x64_block(operations: &Vec<Operation>, functions: &Ve
|
|||||||
{
|
{
|
||||||
Datatype::Int =>
|
Datatype::Int =>
|
||||||
{
|
{
|
||||||
if value.parse::<i64>().unwrap() > u32::MAX as i64
|
data.code += format!("\tmov qword [queue+8*r13], {}\n", value).as_str();
|
||||||
{
|
|
||||||
data.code += format!("\tmov rax, {}\n", value).as_str();
|
|
||||||
data.code += "\tmov qword [queue+8*r13], rax\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data.code += format!("\tmov qword [queue+8*r13], {}\n", value).as_str();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Datatype::Bool =>
|
Datatype::Bool =>
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user