2019-08-12 12:16:15 +02:00
|
|
|
module Mom
|
2019-09-11 19:17:43 +02:00
|
|
|
class Div4 < Macro
|
2019-09-11 18:23:56 +02:00
|
|
|
def to_risc(compiler)
|
|
|
|
builder = compiler.builder(compiler.source)
|
|
|
|
integer_tmp = builder.allocate_int
|
|
|
|
builder.build do
|
|
|
|
integer_self! << message[:receiver]
|
|
|
|
integer_self.reduce_int
|
|
|
|
integer_1! << 2
|
|
|
|
integer_self.op :>> , integer_1
|
|
|
|
integer_tmp[Parfait::Integer.integer_index] << integer_self
|
|
|
|
message[:return_value] << integer_tmp
|
|
|
|
end
|
|
|
|
return compiler
|
|
|
|
end
|
|
|
|
end
|
2019-08-12 12:16:15 +02:00
|
|
|
end
|