WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit ee0fd07d authored by Kunshan Wang's avatar Kunshan Wang
Browse files

Updated the factorial generated from RPython to the current version.

parent f097e7af
.typedef @i32 = int<32>
.typedef @bool = int<1>
.const @I32_1 <@i32> = 1
.funcsig @fac_sig = @i32 (@i32)
.typedef @int_64 = int<64>
.typedef @int_1 = int<1>
.typedef @float = float
.typedef @double = double
.typedef @void = void
.typedef @int_8 = int<8>
.typedef @int_32 = int<32>
.const @int_64_1 <@int_64> = 1
.funcsig @fac_sig = @int_64 (@int_64)
.funcdef @fac VERSION @fac_v1 <@fac_sig> (%n_3)
// %v46 = EQ <@i32> %n_3 %1
%v46 = EQ <@i32> %n_3 @I32_1
// %v47 = BITCAST <@bool @bool> %v46
// BRANCH2 %v47 %fac_block_2 %fac_block_1
BRANCH2 %v46 %fac_block_2 %fac_block_1
%v48 = EQ <@int_64> %n_3 @int_64_1
BRANCH2 %v48 %blk_2 %blk_1
// n_4 = PHI <@i32>
%n_4 = PHI <@i32>
// %fac_block_0: %n_3
%fac_block_0: %n_3 ;
// {
%v53 = PHI <@int_64> {
%blk_1: %v52;
%blk_0: @int_64_1;
// %v48 = SUB <@i32> %n_4 %1
%v48 = SUB <@i32> %n_4 @I32_1
// %v49 = CALL <@fac_sig> @fac %v48
%v49 = CALL <@fac_sig> @fac (%v48)
%v50 = MUL <@i32> %n_4 %v49
BRANCH %fac_block_2
RET <@int_64> %v53
// v51 = PHI <@i32>
%v51 = PHI <@i32>
//%fac_block_1: %v50
%fac_block_1: %v50 ;
// %fac_block_0: %1
%fac_block_0: @I32_1 ;
// {
// RET <@i32> v51
RET <@i32> %v51
%v50 = SUB <@int_64> %n_3 @int_64_1
%v51 = CALL <@fac_sig> @fac (%v50)
%v52 = MUL <@int_64> %n_3 %v51
BRANCH %blk_2
.typedef @void = void
.const @I32_10 <@i32> = 10
.const @int_64_10 <@int_32> = 10
.funcsig @main_sig = @void ()
.funcdef @main VERSION @main_v1 <@main_sig> () {
%rv = CALL <@fac_sig> @fac (@I32_10)
%rv = CALL <@fac_sig> @fac (@int_64_10)
%main_trap = TRAP <@void> KEEPALIVE (%rv)
COMMINST @uvm.thread_exit
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment