mirror of
https://github.com/lcbcFoo/ReonV.git
synced 2025-04-18 18:44:43 -04:00
Cleaned code, added explanations and headers
This commit is contained in:
parent
5d4d83b0cd
commit
41bae90ea3
204 changed files with 199 additions and 16774 deletions
|
@ -112,8 +112,9 @@ end;
|
|||
|
||||
architecture rtl of iu3 is
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
-- RISCV OP decoding constants --
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- RISCV OP decoding constants
|
||||
|
||||
subtype r_op_type is std_logic_vector(6 downto 0);
|
||||
|
||||
|
@ -129,8 +130,8 @@ architecture rtl of iu3 is
|
|||
constant R_FENCE : r_op_type := "0001111";
|
||||
constant R_CONTROL : r_op_type := "1110011";
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
-- RISCV funct3 decoding constants --
|
||||
--------------------------------------------------------------------------------
|
||||
-- RISCV funct3 decoding constants
|
||||
|
||||
subtype r_funct3_type is std_logic_vector(2 downto 0);
|
||||
--Jump register
|
||||
|
@ -166,6 +167,9 @@ architecture rtl of iu3 is
|
|||
constant R_F3_SLL : r_funct3_type := "001";
|
||||
constant R_F3_SRL : r_funct3_type := "101"; --Same to SRA
|
||||
|
||||
|
||||
-- RISC-V SPECIAL CONSTANTS (NOT USED YET)
|
||||
|
||||
-- Fence
|
||||
constant R_F3_FENCE : r_funct3_type := "000";
|
||||
constant R_F3_FENCEI : r_funct3_type := "001";
|
||||
|
@ -200,6 +204,9 @@ architecture rtl of iu3 is
|
|||
-- 1110 RESERVED
|
||||
constant EXC_PFAULT_ST : r_exc_type := "1111";
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- END OF RISC-V SPECIFIC CONSTANTS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- Used by
|
||||
subtype asi_type is std_logic_vector(4 downto 0);
|
||||
|
@ -260,8 +267,6 @@ architecture rtl of iu3 is
|
|||
constant TT_TICC : trap_type := "111111";
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
function get_tbuf(tracebuf_2p: boolean; tbuf: integer) return integer is
|
||||
begin
|
||||
if (TRACEBUF_2P) then
|
||||
|
@ -556,6 +561,10 @@ architecture rtl of iu3 is
|
|||
cwpmax : cwptype; -- max cwp value
|
||||
ducnt : std_ulogic;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- RISC-V SPECIAL REGISTERS (NOT USED YET)
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- RISC-V CSRs used by GNU/Linux -- Encoding
|
||||
status : word; -- 0
|
||||
epc : pctype; -- 1
|
||||
|
@ -613,44 +622,6 @@ architecture rtl of iu3 is
|
|||
|
||||
type watchpoint_registers is array (0 to 3) of watchpoint_register;
|
||||
|
||||
-- function dbgexc(
|
||||
-- r : registers; dbgi : l3_debug_in_type;
|
||||
-- trap : std_ulogic;
|
||||
-- tt : std_logic_vector(7 downto 0);
|
||||
-- dsur : dsu_registers) return std_ulogic is
|
||||
-- variable dmode : std_ulogic;
|
||||
-- begin
|
||||
-- dmode := '0';
|
||||
-- if (not r.x.ctrl.annul and trap) = '1' then
|
||||
-- -- if (((tt = "00" & TT_WATCH) and (dbgi.bwatch = '1')) or
|
||||
-- -- ((dbgi.bsoft = '1') and (tt = "10000001")) or
|
||||
-- -- (dbgi.btrapa = '1') or
|
||||
-- -- ((dbgi.btrape = '1') and not ((tt(5 downto 0) = TT_PRIV) or
|
||||
-- -- (tt(5 downto 0) = TT_FPDIS) or (tt(5 downto 0) = TT_WINOF) or
|
||||
-- -- (tt(5 downto 0) = TT_WINUF) or (tt(5 downto 4) = "01") or (tt(7) = '1'))) or
|
||||
-- -- (((not r.w.s.et) and dbgi.berror) = '1')) then
|
||||
-- if (tt = "0000" & EXC_BREAKPOINT) or (TT = "0000" & EXC_IINST) or (TT = "0000" & EXC_AFAULT_INST) or
|
||||
-- ((dbgi.bsoft = '1') and (tt = "10000001")) or ((not r.w.s.et) and dbgi.berror) = '1' then
|
||||
-- dmode := '1';
|
||||
-- end if;
|
||||
-- end if;
|
||||
-- return(dmode);
|
||||
-- end;
|
||||
--
|
||||
-- function dbgerr(r : registers; dbgi : l3_debug_in_type;
|
||||
-- tt : std_logic_vector(7 downto 0))
|
||||
-- return std_ulogic is
|
||||
-- variable err : std_ulogic;
|
||||
-- begin
|
||||
-- err := not r.w.s.et;
|
||||
-- -- if (((dbgi.dbreak = '1') and (tt = ("00" & TT_WATCH))) or
|
||||
-- -- ((dbgi.bsoft = '1') and (tt = ("10000001")))) then
|
||||
-- if (((dbgi.dbreak = '1') and (tt = ("0000" & EXC_USER_ECALL))) or
|
||||
-- ((dbgi.bsoft = '1') and (tt = ("10000001")))) then
|
||||
-- err := '0';
|
||||
-- end if;
|
||||
-- return(err);
|
||||
-- end;
|
||||
function dbgexc(
|
||||
r : registers; dbgi : l3_debug_in_type;
|
||||
trap : std_ulogic;
|
||||
|
@ -998,29 +969,7 @@ architecture rtl of iu3 is
|
|||
function itfilt (inst : word; asifilt : std_ulogic; filter : std_logic_vector(3 downto 0); trap, cfc : std_logic) return std_ulogic is
|
||||
variable tren : std_ulogic;
|
||||
begin
|
||||
tren := '0';
|
||||
-- case filter is
|
||||
-- when "0001" => -- Bicc, SETHI
|
||||
-- if inst(31 downto 30) = "00" then tren := '1'; end if;
|
||||
-- when "0010" => -- Control-flow change
|
||||
-- if (inst(31 downto 30) = "01") -- Call
|
||||
-- or ((inst(31 downto 30) = "00") and (inst(23 downto 22) /= "00")) --Bicc
|
||||
-- or ((inst(31 downto 30) = "10") and (inst(24 downto 19) = JMPL)) --Jmpl
|
||||
-- or ((inst(31 downto 30) = "10") and (inst(24 downto 19) = RETT)) --Rett
|
||||
-- or (trap = '1') or (cfc = '1')
|
||||
-- then tren := '1'; end if;
|
||||
-- when "0100" => -- Call
|
||||
-- if inst(31 downto 30) = "01" then tren := '1'; end if;
|
||||
-- when "1000" => -- Normal instructions
|
||||
-- if inst(31 downto 30) = "10" then tren := '1'; end if;
|
||||
-- when "1100" => -- LDST
|
||||
-- if inst(31 downto 30) = "11" then tren := '1'; end if;
|
||||
-- when "1101" => -- LDST from alternate space
|
||||
-- if inst(31 downto 30) = "11" and inst(24 downto 23) = "01" then tren := '1'; end if;
|
||||
-- when "1110" => -- LDST from alternate space 0x80 - 0xFF
|
||||
-- if inst(31 downto 30) = "11" and inst(24 downto 23) = "01" and inst(12) = '1' and asifilt = '1' then tren := '1'; end if;
|
||||
-- when others => tren := '1';
|
||||
-- end case;
|
||||
tren := '0';
|
||||
return(tren);
|
||||
end;
|
||||
|
||||
|
@ -1574,36 +1523,6 @@ architecture rtl of iu3 is
|
|||
constant SZWORD : std_logic_vector(1 downto 0) := "10";
|
||||
constant SZDBL : std_logic_vector(1 downto 0) := "11";
|
||||
|
||||
-- calculate register file address
|
||||
|
||||
procedure regaddr(cwp : std_logic_vector; reg : std_logic_vector(4 downto 0);
|
||||
stwin, de_cwpmax: std_logic_vector;
|
||||
rao : out rfatype) is
|
||||
variable ra : rfatype;
|
||||
constant globals : std_logic_vector(RFBITS-5 downto 0) :=
|
||||
conv_std_logic_vector(NWIN, RFBITS-4);
|
||||
variable vcwp: cwptype;
|
||||
begin
|
||||
vcwp := cwp;
|
||||
ra := (others => '0'); ra(4 downto 0) := reg;
|
||||
-- if RFPART then
|
||||
-- if ra(4)='0' and cwp=CWPMIN then
|
||||
-- ra(4):='1';
|
||||
-- vcwp := std_logic_vector(unsigned(de_cwpmax) + unsigned(stwin));
|
||||
-- else
|
||||
-- vcwp := std_logic_vector(unsigned(cwp) + unsigned(stwin));
|
||||
-- end if;
|
||||
-- end if;
|
||||
-- if reg(4 downto 3) = "00" then ra(RFBITS -1 downto 4) := globals;
|
||||
-- else
|
||||
-- ra(NWINLOG2+3 downto 4) := vcwp + ra(4);
|
||||
-- if ra(RFBITS-1 downto 4) = globals then
|
||||
-- ra(RFBITS-1 downto 4) := (others => '0');
|
||||
-- end if;
|
||||
-- end if;
|
||||
rao := ra;
|
||||
end;
|
||||
|
||||
-- branch adder
|
||||
|
||||
function branch_address(inst : word; pc : pctype; de_rexbaddr1, de_rexen: std_logic) return std_logic_vector is
|
||||
|
@ -1611,25 +1530,12 @@ architecture rtl of iu3 is
|
|||
begin
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- RV32I changes
|
||||
-- case inst(6 downto 0) is
|
||||
-- when R_JAL =>
|
||||
-- addr(31 downto 20) := (others => inst(31));
|
||||
-- addr(19 downto 11) := inst(19 downto 12) & inst(20);
|
||||
-- -- PCLOW is 2 for now
|
||||
-- --addr(10 downto 1) := inst(30 downto 21);
|
||||
-- addr(10 downto 2) := inst(30 downto 22);
|
||||
--
|
||||
-- when R_BRANCH =>
|
||||
addr(31 downto 12) := (others => inst(31));
|
||||
addr(11) := inst(7);
|
||||
addr(10 downto 5) := inst(30 downto 25);
|
||||
--addr(4 downto 1) := inst(11 downto 8);
|
||||
addr(4 downto 2) := inst(11 downto 9);
|
||||
|
||||
-- when others => null;
|
||||
-- end case;
|
||||
--tmp(31 downto 2) := x"4000003" & "00";
|
||||
-- Calculates RISC-V branch address
|
||||
addr(31 downto 12) := (others => inst(31));
|
||||
addr(11) := inst(7);
|
||||
addr(10 downto 5) := inst(30 downto 25);
|
||||
--addr(4 downto 1) := inst(11 downto 8);
|
||||
addr(4 downto 2) := inst(11 downto 9);
|
||||
tmp(31 downto 2) := addr(31 downto 2) + pc(31 downto 2) - 2;
|
||||
return (tmp);
|
||||
end;
|
||||
|
@ -1653,17 +1559,6 @@ architecture rtl of iu3 is
|
|||
when others => null;
|
||||
end case;
|
||||
end if;
|
||||
-- if(inst(6 downto 0) = R_BRANCH) then
|
||||
-- case inst(14 downto 12) is
|
||||
-- when "000" => branch := icc(2); -- beq
|
||||
-- when "001" => branch := not icc(2); -- bne
|
||||
-- when "100" => branch := not icc(0); -- blt
|
||||
-- when "101" => branch := icc(0); -- bge
|
||||
-- when "110" => branch := not icc(1); -- bltu
|
||||
-- when "111" => branch := icc(1); -- bgeu
|
||||
-- when others => null;
|
||||
-- end case;
|
||||
-- end if;
|
||||
return(branch);
|
||||
end;
|
||||
|
||||
|
@ -1802,32 +1697,11 @@ begin
|
|||
end case;
|
||||
|
||||
wph := wphit(r, wpr, dbgi, dsur, pccomp);
|
||||
|
||||
-- trap := '1';
|
||||
-- if r.a.ctrl.trap = '1' then tt := r.a.ctrl.tt;
|
||||
-- elsif (illegal_inst = '1') or r.a.decill = '1' then tt := "00" & EXC_IINST;
|
||||
-- elsif (ebreak = '1') then tt := "00" & EXC_BREAKPOINT;
|
||||
-- elsif (ecall = '1') then
|
||||
-- -- Check if we are at user,supervisor or machine space
|
||||
-- tt := "00" & EXC_USER_ECALL;
|
||||
--
|
||||
-- -- elsif fp_disabled = '1' then tt := TT_FPDIS;
|
||||
-- -- elsif cp_disabled = '1' then tt := TT_CPDIS;
|
||||
-- -- elsif wph = '1' then tt := TT_WATCH;
|
||||
-- -- elsif r.a.wovf= '1' then tt := TT_WINOF;
|
||||
-- -- elsif r.a.wunf= '1' then tt := TT_WINUF;
|
||||
-- -- elsif r.a.ticc= '1' then tt := TT_TICC;
|
||||
-- else trap := '0'; tt:= (others => '0'); end if;
|
||||
trap := '1';
|
||||
if r.a.ctrl.trap = '1' then tt := r.a.ctrl.tt;
|
||||
elsif privileged_inst = '1' then tt := TT_PRIV;
|
||||
elsif illegal_inst = '1' or r.a.decill = '1' then tt := TT_IINST;
|
||||
--elsif fp_disabled = '1' then tt := TT_FPDIS;
|
||||
--elsif cp_disabled = '1' then tt := TT_CPDIS;
|
||||
elsif wph = '1' then tt := TT_WATCH;
|
||||
--elsif r.a.wovf= '1' then tt := TT_WINOF;
|
||||
--elsif r.a.wunf= '1' then tt := TT_WINUF;
|
||||
--elsif r.a.ticc= '1' then tt := TT_TICC;
|
||||
else trap := '0'; tt:= (others => '0'); end if;
|
||||
end if;
|
||||
end;
|
||||
|
@ -1844,45 +1718,12 @@ end;
|
|||
|
||||
-- select cwp
|
||||
|
||||
-- This is not used by RISC-V, since there is no resgiter window. This should be removed
|
||||
-- in future
|
||||
procedure cwp_gen(r, v : registers; annul, wcwp : std_ulogic; ncwp : cwptype;
|
||||
cwp : out cwptype; awp: out cwptype; aw,paw: out std_ulogic;
|
||||
stwin,de_cwpmax: out cwptype) is
|
||||
begin
|
||||
-- if (r.x.rstate = trap) or
|
||||
-- (r.x.rstate = dsu2)
|
||||
-- or (rstn = '0') then cwp := v.w.s.cwp;
|
||||
-- elsif (wcwp = '1') and (annul = '0') and ((not AWPEN) or r.d.aw='0') then cwp := ncwp;
|
||||
-- elsif r.m.wcwp = '1' then cwp := r.m.result(NWINLOG2-1 downto 0);
|
||||
-- else cwp := r.d.cwp; end if;
|
||||
--
|
||||
-- if AWPEN and ((r.x.rstate = trap) or
|
||||
-- (r.x.rstate = dsu2)
|
||||
-- or (rstn = '0')) then awp := v.w.s.awp;
|
||||
-- elsif AWPEN and r.d.aw='1' and (wcwp = '1') and (annul = '0') then awp := ncwp;
|
||||
-- elsif AWPEN and r.m.wawp = '1' then awp := r.m.result(NWINLOG2-1 downto 0);
|
||||
-- elsif AWPEN and (r.d.aw='0' and r.d.paw='0') then awp := r.d.cwp;
|
||||
-- else awp := r.d.awp; end if;
|
||||
--
|
||||
-- if AWPEN and (
|
||||
-- (r.x.rstate = trap) or
|
||||
-- (r.x.rstate = dsu2)
|
||||
-- or (rstn = '0') ) then aw := v.w.s.aw; paw := v.w.s.paw;
|
||||
-- elsif AWPEN and (v.a.ctrl.rett='1') then
|
||||
-- aw := r.d.paw; paw := r.d.paw;
|
||||
-- elsif AWPEN and r.m.wcwp='1' then aw:=r.m.result(15); paw:=r.m.result(14);
|
||||
-- else aw:=r.d.aw; paw:=r.d.paw; end if;
|
||||
--
|
||||
-- if RFPART and (
|
||||
-- (r.x.rstate = trap) or
|
||||
-- (r.x.rstate = dsu2)
|
||||
-- or (rstn = '0') ) then
|
||||
-- stwin := v.w.s.stwin; de_cwpmax:=v.w.s.cwpmax;
|
||||
-- elsif RFPART and r.m.wawp='1' and r.m.result(15+NWINLOG2 downto 16)/=CWPMIN then
|
||||
-- stwin:=r.m.result(20+NWINLOG2 downto 21); de_cwpmax:=r.m.result(15+NWINLOG2 downto 16);
|
||||
-- else
|
||||
-- stwin := r.d.stwin; de_cwpmax:=r.d.cwpmax;
|
||||
-- end if;
|
||||
|
||||
cwp := "000";
|
||||
aw := '0';
|
||||
paw := '0';
|
||||
|
@ -1893,29 +1734,18 @@ end;
|
|||
|
||||
-- generate wcwp in ex stage
|
||||
|
||||
-- This is not used by RISC-V, since there is no resgiter window. This should be removed
|
||||
-- in future
|
||||
procedure cwp_ex(r : in registers; wcwp : out std_ulogic; wawp : out std_ulogic) is
|
||||
variable vwcwp, vwawp: std_ulogic;
|
||||
begin
|
||||
vwcwp := '0'; vwawp := '0';
|
||||
-- if (r.e.ctrl.inst(31 downto 30) = FMT3) and
|
||||
-- (r.e.ctrl.inst(24 downto 19) = WRPSR) and
|
||||
-- (pwrpsr=0 or r.e.ctrl.inst(29 downto 25)="00000")
|
||||
-- then vwcwp := not r.e.ctrl.annul; else vwcwp := '0'; end if;
|
||||
-- if AWPEN and
|
||||
-- (r.e.ctrl.inst(31 downto 30) = FMT3) and
|
||||
-- (r.e.ctrl.inst(24 downto 19) = WRY) and
|
||||
-- (r.e.ctrl.inst(29 downto 25) = "10100")
|
||||
-- then
|
||||
-- vwawp := not r.e.ctrl.annul;
|
||||
-- vwcwp := vwcwp or (r.e.op1(5) and not r.e.ctrl.annul);
|
||||
-- else vwawp := '0';
|
||||
-- end if;
|
||||
-- wcwp := vwcwp;
|
||||
-- wawp := vwawp;
|
||||
end;
|
||||
|
||||
-- generate next cwp & window under- and overflow traps
|
||||
|
||||
-- This is not used by RISC-V, since there is no resgiter window. This should be removed
|
||||
-- in future
|
||||
procedure cwp_ctrl(r : in registers; rcwp: in cwptype; xc_wim : in std_logic_vector(NWIN-1 downto 0);
|
||||
inst : word; de_cwp : out cwptype; wovf_exc, wunf_exc, wcwp : out std_ulogic) is
|
||||
variable op : std_logic_vector(1 downto 0);
|
||||
|
@ -1927,21 +1757,6 @@ begin
|
|||
wovf_exc := '0'; wunf_exc := '0'; wim := (others => '0');
|
||||
wim(NWIN-1 downto 0) := xc_wim; wcwp := '0';
|
||||
ncwp := "000";
|
||||
-- if (op = FMT3) and ((op3 = RETT) or (op3 = RESTORE) or (op3 = SAVE)) then
|
||||
-- wcwp := '1';
|
||||
-- if (op3 = SAVE) then
|
||||
-- if RFPART and (rcwp=CWPMIN) then ncwp := r.w.s.cwpmax;
|
||||
-- elsif (not CWPOPT) and (rcwp = CWPMIN) then ncwp := CWPMAX;
|
||||
-- else ncwp := rcwp - 1 ; end if;
|
||||
-- else
|
||||
-- if RFPART and (rcwp = r.w.s.cwpmax) then ncwp := CWPMIN;
|
||||
-- elsif (not CWPOPT) and (rcwp = CWPMAX) then ncwp := CWPMIN;
|
||||
-- else ncwp := rcwp + 1; end if;
|
||||
-- end if;
|
||||
-- if wim(conv_integer(ncwp)) = '1' then
|
||||
-- if op3 = SAVE then wovf_exc := '1'; else wunf_exc := '1'; end if;
|
||||
-- end if;
|
||||
-- end if;
|
||||
de_cwp := ncwp;
|
||||
end;
|
||||
|
||||
|
@ -1969,6 +1784,8 @@ end;
|
|||
return(not not_valid);
|
||||
end;
|
||||
|
||||
-- RISC-V BRANCH PREDICTION IS CURRENTLY DISABLED
|
||||
|
||||
-- procedure bp_miss_ex(r : registers; icc : std_logic_vector(3 downto 0);
|
||||
-- ex_bpmiss, ra_bpannul : out std_logic) is
|
||||
-- variable miss : std_logic;
|
||||
|
@ -2041,12 +1858,10 @@ end;
|
|||
ldcheck1 := '1'; ldchkra := '0';
|
||||
case r.d.cnt is
|
||||
when "00" =>
|
||||
--if (lddel = 2) and (op3(2) = '1') and (op3(5) = '0') then ldcheck3 := '1'; end if;
|
||||
if (op(5) = '1') then ldcheck3 := '1'; end if; -- store
|
||||
ldchkra := '1';
|
||||
when "01" =>
|
||||
ldchkra := '1';
|
||||
--if (op 3(5) and op3(2) and not op3(3)) = '1' then ldcheck1 := '0'; ldcheck2 := '0'; end if; -- STF/STC
|
||||
when others => NULL;
|
||||
end case;
|
||||
when others => null;
|
||||
|
@ -2134,7 +1949,6 @@ end;
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
-- RV32I changes
|
||||
-- if (r.d.annul = '0') and not (icbpmiss = '1' and r.d.pcheld='0') and (REX=0 or de_rexbubble='0') and (irqlat=0 or not (r.d.irqstart='1' and r.d.irqlatmet='0'))
|
||||
if (r.d.annul = '0') and (irqlat=0 or not (r.d.irqstart='1' and r.d.irqlatmet='0'))
|
||||
then
|
||||
case inst(6 downto 0) is
|
||||
|
@ -2149,6 +1963,7 @@ end;
|
|||
when others => null;
|
||||
end case;
|
||||
|
||||
-- This is a workaround to run branch instructions with no branch prediction
|
||||
when R_BRANCH =>
|
||||
if r.d.cnt = "11" then
|
||||
branch := branch_true;
|
||||
|
@ -2298,6 +2113,8 @@ end;
|
|||
end;
|
||||
|
||||
-- read special registers
|
||||
|
||||
-- THIS IS NOT READY, SPECIAL INSTRUCTIONS SHOULD NOT BE USED
|
||||
function get_spr (r : registers) return word is
|
||||
variable spr : word;
|
||||
begin
|
||||
|
@ -2375,8 +2192,6 @@ end;
|
|||
mulins, divins, mulstep, macins, ldbp2, invop2 : out std_logic
|
||||
) is
|
||||
variable op : std_logic_vector(6 downto 0);
|
||||
--variable op2 : std_logic_vector(2 downto 0);
|
||||
--variable op3 : std_logic_vector(5 downto 0);
|
||||
variable f3 : std_logic_vector(2 downto 0);
|
||||
variable rs1, rs2, rd : std_logic_vector(4 downto 0);
|
||||
variable icc : std_logic_vector(3 downto 0);
|
||||
|
@ -2385,7 +2200,6 @@ end;
|
|||
|
||||
op := r.a.ctrl.inst(6 downto 0);
|
||||
f3 := r.a.ctrl.inst(14 downto 12);
|
||||
-- op3 := r.a.ctrl.inst(24 downto 19);
|
||||
rs1 := r.a.ctrl.inst(19 downto 15); i := r.a.ctrl.inst(30);
|
||||
rs2 := r.a.ctrl.inst(24 downto 20); rd := r.a.ctrl.inst(29 downto 25);
|
||||
aop1 := iop1; aop2 := iop2; ldbp2 := ldbp;
|
||||
|
@ -2393,11 +2207,6 @@ end;
|
|||
shcnt := iop2(4 downto 0); sari := '0'; shleft := '0'; invop2 := '0';
|
||||
ymsb := iop1(0); mulins := '0'; divins := '0'; mulstep := '0';
|
||||
macins := '0';
|
||||
--
|
||||
-- if r.e.ctrl.wy = '1' then y0 := my;
|
||||
-- elsif r.m.ctrl.wy = '1' then y0 := r.m.y(0);
|
||||
-- elsif r.x.ctrl.wy = '1' then y0 := r.x.y(0);
|
||||
-- else y0 := r.w.s.y(0); end if;
|
||||
|
||||
if r.e.ctrl.wicc = '1' then icc := me_icc;
|
||||
elsif r.m.ctrl.wicc = '1' then icc := r.m.icc;
|
||||
|
@ -2596,9 +2405,6 @@ end;
|
|||
end if;
|
||||
logicout(31 downto 1) := (others => '0');
|
||||
|
||||
--when EXE_DIV =>
|
||||
-- if DIVEN then logicout := aluin2;
|
||||
-- else logicout := (others => '-'); end if;
|
||||
when others => logicout := (others => '-');
|
||||
end case;
|
||||
if (r.e.ctrl.wy and r.e.mulstep) = '1' then
|
||||
|
@ -2705,19 +2511,11 @@ end;
|
|||
mzero := azero;
|
||||
case r.e.alusel is
|
||||
when EXE_RES_ADD =>
|
||||
-- Flags are set for branch conditions
|
||||
aluresult := addout(32 downto 1);
|
||||
-- if r.e.aluadd = '0' then
|
||||
-- icc(0) := ((not op1(31)) and not op2(31)) or -- Carry
|
||||
-- (addout(32) and ((not op1(31)) or not op2(31)));
|
||||
-- icc(1) := (op1(31) and (op2(31)) and not addout(32)) or -- Overflow
|
||||
-- (addout(32) and (not op1(31)) and not op2(31));
|
||||
-- else
|
||||
-- icc(0) := (op1(31) and op2(31)) or -- Carry
|
||||
-- ((not addout(32)) and (op1(31) or op2(31)));
|
||||
icc(0) := addout(33);
|
||||
icc(1) := (op1(31) and op2(31) and not addout(32)) or -- Overflow
|
||||
(addout(32) and (not op1(31)) and (not op2(31)));
|
||||
--end if;
|
||||
icc(0) := addout(33); -- Carry
|
||||
icc(1) := (op1(31) and op2(31) and not addout(32)) or -- Overflow
|
||||
(addout(32) and (not op1(31)) and (not op2(31)));
|
||||
|
||||
if aluresult = zero32 then icc(2) := '1'; end if;
|
||||
icc(3) := aluresult(31);
|
||||
|
@ -2731,43 +2529,14 @@ end;
|
|||
-- Save PC on jump and link
|
||||
if r.e.jmpl = '1' then aluresult := (r.e.ctrl.pc(31 downto 2) + 1) & "00"; end if;
|
||||
|
||||
-- if(to_integer(signed(op1)) < to_integer(signed(op2))) then
|
||||
-- icc(0) := '0';
|
||||
-- else
|
||||
-- icc(0) := '1';
|
||||
-- end if;
|
||||
-- if(to_integer(unsigned(op1)) >= to_integer(unsigned(op2))) then
|
||||
-- icc(1) := '1';
|
||||
-- else
|
||||
-- icc(1) := '0';
|
||||
-- end if;
|
||||
-- if(op1 = op2) then
|
||||
-- icc(2) := '1';
|
||||
-- else
|
||||
-- icc(2) := '0';
|
||||
-- end if;
|
||||
|
||||
--divz := icc(2);
|
||||
-- Write icc, used for branch
|
||||
if r.e.ctrl.wicc = '1' then
|
||||
-- if (op = FMT3) and (op3 = WRPSR) then icco := logicout(23 downto 20);
|
||||
icco := icc;
|
||||
elsif r.m.ctrl.wicc = '1' then icco := me_icc;
|
||||
elsif r.x.ctrl.wicc = '1' then icco := r.x.icc;
|
||||
else icco := r.w.s.icc;
|
||||
end if;
|
||||
|
||||
-- if(r.e.ctrl.inst(6 downto 0) = R_BRANCH) then
|
||||
-- aluresult := (others => '0');
|
||||
-- if r.e.ctrl.wicc = '1' then
|
||||
-- aluresult := addout(32 downto 1);
|
||||
-- elsif r.m.ctrl.wicc = '1' then aluresult(3 downto 0) := me_icc;
|
||||
-- elsif r.x.ctrl.wicc = '1' then aluresult(3 downto 0) := r.x.icc;
|
||||
-- else aluresult(3 downto 0) := r.w.s.icc;
|
||||
-- end if;
|
||||
-- end if;
|
||||
--elsif r.m.ctrl.wicc = '1' then icco := me_icc;
|
||||
--elsif r.x.ctrl.wicc = '1' then icco := r.x.icc;
|
||||
--else icco := r.w.s.icc; end if;
|
||||
res := aluresult;
|
||||
end;
|
||||
|
||||
|
@ -2834,14 +2603,22 @@ end;
|
|||
end;
|
||||
|
||||
|
||||
-- Memory instructions involving float point registers, not implemented
|
||||
procedure fpstdata(r : in registers; edata, eres : in word; fpstdata : in std_logic_vector(31 downto 0);
|
||||
edata2, eres2 : out word) is
|
||||
variable op : std_logic_vector(1 downto 0);
|
||||
variable op3 : std_logic_vector(5 downto 0);
|
||||
begin
|
||||
edata2 := edata; eres2 := eres;
|
||||
|
||||
-- RV32I changes
|
||||
-- op := r.e.ctrl.inst(31 downto 30); op3 := r.e.ctrl.inst(24 downto 19);
|
||||
-- if FPEN then
|
||||
-- if FPEN and (op = LDST) and ((op3(5 downto 4) & op3(2)) = "101") and (r.e.ctrl.cnt /= "00") then
|
||||
-- edata2 := fpstdata; eres2 := fpstdata;
|
||||
-- end if;
|
||||
-- end if;
|
||||
-- if CASAEN and (r.m.casa = '1') and r.e.ctrl.cnt(1)='1' then
|
||||
-- edata2 := r.e.op1; eres2 := r.e.op1;
|
||||
-- end if;
|
||||
end;
|
||||
|
||||
function ld_align(data : dcdtype; set : std_logic_vector(DSETMSB downto 0);
|
||||
|
@ -2884,6 +2661,7 @@ end;
|
|||
return(outdata);
|
||||
end;
|
||||
|
||||
-- RISC-V mem trap not implemented
|
||||
|
||||
-- procedure mem_trap(r : registers; wpr : watchpoint_registers;
|
||||
-- annul, holdn : in std_ulogic;
|
||||
|
@ -2999,6 +2777,7 @@ end;
|
|||
-- trapout := trap; werrout := werr;
|
||||
-- end;
|
||||
|
||||
-- RISC-V IRQ trap not implemented
|
||||
procedure irq_trap(r : in registers;
|
||||
ir : in irestart_register;
|
||||
irl : in std_logic_vector(3 downto 0);
|
||||
|
@ -3044,7 +2823,7 @@ end;
|
|||
end;
|
||||
|
||||
-- write special registers
|
||||
|
||||
-- RISC-V SPECIAL INSTRUCTIONS ARE NOT COMPLETLY IMPLEMENTED AND SHOULD NOT BE USED
|
||||
procedure sp_write (r : registers; wpr : watchpoint_registers;
|
||||
s : out special_register_type; vwpr : out watchpoint_registers) is
|
||||
variable op : std_logic_vector(6 downto 0);
|
||||
|
@ -3191,6 +2970,7 @@ end;
|
|||
return(npc);
|
||||
end;
|
||||
|
||||
-- RISC-V mul instructions are not implemented
|
||||
procedure mul_res(r : registers; asr18in : word; result, y, asr18 : out word;
|
||||
icc : out std_logic_vector(3 downto 0)) is
|
||||
variable op : std_logic_vector(1 downto 0);
|
||||
|
@ -3387,16 +3167,7 @@ begin
|
|||
xc_mmucacheclr := '0';
|
||||
xc_inull := '0';
|
||||
|
||||
-- if r.x.mexc = '1' then xc_vectt := "00" & TT_DAEX;
|
||||
-- elsif r.x.ctrl.tt = TT_TICC then
|
||||
-- xc_vectt := '1' & r.x.result(6 downto 0);
|
||||
-- else xc_vectt := "00" & r.x.ctrl.tt; end if;
|
||||
|
||||
-- if r.w.s.svt = '0' then
|
||||
-- xc_trap_address(31 downto 2) := r.w.s.tba & xc_vectt & "00";
|
||||
-- else
|
||||
-- --xc_trap_address(31 downto 2) := r.w.s.tba & "00000000" & "00";
|
||||
-- end if;
|
||||
-- Gets trap address of evec (NOT COMPLETY IMPLEMENTED)
|
||||
xc_trap_address := r.w.s.evec(31 downto 2);
|
||||
|
||||
xc_wreg := '0'; v.x.annul_all := '0';
|
||||
|
@ -3420,14 +3191,6 @@ begin
|
|||
end if;
|
||||
|
||||
xc_trapcwp := r.w.s.cwp;
|
||||
-- if RFPART then
|
||||
-- if r.w.s.cwp=CWPMIN then
|
||||
-- xc_trapcwp := r.w.twcwp;
|
||||
-- else
|
||||
-- xc_trapcwp := std_logic_vector(unsigned(r.w.s.stwin) + unsigned(r.w.s.cwp));
|
||||
-- end if;
|
||||
-- end if;
|
||||
|
||||
|
||||
if DBGUNIT
|
||||
then
|
||||
|
@ -3436,6 +3199,7 @@ begin
|
|||
else dbgm := '0'; v.x.debug := '0'; end if;
|
||||
if PWRD2 then pwrd := powerdwn(r, xc_trap, rp); else pwrd := '0'; end if;
|
||||
|
||||
-- Processor current state
|
||||
case r.x.rstate is
|
||||
when run =>
|
||||
if (dbgm
|
||||
|
@ -3479,14 +3243,6 @@ begin
|
|||
xc_waddr(NWINLOG2 + 3 downto 0) := xc_trapcwp & "0010";
|
||||
if r.w.s.et = '1' then
|
||||
v.w.s.et := '0'; v.x.rstate := run;
|
||||
-- change cwp
|
||||
-- if RFPART and (r.w.s.cwp = CWPMIN) then v.w.s.cwp := r.w.s.cwpmax;
|
||||
-- elsif (not CWPOPT) and (r.w.s.cwp = CWPMIN) then v.w.s.cwp := CWPMAX;
|
||||
-- else v.w.s.cwp := r.w.s.cwp - 1 ; end if;
|
||||
-- if AWPEN then
|
||||
-- v.w.s.aw := '0';
|
||||
-- v.w.s.paw := r.w.s.aw;
|
||||
-- end if;
|
||||
else
|
||||
xc_inull := '1';
|
||||
v.x.rstate := dsu1; xc_wreg := '0'; vp.error := '1';
|
||||
|
@ -3568,7 +3324,7 @@ begin
|
|||
dci.flushl <= xc_dflushl;
|
||||
dci.mmucacheclr <= xc_mmucacheclr;
|
||||
|
||||
|
||||
-- Not changed
|
||||
irq_intack(r, holdn, v.x.intack);
|
||||
itrace(r, dsur, vdsu, wpr,xc_result, xc_exception, dbgi, rp.error, xc_trap, tbufcntx, tovx, tbufi, tbufi_2p, '0', xc_dcperr);
|
||||
vdsu.tbufcnt := tbufcntx; vdsu.tov := tovx;
|
||||
|
@ -3577,11 +3333,6 @@ begin
|
|||
if (r.x.rstate = dsu2) then v.w.except := '0'; end if;
|
||||
v.w.wa := xc_waddr(RFBITS-1 downto 0); v.w.wreg := xc_wreg and holdn;
|
||||
|
||||
-- if RFPART then
|
||||
-- v.w.twcwp := std_logic_vector(unsigned(v.w.s.stwin) + unsigned(v.w.s.cwpmax) + 1);
|
||||
-- if (not CWPOPT) and v.w.twcwp=CWPGLB then v.w.twcwp:=CWPMIN; end if;
|
||||
-- end if;
|
||||
|
||||
rfi.wdata <= xc_result; rfi.waddr <= xc_waddr;
|
||||
|
||||
irqo.intack <= r.x.intack and holdn;
|
||||
|
@ -3601,14 +3352,11 @@ begin
|
|||
v.w.except := RRES.w.except; v.w.s.et := RRES.w.s.et;
|
||||
v.w.s.svt := RRES.w.s.svt; v.w.s.dwt := RRES.w.s.dwt;
|
||||
v.w.s.ef := RRES.w.s.ef;
|
||||
-- if RFPART then
|
||||
-- v.w.s.stwin := RRES.w.s.stwin;
|
||||
-- v.w.s.cwpmax := RRES.w.s.cwpmax;
|
||||
-- end if;
|
||||
-- if need_extra_sync_reset(fabtech) /= 0 then
|
||||
-- v.w.s.cwp := RRES.w.s.cwp;
|
||||
-- v.w.s.icc := RRES.w.s.icc;
|
||||
-- end if;
|
||||
|
||||
if need_extra_sync_reset(fabtech) /= 0 then
|
||||
v.w.s.cwp := RRES.w.s.cwp;
|
||||
v.w.s.icc := RRES.w.s.icc;
|
||||
end if;
|
||||
v.w.s.dbp := RRES.w.s.dbp;
|
||||
v.w.s.dbprepl := RRES.w.s.dbprepl;
|
||||
v.w.s.rexdis := RRES.w.s.rexdis;
|
||||
|
@ -3647,13 +3395,10 @@ begin
|
|||
v.x.rs1 := r.m.rs1;
|
||||
st := '0';
|
||||
|
||||
-- if CASAEN and (r.m.casa = '1') and (r.m.ctrl.cnt = "00") then
|
||||
-- v.x.ctrl.inst(4 downto 0) := r.a.ctrl.inst(4 downto 0); -- restore rs2 for trace log
|
||||
-- end if;
|
||||
|
||||
-- Mul nos implemented
|
||||
mul_res(r, v.w.s.asr18, v.x.result, v.x.y, me_asr18, me_icc);
|
||||
|
||||
|
||||
-- Memory instruction and irq traps disabled
|
||||
-- mem_trap(r, wpr, v.x.ctrl.annul, holdn, v.x.ctrl.trap, me_iflush,
|
||||
-- me_nullify, v.m.werr, v.x.ctrl.tt);
|
||||
-- me_newtt := v.x.ctrl.tt;
|
||||
|
@ -3729,8 +3474,12 @@ begin
|
|||
ex_ymsb := r.e.ymsb; mul_op2 := ex_op2; ex_shcnt := r.e.shcnt;
|
||||
v.e.cwp := r.a.cwp; ex_sari := r.e.sari;
|
||||
v.m.su := r.e.su;
|
||||
-- May remove this
|
||||
if MULTYPE = 3 then v.m.mul := r.e.mul; else v.m.mul := '0'; end if;
|
||||
|
||||
-- MUL related
|
||||
if MULTYPE = 3 then v.m.mul := r.e.mul;
|
||||
else v.m.mul := '0'; end if;
|
||||
|
||||
-- Related to load instructions, do not remove
|
||||
if lddel = 1 then
|
||||
if r.e.ldbp1 = '1' then
|
||||
ex_op1 := r.x.data(0);
|
||||
|
@ -3744,58 +3493,62 @@ begin
|
|||
end if;
|
||||
end if;
|
||||
end if;
|
||||
---
|
||||
|
||||
-- Adder
|
||||
ex_add_res := ("0" & ex_op1 & '1') + ("0" & ex_op2 & r.e.alucin);
|
||||
|
||||
-- Check align (used by mem instructions)
|
||||
if ex_add_res(2 downto 1) = "00" then v.m.nalign := '0';
|
||||
else v.m.nalign := '1'; end if;
|
||||
-- if REX=1 then
|
||||
-- if ex_add_res(2 downto 1) /= "10" then v.m.rexnalign := '0';
|
||||
-- else v.m.rexnalign := '1'; end if;
|
||||
-- end if;
|
||||
|
||||
-- Data cache
|
||||
dcache_gen(r, v, ex_dci, ex_link_pc, ex_jump, ex_force_a2, ex_load, v.m.casa);
|
||||
|
||||
-- RV32I change
|
||||
-- Jump address
|
||||
if(r.e.alusel = EXE_RES_ADD) then -- JALR
|
||||
ex_jump_address := ex_add_res(32 downto PCLOW+1);
|
||||
else -- JAL
|
||||
ex_jump_address := ex_add_res(32 downto PCLOW+1) + r.e.ctrl.pc(31 downto PCLOW);
|
||||
end if;
|
||||
|
||||
|
||||
-- Logic instructions
|
||||
logic_op(r, ex_op1, ex_op2, v.x.y, ex_ymsb, ex_logic_res, v.m.y);
|
||||
ex_shift_res := shift(r, ex_op1, ex_op2, ex_shcnt, ex_sari);
|
||||
misc_op(r, wpr, ex_op1, ex_op2, xc_df_result, v.x.y, xc_wimmask, ex_misc_res, ex_edata);
|
||||
--ex_add_res(3):= ex_add_res(3) or ex_force_a2;
|
||||
|
||||
-- Shift instructions
|
||||
ex_shift_res := shift(r, ex_op1, ex_op2, ex_shcnt, ex_sari);
|
||||
|
||||
-- Other instructions
|
||||
misc_op(r, wpr, ex_op1, ex_op2, xc_df_result, v.x.y, xc_wimmask, ex_misc_res, ex_edata);
|
||||
|
||||
-- Select ALU outputs
|
||||
alu_select(r, ex_add_res, ex_op1, ex_op2, ex_shift_res, ex_logic_res,
|
||||
ex_misc_res, ex_result, me_icc, v.m.icc, v.m.divz, v.m.casaz);
|
||||
|
||||
-- DSU outs
|
||||
dbg_cache(holdn, dbgi, r, dsur, ex_result, ex_dci, ex_result2, v.m.dci);
|
||||
|
||||
-- Float point (not implemented)
|
||||
fpstdata(r, ex_edata, ex_result2, fpo.data, ex_edata2, ex_result3);
|
||||
|
||||
-- Pass rs1 (may be used in future for special instructions)
|
||||
v.m.rs1 := ex_op1;
|
||||
-- ALU result
|
||||
v.m.result := ex_result3;
|
||||
|
||||
-- Register windows related, will be removed
|
||||
cwp_ex(r, v.m.wcwp, v.m.wawp);
|
||||
|
||||
-- if CASAEN and ( (LDDEL=1 and (r.m.casa='1' and r.e.ctrl.cnt="10")) or
|
||||
-- (LDDEL=2 and (r.m.casa='1' and r.e.ctrl.cnt="11")))
|
||||
-- and v.m.casaz='0' then
|
||||
-- me_nullify2 := '1';
|
||||
-- end if;
|
||||
-- dci.nullify <= me_nullify2;
|
||||
dci.nullify <= '0';
|
||||
|
||||
ex_mulop1 := (ex_op1(31) and r.e.ctrl.inst(19)) & ex_op1;
|
||||
ex_mulop2 := (mul_op2(31) and r.e.ctrl.inst(19)) & mul_op2;
|
||||
-- Mul related, not implemented
|
||||
--ex_mulop1 := (ex_op1(31) and r.e.ctrl.inst(19)) & ex_op1;
|
||||
--ex_mulop2 := (mul_op2(31) and r.e.ctrl.inst(19)) & mul_op2;
|
||||
|
||||
if is_fpga(fabtech) = 0 and (r.e.mul = '0') then -- power-save for mul
|
||||
-- if (r.e.mul = '0') then
|
||||
ex_mulop1 := (others => '0'); ex_mulop2 := (others => '0');
|
||||
end if;
|
||||
|
||||
|
||||
-- Updates pipeline registers
|
||||
v.m.ctrl.annul := v.m.ctrl.annul or v.x.annul_all;
|
||||
v.m.ctrl.wicc := r.e.ctrl.wicc and not v.x.annul_all;
|
||||
v.m.mac := r.e.mac;
|
||||
|
@ -3803,9 +3556,9 @@ begin
|
|||
if (DBGUNIT and (r.x.rstate = dsu2)) then v.m.ctrl.ld := '1'; end if;
|
||||
dci.eaddress <= ex_add_res(32 downto 1);
|
||||
dci.edata <= ex_edata2;
|
||||
-- BP disabled
|
||||
--bp_miss_ex(r, r.m.icc, ex_bpmiss, ra_bpannul);
|
||||
|
||||
|
||||
v.m .itrhit := r.e.itrhit;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
@ -3826,18 +3579,25 @@ begin
|
|||
v.e.rfe1 := r.a.rfe1; v.e.rfe2 := r.a.rfe2;
|
||||
v.e.ctrl.pv := r.a.ctrl.pv or (ra_bpannul and r.a.bpimiss);
|
||||
|
||||
-- Exception
|
||||
exception_detect(r, wpr, dbgi, r.a.ctrl.trap, r.a.ctrl.tt,
|
||||
pccomp, v.e.ctrl.trap, v.e.ctrl.tt);
|
||||
-- op_mux is the same
|
||||
-- Operands muxes for ALU
|
||||
op_mux(r, rfo.data1, ex_result3, v.x.result, xc_df_result, zero32,
|
||||
r.a.rsel1, v.e.ldbp1, ra_op1, '0');
|
||||
op_mux(r, rfo.data2, ex_result3, v.x.result, xc_df_result, r.a.imm,
|
||||
r.a.rsel2, ex_ldbp2, ra_op2, '1');
|
||||
|
||||
-- Selects ALU operation
|
||||
alu_op(r, ra_op1, ra_op2, v.m.icc, v.m.y(0), ex_ldbp2, v.e.op1, v.e.op2,
|
||||
v.e.aluop, v.e.alusel, v.e.aluadd, v.e.shcnt, v.e.sari, v.e.shleft,
|
||||
v.e.ymsb, v.e.mul, ra_div, v.e.mulstep, v.e.mac, v.e.ldbp2, v.e.invop2
|
||||
);
|
||||
|
||||
-- Carry for ALU adder
|
||||
cin_gen(r, v.m.icc(0), v.e.alucin);
|
||||
|
||||
-- BP disabled
|
||||
--bp_miss_ra(r, ra_bpmiss, de_bpannul);
|
||||
--v.e.bp := r.a.bp and not ra_bpmiss;
|
||||
|
||||
|
@ -3865,17 +3625,14 @@ begin
|
|||
de_rexbubble := '0'; de_rexbaddr1:='0'; de_reximmexp:='0'; de_reximmval:=(others => '0');
|
||||
de_rexmaskpv := '0'; de_rexillinst:='0'; de_rexnostep:='0';
|
||||
|
||||
--de_inst := de_inst1;
|
||||
-- Swap endianess, Leon3 was designed for big-endian
|
||||
de_inst(7 downto 0) := de_inst1(31 downto 24);
|
||||
de_inst(15 downto 8) := de_inst1(23 downto 16);
|
||||
de_inst(23 downto 16) := de_inst1(15 downto 8);
|
||||
de_inst(31 downto 24) := de_inst1(7 downto 0);
|
||||
|
||||
de_icc := r.m.icc; v.a.cwp := r.d.cwp;
|
||||
if AWPEN then
|
||||
v.a.awp:=r.d.awp; v.a.aw:=r.d.aw; v.a.paw:=r.d.paw;
|
||||
v.e.awp:=r.a.awp; v.e.aw:=r.a.aw; v.e.paw:=r.a.paw;
|
||||
end if;
|
||||
-- May be removed
|
||||
su_et_select(r, v.w.s.ps, v.w.s.s, v.w.s.et, v.a.su, v.a.et);
|
||||
|
||||
-- ICC is updated on branches for RV32I
|
||||
|
@ -3883,9 +3640,7 @@ begin
|
|||
v.a.ctrl.wy := '0';
|
||||
|
||||
de_rcwp := r.d.cwp;
|
||||
--if AWPEN and r.d.aw='1' then de_rcwp := r.d.awp; end if;
|
||||
cwp_ctrl(r, de_rcwp, v.w.s.wim, de_inst, de_cwp, v.a.wovf, v.a.wunf, de_wcwp);
|
||||
--if AWPEN and (r.d.aw='1' or (r.d.paw='1' and de_inst(24 downto 19)=RETT)) then v.a.wovf:='0'; v.a.wunf:='0'; end if;
|
||||
|
||||
-- Get rs1 and rs2
|
||||
rs1_gen(r, de_inst, v.a.rs1, de_rs1mod);
|
||||
|
@ -3893,16 +3648,17 @@ begin
|
|||
|
||||
-- Get registers address based on the LEON3 register window system
|
||||
de_raddr1 := (others => '0'); de_raddr2 := (others => '0');
|
||||
regaddr(de_rcwp, v.a.rs1, r.d.stwin, r.d.cwpmax, de_raddr1(RFBITS-1 downto 0));
|
||||
regaddr(de_rcwp, de_rs2, r.d.stwin, r.d.cwpmax, de_raddr2(RFBITS-1 downto 0));
|
||||
de_raddr1(4 downto 0) := v.a.rs1(4 downto 0);
|
||||
de_raddr2(4 downto 0) := de_rs2(4 downto 0);
|
||||
|
||||
v.a.rfa1 := de_raddr1(RFBITS-1 downto 0);
|
||||
v.a.rfa2 := de_raddr2(RFBITS-1 downto 0);
|
||||
|
||||
-- Get rd and set write enable and other LEON3 signals
|
||||
rd_gen(r, de_inst, v.a.ctrl.wreg, v.a.ctrl.ld, de_rd, de_rexen);
|
||||
regaddr(de_cwp, de_rd, r.d.stwin, r.d.cwpmax, v.a.ctrl.rd);
|
||||
v.a.ctrl.rd := de_rd(4 downto 0);
|
||||
|
||||
-- No FP unit
|
||||
-- No RISC-V FP unit
|
||||
-- fpbranch(de_inst, fpo.cc, de_fbranch);
|
||||
-- fpbranch(de_inst, cpo.cc, de_cbranch);
|
||||
|
||||
|
@ -3923,6 +3679,7 @@ begin
|
|||
ra_bpmiss, ex_bpmiss, de_iperr, ico.bpmiss, ico.eocl);
|
||||
v.d.pcheld := de_hold_pc;
|
||||
|
||||
-- Branch prediction disabled
|
||||
--v.a.bp := v.a.bp and not v.a.ctrl.annul;
|
||||
--v.a.nobp := v.a.nobp and not v.a.ctrl.annul;
|
||||
|
||||
|
@ -3939,7 +3696,7 @@ begin
|
|||
op_find(r, v.a.ldchkra, v.a.ldchkex, de_rs2, v.a.rfa2,
|
||||
imm_select(de_inst,(de_rexen and not r.w.s.rexdis)), v.a.rfe2, v.a.rsel2, v.a.ldcheck2);
|
||||
|
||||
-- May change this part for Branch prediction
|
||||
-- Updates signals
|
||||
v.a.ctrl.wicc := v.a.ctrl.wicc and (not v.a.ctrl.annul);
|
||||
v.a.ctrl.wreg := v.a.ctrl.wreg and (not v.a.ctrl.annul);
|
||||
v.a.ctrl.rett := v.a.ctrl.rett and (not v.a.ctrl.annul);
|
||||
|
@ -4015,6 +3772,7 @@ begin
|
|||
if (xc_rstn = '0') then v.d.irqstart:='0'; end if;
|
||||
end if;
|
||||
|
||||
-- Slect next PC based on branch predictions (which are disabled)
|
||||
bpmiss := ex_bpmiss or ra_bpmiss;
|
||||
npc := r.f.pc; fe_pc := r.f.pc;
|
||||
if ra_bpmiss = '1' then fe_pc := r.d.pc; end if;
|
||||
|
@ -4034,7 +3792,7 @@ begin
|
|||
elsif xc_exception = '1' then -- exception
|
||||
v.f.branch := '1'; v.f.pc := xc_trap_address;
|
||||
npc := v.f.pc;
|
||||
elsif de_hold_pc = '1' then
|
||||
elsif de_hold_pc = '1' then -- 2 or more cycles instructions
|
||||
v.f.pc := r.f.pc; v.f.branch := r.f.branch;
|
||||
-- if bpmiss = '1' then
|
||||
-- v.f.pc := fe_npc; v.f.branch := '1';
|
||||
|
@ -4043,7 +3801,7 @@ begin
|
|||
v.f.pc := ex_jump_address; v.f.branch := '1';
|
||||
npc := v.f.pc;
|
||||
end if;
|
||||
elsif ex_jump = '1' then
|
||||
elsif ex_jump = '1' then -- Jump
|
||||
v.f.pc := ex_jump_address; v.f.branch := '1';
|
||||
npc := v.f.pc;
|
||||
-- elsif (ex_jump and not bpmiss) = '1' then
|
||||
|
@ -4053,7 +3811,7 @@ begin
|
|||
-- v.f.pc := r.d.pc; v.f.branch := '1';
|
||||
-- npc := v.f.pc;
|
||||
-- v.a.bpimiss := ico.bpmiss and not r.d.annul;
|
||||
elsif de_branch = '1'
|
||||
elsif de_branch = '1' -- Branch
|
||||
then
|
||||
v.f.pc := branch_address(de_inst, de_pcout(31 downto PCLOW), de_rexbaddr1, r.d.rexen); v.f.branch := '1';
|
||||
npc := v.f.pc;
|
||||
|
@ -4079,11 +3837,6 @@ begin
|
|||
|
||||
end if;
|
||||
|
||||
-- For pipelined REX implementation
|
||||
--if REX/=0 and REXPIPE then
|
||||
-- rex_pl_fetch(v.d,r.d,holdn,
|
||||
-- v.d.rexpl);
|
||||
--end if;
|
||||
-----------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
######################################################################
|
||||
################################################################################
|
||||
#
|
||||
# Author: Lucas Castro
|
||||
# Last modification: jan/2018
|
||||
# Last modification: march/2018
|
||||
#
|
||||
# Makefile for running programs on ReonV
|
||||
#
|
||||
######################################################################
|
||||
################################################################################
|
||||
#
|
||||
# Update the following variables to your environment and board used
|
||||
|
||||
|
@ -15,10 +15,6 @@ CROSS=../../rv32i-gcc/bin/riscv32-unknown-elf-
|
|||
# Design you are targeting
|
||||
DESIGN=leon3-digilent-nexys4ddr
|
||||
|
||||
# Leon3 designs might use a prom.srec to load boot code.
|
||||
# This is the binary to .srec converter this makefile will look for.
|
||||
# In need check this one under GPL: http://www.s-record.com/
|
||||
BIN2SREC=../../srec/bin2srec
|
||||
|
||||
CC=gcc
|
||||
AS=as
|
||||
|
@ -27,15 +23,13 @@ CFLAGS=-nostdlib
|
|||
OBJCPFLAGS=-O binary -j .text -j .data
|
||||
LD_SCRIPT=ld_script
|
||||
WRAP=-Wl,-wrap,exit,-wrap,open,-wrap,close,-wrap,write,-wrap,read,-wrap,lseek,-wrap,sbrk
|
||||
TEST_FILES = $(wildcard acstone/*.c)
|
||||
TEST_PROGS = $(patsubst %.c,%.out,$(TEST_FILES))
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Targets for compiling
|
||||
#
|
||||
# Compiled binary linked with reonv_crt0
|
||||
%.out : %.c reonv_crt0.o posix.o console.o
|
||||
%.out : %.c reonv_crt0.o posix.o
|
||||
${CROSS}${CC} -static -march=rv32i ${WRAP} -T${LD_SCRIPT} $< -o $@
|
||||
|
||||
# Targets for .S.
|
||||
|
@ -44,12 +38,6 @@ TEST_PROGS = $(patsubst %.c,%.out,$(TEST_FILES))
|
|||
%.hex : %.S
|
||||
${CROSS}$(AS) $< -o $@
|
||||
|
||||
console.o: console.c
|
||||
${CROSS}${CC} -c -static $< -o $@
|
||||
|
||||
reonv_print.o : reonv_print/console_dbg.c
|
||||
${CROSS}${CC} -c -static -static-libgcc -lgcc $< -o $@
|
||||
|
||||
posix.o : posix.c
|
||||
${CROSS}${CC} -c $< -o $@ -nostdlib ${WRAP}
|
||||
|
||||
|
@ -79,11 +67,4 @@ ahbrom : ../bin/ahbrom.c
|
|||
gcc ../bin/ahbrom.c -o ahbrom
|
||||
|
||||
clean:
|
||||
rm -rf ahbrom* *.hex *.inv *.bin *.o *.log *.jou *.str acstone/*.out
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Run tests
|
||||
#
|
||||
# Create test programs
|
||||
build_tests: ${TEST_PROGS}
|
||||
rm -rf ahbrom* *.hex *.inv *.bin *.o *.log *.jou *.str acstone/*.out *.out *.read
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
/**
|
||||
* @file 000.main.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* @file 011.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed char and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed char c;
|
||||
|
||||
c=0x55;
|
||||
/* After c is 85 */
|
||||
|
||||
/* Before c is 85 */ c=0xAA;
|
||||
/* After c is -86 */
|
||||
|
||||
/* Before c is -86 */ c=0x00;
|
||||
/* After c is 0 */
|
||||
|
||||
/* Before c is 0 */ c=0xFF;
|
||||
/* After c is -1 */
|
||||
|
||||
/* Before c is -1 */ c=0x80;
|
||||
/* After c is -128 */
|
||||
|
||||
/* Before c is -128 */ c=0x01;
|
||||
/* After c is 1 */
|
||||
|
||||
/* Before c is 1 */ c=0x7F;
|
||||
/* After c is 127 */
|
||||
|
||||
/* Before c is 127 */ c=0xFE;
|
||||
/* After c is -2 */
|
||||
|
||||
/* Before c is -2 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* @file 012.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned char and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned char uc;
|
||||
|
||||
uc=0x55;
|
||||
/* After uc is 85 */
|
||||
|
||||
/* Before uc is 85 */ uc=0xAA;
|
||||
/* After uc is 170 */
|
||||
|
||||
/* Before uc is 170 */ uc=0x00;
|
||||
/* After uc is 0 */
|
||||
|
||||
/* Before uc is 0 */ uc=0xFF;
|
||||
/* After uc is 255 */
|
||||
|
||||
/* Before uc is 255 */ uc=0x80;
|
||||
/* After uc is 128 */
|
||||
|
||||
/* Before uc is 128 */ uc=0x01;
|
||||
/* After uc is 1 */
|
||||
|
||||
/* Before uc is 1 */ uc=0x7F;
|
||||
/* After uc is 127 */
|
||||
|
||||
/* Before uc is 127 */ uc=0xFE;
|
||||
/* After uc is 254 */
|
||||
|
||||
/* Before uc is 254 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* @file 013.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed short int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed short int si;
|
||||
|
||||
si=0x5555;
|
||||
/* After si is 21845 */
|
||||
|
||||
/* Before si is 21845 */ si=0xAAAA;
|
||||
/* After si is -21846 */
|
||||
|
||||
/* Before si is -21846 */ si=0x0000;
|
||||
/* After si is 0 */
|
||||
|
||||
/* Before si is 0 */ si=0xFFFF;
|
||||
/* After si is -1 */
|
||||
|
||||
/* Before si is -1 */ si=0x8000;
|
||||
/* After si is -32768 */
|
||||
|
||||
/* Before si is -32768 */ si=0x0001;
|
||||
/* After si is 1 */
|
||||
|
||||
/* Before si is 1 */ si=0x7FFF;
|
||||
/* After si is 32767 */
|
||||
|
||||
/* Before si is 32767 */ si=0xFFFE;
|
||||
/* After si is -2 */
|
||||
|
||||
/* Before si is -2 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* @file 014.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned short int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned short int usi;
|
||||
|
||||
usi=0x5555;
|
||||
/* After usi is 21845 */
|
||||
|
||||
/* Before usi is 21845 */ usi=0xAAAA;
|
||||
/* After usi is 43690 */
|
||||
|
||||
/* Before usi is 43690 */ usi=0x0000;
|
||||
/* After usi is 0 */
|
||||
|
||||
/* Before usi is 0 */ usi=0xFFFF;
|
||||
/* After usi is 65535 */
|
||||
|
||||
/* Before usi is 65535 */ usi=0x8000;
|
||||
/* After usi is 32768 */
|
||||
|
||||
/* Before usi is 32768 */ usi=0x0001;
|
||||
/* After usi is 1 */
|
||||
|
||||
/* Before usi is 1 */ usi=0x7FFF;
|
||||
/* After usi is 32767 */
|
||||
|
||||
/* Before usi is 32767 */ usi=0xFFFE;
|
||||
/* After usi is 65534 */
|
||||
|
||||
/* Before usi is 65534 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,70 +0,0 @@
|
|||
/**
|
||||
* @file 015.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed int i;
|
||||
i=0x55555555;
|
||||
/* After i is 1431655765 */
|
||||
|
||||
/* Before i is 1431655765 */ i=0xAAAAAAAA;
|
||||
/* After i is -1431655766 */
|
||||
|
||||
/* Before i is -1431655766 */ i=0x00000000;
|
||||
/* After i is 0 */
|
||||
|
||||
/* Before i is 0 */ i=0xFFFFFFFF;
|
||||
/* After i is -1 */
|
||||
|
||||
/* Before i is -1 */ i=0x80000000;
|
||||
/* After i is -2147483648 */
|
||||
|
||||
/* Before i is -2147483648 */ i=0x00000001;
|
||||
/* After i is 1 */
|
||||
|
||||
/* Before i is 1 */ i=0x7FFFFFFF;
|
||||
/* After i is 2147483647 */
|
||||
|
||||
/* Before i is 2147483647 */ i=0xFFFFFFFE;
|
||||
/* After i is -2 */
|
||||
|
||||
/* Before i is -2 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* @file 016.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned int ui;
|
||||
|
||||
ui=0x55555555;
|
||||
/* After ui is 1431655765 */
|
||||
|
||||
/* Before ui is 1431655765 */ ui=0xAAAAAAAA;
|
||||
/* After ui is 2863311530 */
|
||||
|
||||
/* Before ui is 2863311530 */ ui=0x00000000;
|
||||
/* After ui is 0 */
|
||||
|
||||
/* Before ui is 0 */ ui=0xFFFFFFFF;
|
||||
/* After ui is 4294967295 */
|
||||
|
||||
/* Before ui is 4294967295 */ ui=0x80000000;
|
||||
/* After ui is 2147483648 */
|
||||
|
||||
/* Before ui is 2147483648 */ ui=0x00000001;
|
||||
/* After ui is 1 */
|
||||
|
||||
/* Before ui is 1 */ ui=0x7FFFFFFF;
|
||||
/* After ui is 2147483647 */
|
||||
|
||||
/* Before ui is 2147483647 */ ui=0xFFFFFFFE;
|
||||
/* After ui is 4294967294 */
|
||||
|
||||
/* Before ui is 4294967294 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* @file 017.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed long long int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed long long int li;
|
||||
|
||||
li=0x5555555555555555LL;
|
||||
/* After li is 6148914691236517205 */
|
||||
|
||||
/* Before li is 6148914691236517205 */ li=0xAAAAAAAAAAAAAAAALL;
|
||||
/* After li is -6148914691236517206 */
|
||||
|
||||
/* Before li is -6148914691236517206 */ li=0x0000000000000000LL;
|
||||
/* After li is 0 */
|
||||
|
||||
/* Before li is 0 */ li=0xFFFFFFFFFFFFFFFFLL;
|
||||
/* After li is -1 */
|
||||
|
||||
/* Before li is -1 */ li=0x8000000000000000LL;
|
||||
/* After li is -9223372036854775808 */
|
||||
|
||||
/* Before li is -9223372036854775808 */ li=0x0000000000000001LL;
|
||||
/* After li is 1 */
|
||||
|
||||
/* Before li is 1 */ li=0x7FFFFFFFFFFFFFFFLL;
|
||||
/* After li is 9223372036854775807 */
|
||||
|
||||
/* Before li is 9223372036854775807 */ li=0xFFFFFFFFFFFFFFFELL;
|
||||
/* After li is -2 * /
|
||||
|
||||
/* Before li is -2 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* @file 018.const.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned long long int and returns 0.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned long long int uli;
|
||||
|
||||
uli=0x5555555555555555ULL;
|
||||
/* After uli is 6148914691236517205 */
|
||||
|
||||
/* Before uli is 6148914691236517205 */ uli=0xAAAAAAAAAAAAAAAAULL;
|
||||
/* After uli is 12297829382473034410 */
|
||||
|
||||
/* Before uli is 12297829382473034410 */ uli=0x0000000000000000ULL;
|
||||
/* After uli is 0 */
|
||||
|
||||
/* Before uli is 0 */ uli=0xFFFFFFFFFFFFFFFFULL;
|
||||
/* After uli is 18446744073709551615 */
|
||||
|
||||
/* Before uli is 18446744073709551615 */ uli=0x8000000000000000ULL;
|
||||
/* After uli is 9223372036854775808 */
|
||||
|
||||
/* Before uli is 9223372036854775808 */ uli=0x0000000000000001ULL;
|
||||
/* After uli is 1 */
|
||||
|
||||
/* Before uli is 1 */ uli=0x7FFFFFFFFFFFFFFFULL;
|
||||
/* After uli is 9223372036854775807 */
|
||||
|
||||
/* Before uli is 9223372036854775807 */ uli=0xFFFFFFFFFFFFFFFEULL;
|
||||
/* After uli is 18446744073709551614 * /
|
||||
|
||||
/* Before uli is 18446744073709551614 */ return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,67 +0,0 @@
|
|||
/**
|
||||
* @file 021.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main that uses cast signed char to signed short int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int si;
|
||||
signed char c;
|
||||
|
||||
si=0;
|
||||
c=0x01;
|
||||
si=c;
|
||||
|
||||
/* Before si must be 1 */ si=0;
|
||||
c=0xFF;
|
||||
si=c;
|
||||
|
||||
/* Before si must be -1 */ si=0;
|
||||
c=0x80;
|
||||
si=c;
|
||||
|
||||
/* Before si must be -128 */ si=0;
|
||||
c=0x7F;
|
||||
si=c;
|
||||
|
||||
/* Before si must be 127 */ si=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,67 +0,0 @@
|
|||
/**
|
||||
* @file 022.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main that uses cast signed char to signed int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int i;
|
||||
signed char c;
|
||||
|
||||
i=0;
|
||||
c=0x01;
|
||||
i=c;
|
||||
|
||||
/* Before i must be 1 */ i=0;
|
||||
c=0xFF;
|
||||
i=c;
|
||||
|
||||
/* Before i must be -1 */ i=0;
|
||||
c=0x80;
|
||||
i=c;
|
||||
|
||||
/* Before i must be -128 */ i=0;
|
||||
c=0x7F;
|
||||
i=c;
|
||||
|
||||
/* Before i must be 127 */ i=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,67 +0,0 @@
|
|||
/**
|
||||
* @file 023.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main that uses cast signed char to signed long long int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int li;
|
||||
signed char c;
|
||||
|
||||
li=0;
|
||||
c=0x01;
|
||||
li=c;
|
||||
|
||||
/* Before li must be 1 */ li=0;
|
||||
c=0xFF;
|
||||
li=c;
|
||||
|
||||
/* Before li must be -1 */ li=0;
|
||||
c=0x80;
|
||||
li=c;
|
||||
|
||||
/* Before li must be -128 */ li=0;
|
||||
c=0x7F;
|
||||
li=c;
|
||||
|
||||
/* Before li must be 127 */ li=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,67 +0,0 @@
|
|||
/**
|
||||
* @file 024.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main that uses cast signed short int to signed int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int i;
|
||||
signed short int si;
|
||||
|
||||
i=0;
|
||||
si=0x0001;
|
||||
i=si;
|
||||
|
||||
/* Before i must be 1 */ i=0;
|
||||
si=0xFFFF;
|
||||
i=si;
|
||||
|
||||
/* Before i must be -1 */ i=0;
|
||||
si=0x8000;
|
||||
i=si;
|
||||
|
||||
/* Before i must be -32768 */ i=0;
|
||||
si=0x7FFF;
|
||||
i=si;
|
||||
|
||||
/* Before i must be 32767 */ i=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,67 +0,0 @@
|
|||
/**
|
||||
* @file 025.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main that uses cast signed short int to signed long long int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int li;
|
||||
signed short int si;
|
||||
|
||||
li=0;
|
||||
si=0x0001;
|
||||
li=si;
|
||||
|
||||
/* Before li must be 1 */ li=0;
|
||||
si=0xFFFF;
|
||||
li=si;
|
||||
|
||||
/* Before li must be -1 */ li=0;
|
||||
si=0x8000;
|
||||
li=si;
|
||||
|
||||
/* Before li must be -32768 */ li=0;
|
||||
si=0x7FFF;
|
||||
li=si;
|
||||
|
||||
/* Before li must be 32767 */ li=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,67 +0,0 @@
|
|||
/**
|
||||
* @file 026.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main that uses cast signed int to signed long long int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int li;
|
||||
signed int i;
|
||||
|
||||
li=0;
|
||||
i=0x00000001;
|
||||
li=i;
|
||||
|
||||
/* Before li must be 1 */ li=0;
|
||||
i=0xFFFFFFFF;
|
||||
li=i;
|
||||
|
||||
/* Before li must be -1 */ li=0;
|
||||
i=0x80000000;
|
||||
li=i;
|
||||
|
||||
/* Before li must be -2147483648 */ li=0;
|
||||
i=0x7FFFFFFF;
|
||||
li=i;
|
||||
|
||||
/* Before li must be 2147483647 */ li=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,66 +0,0 @@
|
|||
/**
|
||||
* @file 027.cast.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main that uses some unsigned casts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int uli;
|
||||
unsigned int ui;
|
||||
unsigned short int usi;
|
||||
unsigned char uc;
|
||||
|
||||
uc=0xFF;
|
||||
usi=0xFFFF;
|
||||
usi=uc;
|
||||
/* Before usi must be 225 */ usi=0;
|
||||
|
||||
usi=0xFFFF;
|
||||
ui=0xFFFFFFFF;
|
||||
ui=usi;
|
||||
/* Before ui must be 65535 */ ui=0;
|
||||
|
||||
ui=0xFFFFFFFF;
|
||||
uli=0xFFFFFFFFFFFFFFFFULL;
|
||||
uli=ui;
|
||||
/* Before uli must be 4294967295 */ uli=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,154 +0,0 @@
|
|||
/**
|
||||
* @file 031.add.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned char adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b,c;
|
||||
signed char d;
|
||||
unsigned char ua,ub,uc;
|
||||
unsigned char ud;
|
||||
|
||||
a=0x0A;
|
||||
b=0x14;
|
||||
c=a+b;
|
||||
/* Before c must be 30 */ c=0;
|
||||
|
||||
a=0xEC;
|
||||
b=0xE2;
|
||||
c=a+b;
|
||||
/* Before c must be -50 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0x02;
|
||||
c=a+b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0A;
|
||||
b=0xFB;
|
||||
c=a+b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0x05;
|
||||
b=0xF6;
|
||||
c=a+b;
|
||||
/* Before c must be -5 */ c=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0xF0;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xAA;
|
||||
b=0x55;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
d=0;
|
||||
d+=1;
|
||||
d+=2;
|
||||
d+=3;
|
||||
d+=4;
|
||||
d+=5;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
|
||||
ua=0x0A;
|
||||
ub=0x14;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 30 */ uc=0;
|
||||
|
||||
ua=0xEC;
|
||||
ub=0xE2;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 206 */ uc=0;
|
||||
|
||||
ua=0xFE;
|
||||
ub=0x02;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
ua=0x0A;
|
||||
ub=0xFB;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 5 */ uc=0;
|
||||
|
||||
ua=0x05;
|
||||
ub=0xF6;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 251 */ uc=0;
|
||||
|
||||
ua=0x0F;
|
||||
ub=0xF0;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 255 */ uc=0;
|
||||
|
||||
ua=0xAA;
|
||||
ub=0x55;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 255 */ uc=0;
|
||||
|
||||
ud=0;
|
||||
ud+=1;
|
||||
ud+=2;
|
||||
ud+=3;
|
||||
ud+=4;
|
||||
ud+=5;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
d=15;
|
||||
d+=0xFF;
|
||||
d+=0xFE;
|
||||
d+=0xFD;
|
||||
d+=0xFC;
|
||||
d+=0xFB;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
ud=15;
|
||||
ud+=0xFF;
|
||||
ud+=0xFE;
|
||||
ud+=0xFD;
|
||||
ud+=0xFC;
|
||||
ud+=0xFB;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,154 +0,0 @@
|
|||
/**
|
||||
* @file 032.add.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned short int adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b,c;
|
||||
signed short int d;
|
||||
unsigned short int ua,ub,uc;
|
||||
unsigned short int ud;
|
||||
|
||||
a=0x00FF;
|
||||
b=0xFF00;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFEC;
|
||||
b=0xFFE2;
|
||||
c=a+b;
|
||||
/* Before c must be -50 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0x0002;
|
||||
c=a+b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x000A;
|
||||
b=0xFFFB;
|
||||
c=a+b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0x0005;
|
||||
b=0xFFF6;
|
||||
c=a+b;
|
||||
/* Before c must be -5 */ c=0;
|
||||
|
||||
a=0x0F0F;
|
||||
b=0xF0F0;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xAAAA;
|
||||
b=0x5555;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
d=0;
|
||||
d+=1;
|
||||
d+=2;
|
||||
d+=3;
|
||||
d+=4;
|
||||
d+=5;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
|
||||
ua=0x00FF;
|
||||
ub=0xFF00;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65535 */ uc=0;
|
||||
|
||||
ua=0xFFEC;
|
||||
ub=0xFFE2;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65486 */ uc=0;
|
||||
|
||||
ua=0xFFFE;
|
||||
ub=0x0002;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
ua=0x000A;
|
||||
ub=0xFFFB;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 5 */ uc=0;
|
||||
|
||||
ua=0x0005;
|
||||
ub=0xFFF6;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65531 */ uc=0;
|
||||
|
||||
ua=0x0F0F;
|
||||
ub=0xF0F0;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65535 */ uc=0;
|
||||
|
||||
ua=0xAAAA;
|
||||
ub=0x5555;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 65535 */ uc=0;
|
||||
|
||||
ud=0;
|
||||
ud+=1;
|
||||
ud+=2;
|
||||
ud+=3;
|
||||
ud+=4;
|
||||
ud+=5;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
d=15;
|
||||
d+=0xFFFF;
|
||||
d+=0xFFFE;
|
||||
d+=0xFFFD;
|
||||
d+=0xFFFC;
|
||||
d+=0xFFFB;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
ud=15;
|
||||
ud+=0xFFFF;
|
||||
ud+=0xFFFE;
|
||||
ud+=0xFFFD;
|
||||
ud+=0xFFFC;
|
||||
ud+=0xFFFB;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,154 +0,0 @@
|
|||
/**
|
||||
* @file 033.add.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned int adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b,c;
|
||||
signed int d;
|
||||
unsigned int ua,ub,uc;
|
||||
unsigned int ud;
|
||||
|
||||
a=0x0000FFFF;
|
||||
b=0xFFFF0000;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFFEC;
|
||||
b=0xFFFFFFE2;
|
||||
c=a+b;
|
||||
/* Before c must be -50 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0x00000002;
|
||||
c=a+b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000A;
|
||||
b=0xFFFFFFFB;
|
||||
c=a+b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0x00000005;
|
||||
b=0xFFFFFFF6;
|
||||
c=a+b;
|
||||
/* Before c must be -5 */ c=0;
|
||||
|
||||
a=0x0F0F0F0F;
|
||||
b=0xF0F0F0F0;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xAAAAAAAA;
|
||||
b=0x55555555;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
d=0;
|
||||
d+=1;
|
||||
d+=2;
|
||||
d+=3;
|
||||
d+=4;
|
||||
d+=5;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
|
||||
ua=0x0000FFFF;
|
||||
ub=0xFFFF0000;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967295 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFEC;
|
||||
ub=0xFFFFFFE2;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967246 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFE;
|
||||
ub=0x00000002;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
ua=0x0000000A;
|
||||
ub=0xFFFFFFFB;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 5 */ uc=0;
|
||||
|
||||
ua=0x00000005;
|
||||
ub=0xFFFFFFF6;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967291 */ uc=0;
|
||||
|
||||
ua=0x0F0F0F0F;
|
||||
ub=0xF0F0F0F0;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967295 */ uc=0;
|
||||
|
||||
ua=0xAAAAAAAA;
|
||||
ub=0x55555555;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 4294967295 */ uc=0;
|
||||
|
||||
ud=0;
|
||||
ud+=1;
|
||||
ud+=2;
|
||||
ud+=3;
|
||||
ud+=4;
|
||||
ud+=5;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
d=15;
|
||||
d+=0xFFFFFFFF;
|
||||
d+=0xFFFFFFFE;
|
||||
d+=0xFFFFFFFD;
|
||||
d+=0xFFFFFFFC;
|
||||
d+=0xFFFFFFFB;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
ud=15;
|
||||
ud+=0xFFFFFFFF;
|
||||
ud+=0xFFFFFFFE;
|
||||
ud+=0xFFFFFFFD;
|
||||
ud+=0xFFFFFFFC;
|
||||
ud+=0xFFFFFFFB;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,154 +0,0 @@
|
|||
/**
|
||||
* @file 034.add.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned long long int adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a,b,c;
|
||||
signed long long int d;
|
||||
unsigned long long int ua,ub,uc;
|
||||
unsigned long long int ud;
|
||||
|
||||
a=0x00000000FFFFFFFFLL;
|
||||
b=0xFFFFFFFF00000000LL;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFECLL;
|
||||
b=0xFFFFFFFFFFFFFFE2LL;
|
||||
c=a+b;
|
||||
/* Before c must be -50 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFELL;
|
||||
b=0x0000000000000002LL;
|
||||
c=a+b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x000000000000000ALL;
|
||||
b=0xFFFFFFFFFFFFFFFBLL;
|
||||
c=a+b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0x0000000000000005LL;
|
||||
b=0xFFFFFFFFFFFFFFF6LL;
|
||||
c=a+b;
|
||||
/* Before c must be -5 */ c=0;
|
||||
|
||||
a=0xF0F0F0F0F0F0F0F0LL;
|
||||
b=0x0F0F0F0F0F0F0F0FLL;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAALL;
|
||||
b=0x5555555555555555LL;
|
||||
c=a+b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
d=0;
|
||||
d+=1;
|
||||
d+=2;
|
||||
d+=3;
|
||||
d+=4;
|
||||
d+=5;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
|
||||
ua=0x00000000FFFFFFFFULL;
|
||||
ub=0xFFFFFFFF00000000ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551615 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFFFFFFFFECULL;
|
||||
ub=0xFFFFFFFFFFFFFFE2ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551566 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFFFFFFFFFEULL;
|
||||
ub=0x0000000000000002ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
ua=0x000000000000000AULL;
|
||||
ub=0xFFFFFFFFFFFFFFFBULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 5 */ uc=0;
|
||||
|
||||
ua=0x0000000000000005ULL;
|
||||
ub=0xFFFFFFFFFFFFFFF6ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551611 */ uc=0;
|
||||
|
||||
ua=0x0F0F0F0F0F0F0F0FULL;
|
||||
ub=0xF0F0F0F0F0F0F0F0ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551615 */ uc=0;
|
||||
|
||||
ua=0xAAAAAAAAAAAAAAAAULL;
|
||||
ub=0x5555555555555555ULL;
|
||||
uc=ua+ub;
|
||||
/* Before uc must be 18446744073709551615 */ uc=0;
|
||||
|
||||
ud=0;
|
||||
ud+=1;
|
||||
ud+=2;
|
||||
ud+=3;
|
||||
ud+=4;
|
||||
ud+=5;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
d=15;
|
||||
d+=0xFFFFFFFFFFFFFFFFULL;
|
||||
d+=0xFFFFFFFFFFFFFFFEULL;
|
||||
d+=0xFFFFFFFFFFFFFFFDULL;
|
||||
d+=0xFFFFFFFFFFFFFFFCULL;
|
||||
d+=0xFFFFFFFFFFFFFFFBULL;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
ud=15;
|
||||
ud+=0xFFFFFFFFFFFFFFFFULL;
|
||||
ud+=0xFFFFFFFFFFFFFFFEULL;
|
||||
ud+=0xFFFFFFFFFFFFFFFDULL;
|
||||
ud+=0xFFFFFFFFFFFFFFFCULL;
|
||||
ud+=0xFFFFFFFFFFFFFFFBULL;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,154 +0,0 @@
|
|||
/**
|
||||
* @file 041.sub.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned char subs.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b,c;
|
||||
signed char d;
|
||||
unsigned char ua,ub,uc;
|
||||
unsigned char ud;
|
||||
|
||||
a=0x0A;
|
||||
b=0x14;
|
||||
c=a-b;
|
||||
/* Before c must be -10 */ c=0;
|
||||
|
||||
a=0xEC;
|
||||
b=0xE2;
|
||||
c=a-b;
|
||||
/* Before c must be 10 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0x02;
|
||||
c=a-b;
|
||||
/* Before c must be -4 */ c=0;
|
||||
|
||||
a=0x0A;
|
||||
b=0xFB;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x05;
|
||||
b=0xF6;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0xF0;
|
||||
c=a-b;
|
||||
/* Before c must be 31 */ c=0;
|
||||
|
||||
a=0xAA;
|
||||
b=0x55;
|
||||
c=a-b;
|
||||
/* Before c must be 85 */ c=0;
|
||||
|
||||
d=15;
|
||||
d-=1;
|
||||
d-=2;
|
||||
d-=3;
|
||||
d-=4;
|
||||
d-=5;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
|
||||
ua=0x0A;
|
||||
ub=0x14;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 246 */ uc=0;
|
||||
|
||||
ua=0xEC;
|
||||
ub=0xE2;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 10 */ uc=0;
|
||||
|
||||
ua=0xFE;
|
||||
ub=0x02;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 252 */ uc=0;
|
||||
|
||||
ua=0x0A;
|
||||
ub=0xFB;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x05;
|
||||
ub=0xF6;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0F;
|
||||
ub=0xF0;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 31 */ uc=0;
|
||||
|
||||
ua=0xAA;
|
||||
ub=0x55;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 85 */ uc=0;
|
||||
|
||||
ud=15;
|
||||
ud-=1;
|
||||
ud-=2;
|
||||
ud-=3;
|
||||
ud-=4;
|
||||
ud-=5;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
d=0;
|
||||
d-=0xFF;
|
||||
d-=0xFE;
|
||||
d-=0xFD;
|
||||
d-=0xFC;
|
||||
d-=0xFB;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
ud=0;
|
||||
ud-=0xFF;
|
||||
ud-=0xFE;
|
||||
ud-=0xFD;
|
||||
ud-=0xFC;
|
||||
ud-=0xFB;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,154 +0,0 @@
|
|||
/**
|
||||
* @file 042.sub.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned short int subs.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b,c;
|
||||
signed short int d;
|
||||
unsigned short int ua,ub,uc;
|
||||
unsigned short int ud;
|
||||
|
||||
a=0x00FF;
|
||||
b=0xFF00;
|
||||
c=a-b;
|
||||
/* Before c must be 511 */ c=0;
|
||||
|
||||
a=0xFFEC;
|
||||
b=0xFFE2;
|
||||
c=a-b;
|
||||
/* Before c must be 10 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0x0002;
|
||||
c=a-b;
|
||||
/* Before c must be -4 */ c=0;
|
||||
|
||||
a=0x000A;
|
||||
b=0xFFFB;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0005;
|
||||
b=0xFFF6;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0F0F;
|
||||
b=0xF0F0;
|
||||
c=a-b;
|
||||
/* Before c must be 7711 */ c=0;
|
||||
|
||||
a=0xAAAA;
|
||||
b=0x5555;
|
||||
c=a-b;
|
||||
/* Before c must be 21845 */ c=0;
|
||||
|
||||
d=15;
|
||||
d-=1;
|
||||
d-=2;
|
||||
d-=3;
|
||||
d-=4;
|
||||
d-=5;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
|
||||
ua=0x00FF;
|
||||
ub=0xFF00;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 511 */ uc=0;
|
||||
|
||||
ua=0xFFEC;
|
||||
ub=0xFFE2;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 10 */ uc=0;
|
||||
|
||||
ua=0xFFFE;
|
||||
ub=0x0002;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 65532 */ uc=0;
|
||||
|
||||
ua=0x000A;
|
||||
ub=0xFFFB;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0005;
|
||||
ub=0xFFF6;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0F0F;
|
||||
ub=0xF0F0;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 7711 */ uc=0;
|
||||
|
||||
ua=0xAAAA;
|
||||
ub=0x5555;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 21845 */ uc=0;
|
||||
|
||||
ud=15;
|
||||
ud-=1;
|
||||
ud-=2;
|
||||
ud-=3;
|
||||
ud-=4;
|
||||
ud-=5;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
d=0;
|
||||
d-=0xFFFF;
|
||||
d-=0xFFFE;
|
||||
d-=0xFFFD;
|
||||
d-=0xFFFC;
|
||||
d-=0xFFFB;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
ud=0;
|
||||
ud-=0xFFFF;
|
||||
ud-=0xFFFE;
|
||||
ud-=0xFFFD;
|
||||
ud-=0xFFFC;
|
||||
ud-=0xFFFB;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,154 +0,0 @@
|
|||
/**
|
||||
* @file 043.sub.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned int subs.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b,c;
|
||||
signed int d;
|
||||
unsigned int ua,ub,uc;
|
||||
unsigned int ud;
|
||||
|
||||
a=0x0000FFFF;
|
||||
b=0xFFFF0000;
|
||||
c=a-b;
|
||||
/* Before c must be 131071 */ c=0;
|
||||
|
||||
a=0xFFFFFFEC;
|
||||
b=0xFFFFFFE2;
|
||||
c=a-b;
|
||||
/* Before c must be 10 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0x00000002;
|
||||
c=a-b;
|
||||
/* Before c must be -4 */ c=0;
|
||||
|
||||
a=0x0000000A;
|
||||
b=0xFFFFFFFB;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x00000005;
|
||||
b=0xFFFFFFF6;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0F0F0F0F;
|
||||
b=0xF0F0F0F0;
|
||||
c=a-b;
|
||||
/* Before c must be 505290271 */ c=0;
|
||||
|
||||
a=0xAAAAAAAA;
|
||||
b=0x55555555;
|
||||
c=a-b;
|
||||
/* Before c must be 1431655765 */ c=0;
|
||||
|
||||
d=15;
|
||||
d-=1;
|
||||
d-=2;
|
||||
d-=3;
|
||||
d-=4;
|
||||
d-=5;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
|
||||
ua=0x0000FFFF;
|
||||
ub=0xFFFF0000;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 131071 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFEC;
|
||||
ub=0xFFFFFFE2;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 10 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFE;
|
||||
ub=0x00000002;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 4294967292 */ uc=0;
|
||||
|
||||
ua=0x0000000A;
|
||||
ub=0xFFFFFFFB;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x00000005;
|
||||
ub=0xFFFFFFF6;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0F0F0F0F;
|
||||
ub=0xF0F0F0F0;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 505290271 */ uc=0;
|
||||
|
||||
ua=0xAAAAAAAA;
|
||||
ub=0x55555555;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 1431655765 */ uc=0;
|
||||
|
||||
ud=15;
|
||||
ud-=1;
|
||||
ud-=2;
|
||||
ud-=3;
|
||||
ud-=4;
|
||||
ud-=5;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
d=0;
|
||||
d-=0xFFFFFFFF;
|
||||
d-=0xFFFFFFFE;
|
||||
d-=0xFFFFFFFD;
|
||||
d-=0xFFFFFFFC;
|
||||
d-=0xFFFFFFFB;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
ud=0;
|
||||
ud-=0xFFFFFFFF;
|
||||
ud-=0xFFFFFFFE;
|
||||
ud-=0xFFFFFFFD;
|
||||
ud-=0xFFFFFFFC;
|
||||
ud-=0xFFFFFFFB;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,154 +0,0 @@
|
|||
/**
|
||||
* @file 044.sub.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned long long int adds.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a,b,c;
|
||||
signed long long int d;
|
||||
unsigned long long int ua,ub,uc;
|
||||
unsigned long long int ud;
|
||||
|
||||
a=0x00000000FFFFFFFFLL;
|
||||
b=0xFFFFFFFF00000000LL;
|
||||
c=a-b;
|
||||
/* Before c must be 8589934591 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFECLL;
|
||||
b=0xFFFFFFFFFFFFFFE2LL;
|
||||
c=a-b;
|
||||
/* Before c must be 10 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFELL;
|
||||
b=0x0000000000000002LL;
|
||||
c=a-b;
|
||||
/* Before c must be -4 */ c=0;
|
||||
|
||||
a=0x000000000000000ALL;
|
||||
b=0xFFFFFFFFFFFFFFFBLL;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x0000000000000005LL;
|
||||
b=0xFFFFFFFFFFFFFFF6LL;
|
||||
c=a-b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0xF0F0F0F0F0F0F0F0LL;
|
||||
b=0x0F0F0F0F0F0F0F0FLL;
|
||||
c=a-b;
|
||||
/* Before c must be -2170205185142300191 */ c=0;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAALL;
|
||||
b=0x5555555555555555LL;
|
||||
c=a-b;
|
||||
/* Before c must be 6148914691236517205 */ c=0;
|
||||
|
||||
d=15;
|
||||
d-=1;
|
||||
d-=2;
|
||||
d-=3;
|
||||
d-=4;
|
||||
d-=5;
|
||||
/* Before d must be 0 */ d=0;
|
||||
|
||||
|
||||
ua=0x00000000FFFFFFFFULL;
|
||||
ub=0xFFFFFFFF00000000ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 8589934591 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFFFFFFFFECULL;
|
||||
ub=0xFFFFFFFFFFFFFFE2ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 10 */ uc=0;
|
||||
|
||||
ua=0xFFFFFFFFFFFFFFFEULL;
|
||||
ub=0x0000000000000002ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 18446744073709551612 */ uc=0;
|
||||
|
||||
ua=0x000000000000000AULL;
|
||||
ub=0xFFFFFFFFFFFFFFFBULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0000000000000005ULL;
|
||||
ub=0xFFFFFFFFFFFFFFF6ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
ua=0x0F0F0F0F0F0F0F0FULL;
|
||||
ub=0xF0F0F0F0F0F0F0F0ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 2170205185142300191 */ uc=0;
|
||||
|
||||
ua=0xAAAAAAAAAAAAAAAAULL;
|
||||
ub=0x5555555555555555ULL;
|
||||
uc=ua-ub;
|
||||
/* Before uc must be 6148914691236517205 */ uc=0;
|
||||
|
||||
ud=15;
|
||||
ud-=1;
|
||||
ud-=2;
|
||||
ud-=3;
|
||||
ud-=4;
|
||||
ud-=5;
|
||||
/* Before ud must be 0 */ ud=0;
|
||||
|
||||
d=0;
|
||||
d-=0xFFFFFFFFFFFFFFFFULL;
|
||||
d-=0xFFFFFFFFFFFFFFFEULL;
|
||||
d-=0xFFFFFFFFFFFFFFFDULL;
|
||||
d-=0xFFFFFFFFFFFFFFFCULL;
|
||||
d-=0xFFFFFFFFFFFFFFFBULL;
|
||||
/* Before d must be 15 */ d=0;
|
||||
|
||||
ud=0;
|
||||
ud-=0xFFFFFFFFFFFFFFFFULL;
|
||||
ud-=0xFFFFFFFFFFFFFFFEULL;
|
||||
ud-=0xFFFFFFFFFFFFFFFDULL;
|
||||
ud-=0xFFFFFFFFFFFFFFFCULL;
|
||||
ud-=0xFFFFFFFFFFFFFFFBULL;
|
||||
/* Before ud must be 15 */ ud=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,84 +0,0 @@
|
|||
/**
|
||||
* @file 051.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed char multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b;
|
||||
signed short int c;
|
||||
|
||||
a=0x02;
|
||||
b=0x04;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x01;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x0A;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be -10 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0xFC;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0x0A;
|
||||
b=0x0B;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xF6;
|
||||
b=0x0B;
|
||||
c=(signed short int)(a)*(signed short int)(b);
|
||||
/* Before c must be -110 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,84 +0,0 @@
|
|||
/**
|
||||
* @file 052.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned char multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char a,b;
|
||||
unsigned short int c;
|
||||
|
||||
a=0x02;
|
||||
b=0x04;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 65025 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x01;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 255 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x0A;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 2550 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0xFC;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 64008 */ c=0;
|
||||
|
||||
a=0x0A;
|
||||
b=0x0B;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xF6;
|
||||
b=0x0B;
|
||||
c=(unsigned short int)(a)*(unsigned short int)(b);
|
||||
/* Before c must be 2706 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,99 +0,0 @@
|
|||
/**
|
||||
* @file 053.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed short int multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b;
|
||||
signed int c;
|
||||
|
||||
a=0x0002;
|
||||
b=0x0004;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0001;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x000A;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be -10 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0xFFFC;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0x000A;
|
||||
b=0x000B;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xFFF6;
|
||||
b=0x000B;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be -110 */ c=0;
|
||||
|
||||
a=0xF000;
|
||||
b=0xF001;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 16773120 */ c=0;
|
||||
|
||||
a=0x5555;
|
||||
b=0x3333;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be 286322415 */ c=0;
|
||||
|
||||
a=0x5353;
|
||||
b=0x8000;
|
||||
c=(signed int)(a)*(signed int)(b);
|
||||
/* Before c must be -698974208 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,99 +0,0 @@
|
|||
/**
|
||||
* @file 054.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned short int multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int a,b;
|
||||
unsigned int c;
|
||||
|
||||
a=0x0002;
|
||||
b=0x0004;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 4294836225 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0001;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 65535 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x000A;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 655350 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0xFFFC;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 4294574088 */ c=0;
|
||||
|
||||
a=0x000A;
|
||||
b=0x000B;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xFFF6;
|
||||
b=0x000B;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 720786 */ c=0;
|
||||
|
||||
a=0xF000;
|
||||
b=0xF001;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 3774935040 */ c=0;
|
||||
|
||||
a=0x5555;
|
||||
b=0x3333;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 286322415 */ c=0;
|
||||
|
||||
a=0x5353;
|
||||
b=0x8000;
|
||||
c=(unsigned int)(a)*(unsigned int)(b);
|
||||
/* Before c must be 698974208 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,115 +0,0 @@
|
|||
/**
|
||||
* @file 055.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed int multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b;
|
||||
signed long long int c;
|
||||
|
||||
a=0x00000002;
|
||||
b=0x00000004;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000001;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x0000000A;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be -10 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0xFFFFFFFC;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0x0000000A;
|
||||
b=0x0000000B;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xFFFFFFF6;
|
||||
b=0x0000000B;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be -110 */ c=0;
|
||||
|
||||
a=0x0000F000;
|
||||
b=0x0000F001;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 3774935040 */ c=0;
|
||||
|
||||
a=0x55555555;
|
||||
b=0x33333333;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 1229782937674641135 */ c=0;
|
||||
|
||||
a=0x00005353;
|
||||
b=0x00008000;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 698974208 */ c=0;
|
||||
|
||||
a=0xFFFFF000;
|
||||
b=0xFFFFF001;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 16773120 */ c=0;
|
||||
|
||||
a=0x00005555;
|
||||
b=0x33330000;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be 18764425789440 */ c=0;
|
||||
|
||||
a=0x53535353;
|
||||
b=0x80008000;
|
||||
c=(signed long long int)(a)*(signed long long int)(b);
|
||||
/* Before c must be -3002071363408527360 */ c=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,115 +0,0 @@
|
|||
/**
|
||||
* @file 056.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned int multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int a,b;
|
||||
unsigned long long int c;
|
||||
|
||||
a=0x00000002;
|
||||
b=0x00000004;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 8 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 18446744065119617025 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000001;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x0000000A;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 42949672950 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0xFFFFFFFC;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 18446744047939747848 */ c=0;
|
||||
|
||||
a=0x0000000A;
|
||||
b=0x0000000B;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 110 */ c=0;
|
||||
|
||||
a=0xFFFFFFF6;
|
||||
b=0x0000000B;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 47244640146 */ c=0;
|
||||
|
||||
a=0x0000F000;
|
||||
b=0x0000F001;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 3774935040 */ c=0;
|
||||
|
||||
a=0x55555555;
|
||||
b=0x33333333;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 1229782937674641135 */ c=0;
|
||||
|
||||
a=0x00005353;
|
||||
b=0x00008000;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 698974208 */ c=0;
|
||||
|
||||
a=0xFFFFF000;
|
||||
b=0xFFFFF001;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 18446708893649203200 */ c=0;
|
||||
|
||||
a=0x00005555;
|
||||
b=0x33330000;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 18764425789440 */ c=0;
|
||||
|
||||
a=0x53535353;
|
||||
b=0x80008000;
|
||||
c=(unsigned long long int)(a)*(unsigned long long int)(b);
|
||||
/* Before c must be 3002162980753866752 */ c=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,106 +0,0 @@
|
|||
/**
|
||||
* @file 057.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function uses various signed multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
signed char c1,c2,c3,c4,c5,cresult;
|
||||
signed short int si1,si2,si3,si4,si5,siresult;
|
||||
signed int i1,i2,i3,i4,i5,iresult;
|
||||
signed long long int li1,li2,li3,li4,li5,liresult;
|
||||
|
||||
c1=1;
|
||||
c2=2;
|
||||
c3=3;
|
||||
c4=4;
|
||||
c5=5;
|
||||
cresult=c1*c2*c3*c4*c5;
|
||||
/* Before cresult must be 120 */ cresult=0;
|
||||
|
||||
si1=1;
|
||||
si2=2;
|
||||
si3=3;
|
||||
si4=4;
|
||||
si5=5;
|
||||
siresult=si1*si2*si3*si4*si5;
|
||||
/* Before siresult must be 120 */ siresult=0;
|
||||
|
||||
i1=1;
|
||||
i2=2;
|
||||
i3=3;
|
||||
i4=4;
|
||||
i5=5;
|
||||
iresult=i1*i2*i3*i4*i5;
|
||||
/* Before iresult must be 120 */ iresult=0;
|
||||
|
||||
li1=1;
|
||||
li2=2;
|
||||
li3=3;
|
||||
li4=4;
|
||||
li5=5;
|
||||
liresult=li1*li2*li3*li4*li5;
|
||||
/* Before liresult must be 120 */ liresult=0;
|
||||
|
||||
c1=5;
|
||||
siresult=c1*7;
|
||||
/* Before siresult must be 35 */ siresult=0;
|
||||
|
||||
si1=5;
|
||||
iresult=si1*7;
|
||||
/* Before iresult must be 35 */ iresult=0;
|
||||
|
||||
i1=5;
|
||||
liresult=i1*7;
|
||||
/* Before liresult must be 35 */ liresult=0;
|
||||
|
||||
c1=17;
|
||||
siresult=c1*(-1);
|
||||
/* Before siresult must be -17 */ siresult=0;
|
||||
|
||||
si1=17;
|
||||
iresult=si1*(-1);
|
||||
/* Before iresult must be -17 */ iresult=0;
|
||||
|
||||
i1=17;
|
||||
liresult=i1*(-1);
|
||||
/* Before siresult must be -17 */ liresult=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,106 +0,0 @@
|
|||
/**
|
||||
* @file 058.mul.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function uses various unsigned multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
unsigned char uc1,uc2,uc3,uc4,uc5,ucresult;
|
||||
unsigned short int usi1,usi2,usi3,usi4,usi5,usiresult;
|
||||
unsigned int ui1,ui2,ui3,ui4,ui5,uiresult;
|
||||
unsigned long long int uli1,uli2,uli3,uli4,uli5,uliresult;
|
||||
|
||||
uc1=1;
|
||||
uc2=2;
|
||||
uc3=3;
|
||||
uc4=4;
|
||||
uc5=5;
|
||||
ucresult=uc1*uc2*uc3*uc4*uc5;
|
||||
/* Before ucresult must be 120 */ ucresult=0;
|
||||
|
||||
usi1=1;
|
||||
usi2=2;
|
||||
usi3=3;
|
||||
usi4=4;
|
||||
usi5=5;
|
||||
usiresult=usi1*usi2*usi3*usi4*usi5;
|
||||
/* Before usiresult must be 120 */ usiresult=0;
|
||||
|
||||
ui1=1;
|
||||
ui2=2;
|
||||
ui3=3;
|
||||
ui4=4;
|
||||
ui5=5;
|
||||
uiresult=ui1*ui2*ui3*ui4*ui5;
|
||||
/* Before uiresult must be 120 */ uiresult=0;
|
||||
|
||||
uli1=1;
|
||||
uli2=2;
|
||||
uli3=3;
|
||||
uli4=4;
|
||||
uli5=5;
|
||||
uliresult=uli1*uli2*uli3*uli4*uli5;
|
||||
/* Before uliresult must be 120 */ uliresult=0;
|
||||
|
||||
uc1=5;
|
||||
usiresult=uc1*7;
|
||||
/* Before usiresult must be 35 */ usiresult=0;
|
||||
|
||||
usi1=5;
|
||||
uiresult=usi1*7;
|
||||
/* Before uiresult must be 35 */ uiresult=0;
|
||||
|
||||
ui1=5;
|
||||
uliresult=ui1*7;
|
||||
/* Before uliresult must be 35 */ uliresult=0;
|
||||
|
||||
uc1=17;
|
||||
usiresult=uc1*5;
|
||||
/* Before usiresult must be 85 */ usiresult=0;
|
||||
|
||||
usi1=17;
|
||||
uiresult=usi1*5;
|
||||
/* Before uiresult must be 85 */ uiresult=0;
|
||||
|
||||
ui1=17;
|
||||
uliresult=ui1*5;
|
||||
/* Before siresult must be 85 */ uliresult=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* @file 061.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed char division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b,c;
|
||||
|
||||
a=0xFF;
|
||||
b=0x01;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0x03;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAA;
|
||||
b=0x55;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x7F;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be -127 */ c=0;
|
||||
|
||||
a=0x00;
|
||||
b=0x80;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x30;
|
||||
b=0x05;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0x10;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x20;
|
||||
b=0xFE;
|
||||
c=a/b;
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
a=0x00;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10;
|
||||
c=a/(-1);
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* @file 062.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned char division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char a,b,c;
|
||||
|
||||
a=0xFF;
|
||||
b=0x01;
|
||||
c=a/b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0x03;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAA;
|
||||
b=0x55;
|
||||
c=a/b;
|
||||
/* Before c must be 2 */ c=0;
|
||||
|
||||
a=0x7F;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00;
|
||||
b=0x80;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x30;
|
||||
b=0x05;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFE;
|
||||
b=0x10;
|
||||
c=a/b;
|
||||
/* Before c must be 15 */ c=0;
|
||||
|
||||
a=0x20;
|
||||
b=0xFE;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00;
|
||||
b=0xFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10;
|
||||
c=a/0xFF;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* @file 063.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed short int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b,c;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0001;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x000F;
|
||||
b=0x0003;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAA;
|
||||
b=0x5555;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x7FFF;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be -32767 */ c=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0x8000;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0030;
|
||||
b=0x0005;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0x0010;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0020;
|
||||
b=0xFFFE;
|
||||
c=a/b;
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0078;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x1000;
|
||||
c=a/(-1);
|
||||
/* Before c must be -4096 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* @file 064.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned short int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int a,b,c;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0001;
|
||||
c=a/b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
|
||||
a=0x000F;
|
||||
b=0x0003;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAA;
|
||||
b=0x5555;
|
||||
c=a/b;
|
||||
/* Before c must be 2 */ c=0;
|
||||
|
||||
a=0x7FFF;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0x8000;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0030;
|
||||
b=0x0005;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFE;
|
||||
b=0x0010;
|
||||
c=a/b;
|
||||
/* Before c must be 4095 */ c=0;
|
||||
|
||||
a=0x0020;
|
||||
b=0xFFFE;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0xFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10;
|
||||
c=a/0xFFFF;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* @file 065.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b,c;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000001;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x0000000F;
|
||||
b=0x00000003;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAAAAAA;
|
||||
b=0x55555555;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x7FFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be -2147483647 */ c=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0x80000000;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000030;
|
||||
b=0x00000005;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0x00000010;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000020;
|
||||
b=0xFFFFFFFE;
|
||||
c=a/b;
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000078;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10000000;
|
||||
c=a/(-1);
|
||||
/* Before c must be -268435456 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* @file 066.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int a,b,c;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000001;
|
||||
c=a/b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
|
||||
a=0x0000000F;
|
||||
b=0x00000003;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAAAAAA;
|
||||
b=0x55555555;
|
||||
c=a/b;
|
||||
/* Before c must be 2 */ c=0;
|
||||
|
||||
a=0x7FFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0x80000000;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000030;
|
||||
b=0x00000005;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFE;
|
||||
b=0x00000010;
|
||||
c=a/b;
|
||||
/* Before c must be 268435455 */ c=0;
|
||||
|
||||
a=0x00000020;
|
||||
b=0xFFFFFFFE;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0xFFFFFFFF;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x10000000;
|
||||
c=a/0xFFFFFFFF;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* @file 067.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed long long int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a,b,c;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFLL;
|
||||
b=0x0000000000000001LL;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x000000000000000FLL;
|
||||
b=0x0000000000000003LL;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAALL;
|
||||
b=0x5555555555555555LL;
|
||||
c=a/b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0x7FFFFFFFFFFFFFFFLL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
c=a/b;
|
||||
/* Before c must be -9223372036854775807 */ c=0;
|
||||
|
||||
a=0x0000000000000000LL;
|
||||
b=0x8000000000000000LL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000030LL;
|
||||
b=0x0000000000000005LL;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFLL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFELL;
|
||||
b=0x0000000000000010LL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000020LL;
|
||||
b=0xFFFFFFFFFFFFFFFELL;
|
||||
c=a/b;
|
||||
/* Before c must be -16 */ c=0;
|
||||
|
||||
a=0x0000000000000000LL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000078LL;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x1000000000000000LL;
|
||||
c=a/(-1);
|
||||
/* Before c must be -1152921504606846976 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* @file 068.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned long long int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int a,b,c;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0x0000000000000001ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
|
||||
a=0x000000000000000FULL;
|
||||
b=0x0000000000000003ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 5 */ c=0;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAAULL;
|
||||
b=0x5555555555555555ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 2 */ c=0;
|
||||
|
||||
a=0x7FFFFFFFFFFFFFFFULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000000ULL;
|
||||
b=0x8000000000000000ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000030ULL;
|
||||
b=0x0000000000000005ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 9 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
c=a/b;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFEULL;
|
||||
b=0x0000000000000010ULL;
|
||||
c=a/b;
|
||||
/* Before c must be 1152921504606846975 */ c=0;
|
||||
|
||||
a=0x0000000000000020ULL;
|
||||
b=0xFFFFFFFFFFFFFFFEULL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x0000000000000000ULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
c=a/b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a/5;
|
||||
c=c/4;
|
||||
c=c/3;
|
||||
c=c/2;
|
||||
/* Before c must be 1 */ c=0;
|
||||
|
||||
a=0x1000000000000000ULL;
|
||||
c=a/0xFFFFFFFFFFFFFFFFULL;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* @file 068.div.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned long long int division.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long int a,b,c;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x00001ULL;
|
||||
c=a%-2;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x00003ULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x55555ULL;
|
||||
c=a%b;
|
||||
/* Before c must be -1 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0xFFFFFULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x01000ULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x00005ULL;
|
||||
c=a%b;
|
||||
/* Before c must be 3 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0xFFAFFULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0x00010ULL;
|
||||
c=a%b;
|
||||
/* Before c must be -2 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0xFFBBEULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
b=0xFCCCFULL;
|
||||
c=a%b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0x78;
|
||||
c=a%56;
|
||||
/* Before c must be 8 */ c=c%9;
|
||||
/* Before c must be 8 */ c=c%5;
|
||||
/* Before c must be 3 */ c=c%1;
|
||||
/* Before c must be 0 */ c=0;
|
||||
|
||||
a=0xFFFFFULL;
|
||||
c=a%0xFFFFFULL;
|
||||
/* Before c must be 1152921504606846976 */ c=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,143 +0,0 @@
|
|||
/**
|
||||
* @file 071.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses char boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char a,b,c,d,e,f,g,h,i,j;
|
||||
|
||||
a=0xFF;
|
||||
b=0xFF;
|
||||
c=a|b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 255 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 0 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 255 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 0 */ j=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0xF0;
|
||||
c=a|b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 255 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 255 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 240 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 15 */ j=0;
|
||||
|
||||
a=0xFF;
|
||||
b=0x00;
|
||||
c=a|b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 255 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 255 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 255 */ j=0;
|
||||
|
||||
a=0x55;
|
||||
b=0xAA;
|
||||
c=a|b;
|
||||
/* Before c must be 255 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 255 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 255 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 170 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 85 */ j=0;
|
||||
|
||||
a=0x00;
|
||||
b=0x00;
|
||||
c=a|b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 255 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 255 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 255 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 255 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 255 */ j=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,143 +0,0 @@
|
|||
/**
|
||||
* @file 072.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses short int boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int a,b,c,d,e,f,g,h,i,j;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFF;
|
||||
c=a|b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 65535 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 0 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 65535 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 0 */ j=0;
|
||||
|
||||
a=0x0F0F;
|
||||
b=0xF0F0;
|
||||
c=a|b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 65535 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 65535 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 61680 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 3855 */ j=0;
|
||||
|
||||
a=0xFFFF;
|
||||
b=0x0000;
|
||||
c=a|b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 65535 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 65535 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 65535 */ j=0;
|
||||
|
||||
a=0x5555;
|
||||
b=0xAAAA;
|
||||
c=a|b;
|
||||
/* Before c must be 65535 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 65535 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 65535 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 43690 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 21845 */ j=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0x0000;
|
||||
c=a|b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 65535 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 65535 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 65535 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 65535 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 65535 */ j=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,143 +0,0 @@
|
|||
/**
|
||||
* @file 073.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses int boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int a,b,c,d,e,f,g,h,i,j;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFF;
|
||||
c=a|b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 4294967295 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 0 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 4294967295 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 0 */ j=0;
|
||||
|
||||
a=0x0F0F0F0F;
|
||||
b=0xF0F0F0F0;
|
||||
c=a|b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 4294967295 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 4294967295 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 4042322160 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 252645135 */ j=0;
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0x00000000;
|
||||
c=a|b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 4294967295 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 4294967295 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 4294967295 */ j=0;
|
||||
|
||||
a=0x55555555;
|
||||
b=0xAAAAAAAA;
|
||||
c=a|b;
|
||||
/* Before c must be 4294967295 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 4294967295 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 4294967295 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 2863311530 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 1431655765 */ j=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0x00000000;
|
||||
c=a|b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 4294967295 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 4294967295 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 4294967295 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 4294967295 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 4294967295 */ j=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,143 +0,0 @@
|
|||
/**
|
||||
* @file 074.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses long long int boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int a,b,c,d,e,f,g,h,i,j;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
c=a|b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 18446744073709551615 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 0 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 18446744073709551615 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 0 */ j=0;
|
||||
|
||||
a=0x0F0F0F0F0F0F0F0FULL;
|
||||
b=0xF0F0F0F0F0F0F0F0ULL;
|
||||
c=a|b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 18446744073709551615 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 18446744073709551615 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 17361641481138401520 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 1085102592571150095 */ j=0;
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0x0000000000000000ULL;
|
||||
c=a|b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 18446744073709551615 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 18446744073709551615 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 0 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 18446744073709551615 */ j=0;
|
||||
|
||||
a=0x5555555555555555ULL;
|
||||
b=0xAAAAAAAAAAAAAAAAULL;
|
||||
c=a|b;
|
||||
/* Before c must be 18446744073709551615 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 18446744073709551615 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 0 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 18446744073709551615 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 0 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 12297829382473034410 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 6148914691236517205 */ j=0;
|
||||
|
||||
a=0x0000000000000000ULL;
|
||||
b=0x0000000000000000ULL;
|
||||
c=a|b;
|
||||
/* Before c must be 0 */ c=0;
|
||||
d=a&b;
|
||||
/* Before d must be 0 */ d=0;
|
||||
e=a^b;
|
||||
/* Before e must be 0 */ e=0;
|
||||
f=~(a|b);
|
||||
/* Before f must be 18446744073709551615 */ f=0;
|
||||
g=~(a&b);
|
||||
/* Before g must be 18446744073709551615 */ g=0;
|
||||
h=~(a^b);
|
||||
/* Before h must be 18446744073709551615 */ h=0;
|
||||
i=~a;
|
||||
/* Before i must be 18446744073709551615 */ i=0;
|
||||
j=~b;
|
||||
/* Before j must be 18446744073709551615 */ j=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,64 +0,0 @@
|
|||
/**
|
||||
* @file 075.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int a,b;
|
||||
|
||||
a=0xAAAAAAAAAAAAAAAAULL;
|
||||
b=a|0xF0F0F0F0F0F0F0F0ULL;
|
||||
/* Before b must be 18085043209519168250 */ b=0;
|
||||
b=a&0xF0F0F0F0F0F0F0F0ULL;
|
||||
/* Before b must be 11574427654092267680 */ b=0;
|
||||
b=a^0xF0F0F0F0F0F0F0F0ULL;
|
||||
/* Before b must be 6510615555426900570 */ b=0;
|
||||
b=~(a|0xF0F0F0F0F0F0F0F0ULL);
|
||||
/* Before b must be 361700864190383365 */ b=0;
|
||||
b=~(a&0xF0F0F0F0F0F0F0F0ULL);
|
||||
/* Before b must be 6872316419617283935 */ b=0;
|
||||
b=~(a^0xF0F0F0F0F0F0F0F0ULL);
|
||||
/* Before b must be 11936128518282651045 */ b=0;
|
||||
b=~0xF0F0F0F0F0F0F0F0ULL;
|
||||
/* Before b must be 1085102592571150095 */ b=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,64 +0,0 @@
|
|||
/**
|
||||
* @file 076.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long int a,b,c;
|
||||
|
||||
a=-32;
|
||||
c=50;
|
||||
b=0;
|
||||
b=a<c;
|
||||
/* Before b must be 1 */ b=0;
|
||||
c=-5;
|
||||
b=a<c;
|
||||
/* Before b must be 1 */ b=0;
|
||||
a=200;
|
||||
c=-20;
|
||||
b=a<c;
|
||||
/* Before b must be 0 */ b=0;
|
||||
c=20;
|
||||
b=a<c;
|
||||
/* Before b must be 0 */ b=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,64 +0,0 @@
|
|||
/**
|
||||
* @file 077.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long int a,b,c;
|
||||
|
||||
a=-32;
|
||||
c=-50;
|
||||
b=0;
|
||||
b=a<-50;
|
||||
/* Before b must be 0 */ b=0;
|
||||
c=-5;
|
||||
b=a<-5;
|
||||
/* Before b must be 1 */ b=0;
|
||||
a=200;
|
||||
c=250;
|
||||
b=a<250;
|
||||
/* Before b must be 1 */ b=0;
|
||||
c=210;
|
||||
b=a<210;
|
||||
/* Before b must be 1 */ b=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,62 +0,0 @@
|
|||
/**
|
||||
* @file 075.bool.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various boolean operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long int a,b;
|
||||
|
||||
a=0x00000000;
|
||||
b=a|0x01F;
|
||||
/* Before b must be 0xFFFFFF00 */ b=0;
|
||||
b=a|0x00F;
|
||||
/* Before b must be 0x0000000F */ b=0;
|
||||
b=a|0x011;
|
||||
/* Before b must be 0x10000000 */ b=0;
|
||||
b=~(a|0x101);
|
||||
/* Before b must be 361700864190383365 */ b=0;
|
||||
b=~(a|0x111);
|
||||
/* Before b must be 6872316419617283935 */ b=0;
|
||||
b=~(a|0xFFF);
|
||||
/* Before b must be 11936128518282651045 */ b=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,149 +0,0 @@
|
|||
/**
|
||||
* @file 081.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned char shifts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char uc;
|
||||
signed char sc;
|
||||
|
||||
|
||||
uc=0xFF;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 127 */ uc=0;
|
||||
|
||||
uc=0x00;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
uc=0x01;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
uc=0x80;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 64 */ uc=0;
|
||||
|
||||
uc=0xAA;
|
||||
uc=uc>>1;
|
||||
/* Before uc must be 85 */ uc=0;
|
||||
|
||||
uc=0x3C;
|
||||
uc=uc>>2;
|
||||
/* Before uc must be 15 */ uc=0;
|
||||
|
||||
|
||||
sc=0xFF;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be -1 */ sc=0;
|
||||
|
||||
sc=0x00;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be 0 */ sc=0;
|
||||
|
||||
sc=0x01;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be 0 */ sc=0;
|
||||
|
||||
sc=0x80;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be -64 */ sc=0;
|
||||
|
||||
sc=0xAA;
|
||||
sc=sc>>1;
|
||||
/* Before sc must be -43 */ sc=0;
|
||||
|
||||
sc=0x3C;
|
||||
sc=sc>>2;
|
||||
/* Before sc must be 15 */ sc=0;
|
||||
|
||||
|
||||
uc=0xFF;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 254 */ uc=0;
|
||||
|
||||
uc=0x00;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
uc=0x01;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 2 */ uc=0;
|
||||
|
||||
uc=0x80;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 0 */ uc=0;
|
||||
|
||||
uc=0xAA;
|
||||
uc=uc<<1;
|
||||
/* Before uc must be 84 */ uc=0;
|
||||
|
||||
uc=0x3C;
|
||||
uc=uc<<2;
|
||||
/* Before uc must be 240 */ uc=0;
|
||||
|
||||
|
||||
sc=0xFF;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be -2 */ sc=0;
|
||||
|
||||
sc=0x00;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be 0 */ sc=0;
|
||||
|
||||
sc=0x01;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be 2 */ sc=0;
|
||||
|
||||
sc=0x80;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be 0 */ sc=0;
|
||||
|
||||
sc=0xAA;
|
||||
sc=sc<<1;
|
||||
/* Before sc must be 84 */ sc=0;
|
||||
|
||||
sc=0x3C;
|
||||
sc=sc<<2;
|
||||
/* Before sc must be -16 */ sc=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,149 +0,0 @@
|
|||
/**
|
||||
* @file 082.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned short int shifts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int usi;
|
||||
signed short int ssi;
|
||||
|
||||
|
||||
usi=0xFFFF;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 32767 */ usi=0;
|
||||
|
||||
usi=0x0000;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 0 */ usi=0;
|
||||
|
||||
usi=0x0001;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 0 */ usi=0;
|
||||
|
||||
usi=0x8000;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 16384 */ usi=0;
|
||||
|
||||
usi=0xAAAA;
|
||||
usi=usi>>1;
|
||||
/* Before usi must be 21845 */ usi=0;
|
||||
|
||||
usi=0x03C0;
|
||||
usi=usi>>2;
|
||||
/* Before usi must be 240 */ usi=0;
|
||||
|
||||
|
||||
ssi=0xFFFF;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be -1 */ ssi=0;
|
||||
|
||||
ssi=0x0000;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be 0 */ ssi=0;
|
||||
|
||||
ssi=0x0001;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be 0 */ ssi=0;
|
||||
|
||||
ssi=0x8000;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be -16384 */ ssi=0;
|
||||
|
||||
ssi=0xAAAA;
|
||||
ssi=ssi>>1;
|
||||
/* Before ssi must be -10923 */ ssi=0;
|
||||
|
||||
ssi=0x03C0;
|
||||
ssi=ssi>>2;
|
||||
/* Before ssi must be 240 */ ssi=0;
|
||||
|
||||
|
||||
usi=0xFFFF;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 65534 */ usi=0;
|
||||
|
||||
usi=0x0000;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 0 */ usi=0;
|
||||
|
||||
usi=0x0001;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 2 */ usi=0;
|
||||
|
||||
usi=0x8000;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 0 */ usi=0;
|
||||
|
||||
usi=0xAAAA;
|
||||
usi=usi<<1;
|
||||
/* Before usi must be 21844 */ usi=0;
|
||||
|
||||
usi=0x03C0;
|
||||
usi=usi<<2;
|
||||
/* Before usi must be 3840 */ usi=0;
|
||||
|
||||
|
||||
ssi=0xFFFF;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be -2 */ ssi=0;
|
||||
|
||||
ssi=0x0000;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be 0 */ ssi=0;
|
||||
|
||||
ssi=0x0001;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be 2 */ ssi=0;
|
||||
|
||||
ssi=0x8000;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be 0 */ ssi=0;
|
||||
|
||||
ssi=0xAAAA;
|
||||
ssi=ssi<<1;
|
||||
/* Before ssi must be 21844 */ ssi=0;
|
||||
|
||||
ssi=0x03C0;
|
||||
ssi=ssi<<2;
|
||||
/* Before ssi must be 3840 */ ssi=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,149 +0,0 @@
|
|||
/**
|
||||
* @file 083.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned int shifts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int ui;
|
||||
signed int si;
|
||||
|
||||
|
||||
ui=0xFFFFFFFF;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 2147483647 */ ui=0;
|
||||
|
||||
ui=0x00000000;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 0 */ ui=0;
|
||||
|
||||
ui=0x00000001;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 0 */ ui=0;
|
||||
|
||||
ui=0x80000000;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 1073741824 */ ui=0;
|
||||
|
||||
ui=0xAAAAAAAA;
|
||||
ui=ui>>1;
|
||||
/* Before ui must be 1431655765 */ ui=0;
|
||||
|
||||
ui=0x0003C000;
|
||||
ui=ui>>2;
|
||||
/* Before ui must be 61440 */ ui=0;
|
||||
|
||||
|
||||
si=0xFFFFFFFF;
|
||||
si=si>>1;
|
||||
/* Before si must be -1 */ si=0;
|
||||
|
||||
si=0x00000000;
|
||||
si=si>>1;
|
||||
/* Before si must be 0 */ si=0;
|
||||
|
||||
si=0x00000001;
|
||||
si=si>>1;
|
||||
/* Before si must be 0 */ si=0;
|
||||
|
||||
si=0x80000000;
|
||||
si=si>>1;
|
||||
/* Before si must be -1073741824 */ si=0;
|
||||
|
||||
si=0xAAAAAAAA;
|
||||
si=si>>1;
|
||||
/* Before si must be -715827883 */ si=0;
|
||||
|
||||
si=0x0003C000;
|
||||
si=si>>2;
|
||||
/* Before si must be 61440 */ si=0;
|
||||
|
||||
|
||||
ui=0xFFFFFFFF;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 4294967294 */ ui=0;
|
||||
|
||||
ui=0x00000000;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 0 */ ui=0;
|
||||
|
||||
ui=0x00000001;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 2 */ ui=0;
|
||||
|
||||
ui=0x80000000;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 0 */ ui=0;
|
||||
|
||||
ui=0xAAAAAAAA;
|
||||
ui=ui<<1;
|
||||
/* Before ui must be 1431655764 */ ui=0;
|
||||
|
||||
ui=0x0003C000;
|
||||
ui=ui<<2;
|
||||
/* Before ui must be 983040 */ ui=0;
|
||||
|
||||
|
||||
si=0xFFFFFFFF;
|
||||
si=si<<1;
|
||||
/* Before si must be -2 */ si=0;
|
||||
|
||||
si=0x00000000;
|
||||
si=si<<1;
|
||||
/* Before si must be 0 */ si=0;
|
||||
|
||||
si=0x00000001;
|
||||
si=si<<1;
|
||||
/* Before si must be 2 */ si=0;
|
||||
|
||||
si=0x80000000;
|
||||
si=si<<1;
|
||||
/* Before si must be 0 */ si=0;
|
||||
|
||||
si=0xAAAAAAAA;
|
||||
si=si<<1;
|
||||
/* Before si must be 1431655764 */ si=0;
|
||||
|
||||
si=0x0003C000;
|
||||
si=si<<2;
|
||||
/* Before si must be 983040 */ si=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,148 +0,0 @@
|
|||
/**
|
||||
* @file 084.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned long long int shifts.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int uli;
|
||||
signed long long int sli;
|
||||
|
||||
uli=0xFFFFFFFFFFFFFFFFULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 9223372036854775807 */ uli=0;
|
||||
|
||||
uli=0x0000000000000000ULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 0 */ uli=0;
|
||||
|
||||
uli=0x0000000000000001ULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 0 */ uli=0;
|
||||
|
||||
uli=0x8000000000000000ULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 4611686018427387904 */ uli=0;
|
||||
|
||||
uli=0xAAAAAAAAAAAAAAAAULL;
|
||||
uli=uli>>1;
|
||||
/* Before uli must be 6148914691236517205 */ uli=0;
|
||||
|
||||
uli=0x00000003C0000000ULL;
|
||||
uli=uli>>2;
|
||||
/* Before uli must be 4026531840 */ uli=0;
|
||||
|
||||
|
||||
sli=0xFFFFFFFFFFFFFFFFLL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be -1 */ sli=0;
|
||||
|
||||
sli=0x0000000000000000LL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be 0 */ sli=0;
|
||||
|
||||
sli=0x0000000000000001LL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be 0 */ sli=0;
|
||||
|
||||
sli=0x8000000000000000LL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be -4611686018427387904 */ sli=0;
|
||||
|
||||
sli=0xAAAAAAAAAAAAAAAALL;
|
||||
sli=sli>>1;
|
||||
/* Before sli must be -3074457345618258603 */ sli=0;
|
||||
|
||||
sli=0x00000003C0000000LL;
|
||||
sli=sli>>2;
|
||||
/* Before sli must be 4026531840 */ sli=0;
|
||||
|
||||
|
||||
uli=0xFFFFFFFFFFFFFFFFULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 18446744073709551614 */ uli=0;
|
||||
|
||||
uli=0x0000000000000000ULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 0 */ uli=0;
|
||||
|
||||
uli=0x0000000000000001ULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 2 */ uli=0;
|
||||
|
||||
uli=0x8000000000000000ULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 0 */ uli=0;
|
||||
|
||||
uli=0xAAAAAAAAAAAAAAAAULL;
|
||||
uli=uli<<1;
|
||||
/* Before uli must be 6148914691236517204 */ uli=0;
|
||||
|
||||
uli=0x00000003C0000000ULL;
|
||||
uli=uli<<2;
|
||||
/* Before uli must be 64424509440 */ uli=0;
|
||||
|
||||
|
||||
sli=0xFFFFFFFFFFFFFFFFLL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be -2 */ sli=0;
|
||||
|
||||
sli=0x0000000000000000LL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be 0 */ sli=0;
|
||||
|
||||
sli=0x0000000000000001LL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be 2 */ sli=0;
|
||||
|
||||
sli=0x8000000000000000LL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be 0 */ sli=0;
|
||||
|
||||
sli=0xAAAAAAAAAAAAAAAALL;
|
||||
sli=sli<<1;
|
||||
/* Before sli must be 6148914691236517204 */ sli=0;
|
||||
|
||||
sli=0x00000003C0000000LL;
|
||||
sli=sli<<2;
|
||||
/* Before sli must be 64424509440 */ sli=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,73 +0,0 @@
|
|||
/**
|
||||
* @file 085.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses shifts and some logic operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int abcdefgh;
|
||||
unsigned long long int hgfedcba;
|
||||
unsigned int abcd;
|
||||
unsigned int dcba;
|
||||
unsigned short int ab;
|
||||
unsigned short int ba;
|
||||
|
||||
abcdefgh=0x8899AABBCCDDEEFFULL;
|
||||
hgfedcba=(((abcdefgh & 0xFF00000000000000ULL)>>56) |
|
||||
((abcdefgh & 0x00FF000000000000ULL)>>40) |
|
||||
((abcdefgh & 0x0000FF0000000000ULL)>>24) |
|
||||
((abcdefgh & 0x000000FF00000000ULL)>>8) |
|
||||
((abcdefgh & 0x00000000FF000000ULL)<<8) |
|
||||
((abcdefgh & 0x0000000000FF0000ULL)<<24) |
|
||||
((abcdefgh & 0x000000000000FF00ULL)<<40) |
|
||||
((abcdefgh & 0x00000000000000FFULL)<<56));
|
||||
/* Before hgfedcba must be 18441921395520346504 */ hgfedcba=0;
|
||||
|
||||
abcd=0xAABBCCDD;
|
||||
dcba=(((abcd & 0x000000FF)<<24) | ((abcd & 0x0000FF00)<<8) |
|
||||
((abcd & 0x00FF0000)>>8) | ((abcd & 0xFF000000)>>24));
|
||||
/* Before dcba must be 3721182122 */ dcba=0;
|
||||
|
||||
ab=0xAABB;
|
||||
ba=(((ab & 0x00FF)<<8) | ((ab & 0xFF00)>>8));
|
||||
/* Before ba must be 48042 */ ba=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,70 +0,0 @@
|
|||
/**
|
||||
* @file 086.shift.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses shifts and some logic operators.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a;
|
||||
signed long long int b;
|
||||
|
||||
a = 0xFFFFFFFFFFFFFF38;
|
||||
b = 0x0;
|
||||
|
||||
//before a = -200
|
||||
a = a >> b;
|
||||
//after a = -200
|
||||
|
||||
b = 0x1;
|
||||
//before a = -200
|
||||
a = a >> b;
|
||||
//after a = -100
|
||||
|
||||
b = 0x2;
|
||||
//before a = -100
|
||||
a = a >> b;
|
||||
//after a = -25
|
||||
|
||||
//before a = -25
|
||||
a = a >> b;
|
||||
//after a = -7
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,244 +0,0 @@
|
|||
/**
|
||||
* @file 111.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed char ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x00;
|
||||
b=0xFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFF;
|
||||
b=0xFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x01;
|
||||
b=0x02;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0x0F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x01;
|
||||
b=0xFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,244 +0,0 @@
|
|||
/**
|
||||
* @file 112.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned char ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x00;
|
||||
b=0xFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFF;
|
||||
b=0xFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x01;
|
||||
b=0x02;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x0F;
|
||||
b=0x0F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x01;
|
||||
b=0xFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,244 +0,0 @@
|
|||
/**
|
||||
* @file 113.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed short int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0xFFFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0001;
|
||||
b=0x0002;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x000F;
|
||||
b=0x000F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0001;
|
||||
b=0xFFFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,244 +0,0 @@
|
|||
/**
|
||||
* @file 114.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned short int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned short int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x0000;
|
||||
b=0xFFFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFF;
|
||||
b=0xFFFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0001;
|
||||
b=0x0002;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x000F;
|
||||
b=0x000F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0001;
|
||||
b=0xFFFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,244 +0,0 @@
|
|||
/**
|
||||
* @file 115.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0xFFFFFFFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x00000001;
|
||||
b=0x00000002;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x0000000F;
|
||||
b=0x0000000F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x00000001;
|
||||
b=0xFFFFFFFF;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,244 +0,0 @@
|
|||
/**
|
||||
* @file 116.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses unsigned int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x00000000;
|
||||
b=0xFFFFFFFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFFFFFF;
|
||||
b=0xFFFFFFFE;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x00000001;
|
||||
b=0x00000002;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x0000000F;
|
||||
b=0x0000000F;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x00000001;
|
||||
b=0xFFFFFFFF;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,244 +0,0 @@
|
|||
/**
|
||||
* @file 117.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses signed long long int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x0000000000000000LL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFLL;
|
||||
b=0xFFFFFFFFFFFFFFFELL;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0000000000000001LL;
|
||||
b=0x0000000000000002LL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x000000000000000FLL;
|
||||
b=0x000000000000000FLL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0000000000000001LL;
|
||||
b=0xFFFFFFFFFFFFFFFFLL;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,244 +0,0 @@
|
|||
/**
|
||||
* @file 118.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses unsigned long long int ifs
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int a,b;
|
||||
unsigned char c_active_else,c_inactive_else;
|
||||
unsigned char c_active_then,c_inactive_then;
|
||||
|
||||
c_active_then=0;
|
||||
c_active_else=0;
|
||||
c_inactive_then=0;
|
||||
c_inactive_else=0;
|
||||
|
||||
a=0x0000000000000000ULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0xFFFFFFFFFFFFFFFFULL;
|
||||
b=0xFFFFFFFFFFFFFFFEULL;
|
||||
if(a > b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0000000000000001ULL;
|
||||
b=0x0000000000000002ULL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
a=0x000000000000000FULL;
|
||||
b=0x000000000000000FULL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 3 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 2 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
a=0x0000000000000001ULL;
|
||||
b=0xFFFFFFFFFFFFFFFFULL;
|
||||
if(a > b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a < b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
if(a == b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a >= b) {
|
||||
c_inactive_then++; /* $=FAILED! */
|
||||
}
|
||||
else {
|
||||
c_active_else++; /* $=OK! */
|
||||
}
|
||||
if(a <= b) {
|
||||
c_active_then++; /* $=OK! */
|
||||
}
|
||||
else {
|
||||
c_inactive_else++; /* $=FAILED! */
|
||||
}
|
||||
/* Before, c_active_then must be 2 */ c_active_then=0;
|
||||
/* Before, c_active_else must be 3 */ c_active_else=0;
|
||||
/* Before, c_inactive_then must be 0 */ c_inactive_then=0;
|
||||
/* Before, c_inactive_else must be 0 */ c_inactive_else=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,131 +0,0 @@
|
|||
/**
|
||||
* @file 119.if.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses various ifs.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char a;
|
||||
unsigned char b;
|
||||
signed short int c;
|
||||
unsigned short int d;
|
||||
signed int e;
|
||||
unsigned int f;
|
||||
signed long long int g;
|
||||
unsigned long long int h;
|
||||
|
||||
unsigned char ok,failed;
|
||||
|
||||
ok=0;
|
||||
failed=0;
|
||||
a=0;
|
||||
b=1;
|
||||
c=2;
|
||||
d=3;
|
||||
e=4;
|
||||
f=5;
|
||||
g=6;
|
||||
h=7;
|
||||
|
||||
if(a==0)
|
||||
if(b==1)
|
||||
if(c==2)
|
||||
if(d==3)
|
||||
if(e==4)
|
||||
if(f==5)
|
||||
if(g==6)
|
||||
if(h==7)
|
||||
ok++; /* $= OK! */
|
||||
|
||||
if(a>=0)
|
||||
if(b<=1)
|
||||
if(c>=2)
|
||||
if(d<=3)
|
||||
if(e>=4)
|
||||
if(f>=5)
|
||||
if(g<=6)
|
||||
if(h<=7)
|
||||
ok++; /* $= OK! */
|
||||
|
||||
if(a>=-1)
|
||||
if(b>=1)
|
||||
if(c>=-2)
|
||||
if(d>=3)
|
||||
if(e>=-3)
|
||||
if(f>=5)
|
||||
if(g>=-4)
|
||||
if(h>=7)
|
||||
ok++; /* $= OK! */
|
||||
|
||||
if(a==0)
|
||||
if(b==1)
|
||||
if(c==2)
|
||||
if(d==3)
|
||||
if(e<4)
|
||||
if(f==5)
|
||||
if(g==6)
|
||||
if(h==7)
|
||||
failed++; /* $= FAILED! */
|
||||
|
||||
if(a>=0)
|
||||
if(b<=1)
|
||||
if(c>=2)
|
||||
if(d<=3)
|
||||
if(e>=4)
|
||||
if(f>=5)
|
||||
if(g<=6)
|
||||
if(h==8)
|
||||
failed++; /* $= FAILED! */
|
||||
|
||||
if(a==-1)
|
||||
if(b>=1)
|
||||
if(c>=-2)
|
||||
if(d>=3)
|
||||
if(e>=-3)
|
||||
if(f>=5)
|
||||
if(g>=-4)
|
||||
if(h>=7)
|
||||
failed++; /* $= FAILED! */
|
||||
|
||||
ok=0; /* Before ok must be 3 */
|
||||
failed=0; /* Before failed must be 0 */
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,100 +0,0 @@
|
|||
/**
|
||||
* @file 121.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses while loops.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int cont;
|
||||
|
||||
unsigned char a;
|
||||
signed char b;
|
||||
unsigned short int c;
|
||||
signed short int d;
|
||||
unsigned int e;
|
||||
signed int f;
|
||||
unsigned long long int g;
|
||||
signed long long int h;
|
||||
|
||||
cont=0;
|
||||
|
||||
a=5;
|
||||
while(a--)
|
||||
cont++;
|
||||
/* Before a must be 255 and cont 5 */ a=0;
|
||||
|
||||
b=5;
|
||||
while(b--)
|
||||
cont++;
|
||||
/* Before b must be -1 and cont 10 */ b=0;
|
||||
|
||||
c=5;
|
||||
while(c--)
|
||||
cont++;
|
||||
/* Before c must be 65535 and cont 15 */ c=0;
|
||||
|
||||
d=5;
|
||||
while(d--)
|
||||
cont++;
|
||||
/* Before d must be -1 and cont 20 */ d=0;
|
||||
|
||||
e=5;
|
||||
while(e--)
|
||||
cont++;
|
||||
/* Before e must be 4294967295 and cont 25 */ e=0;
|
||||
|
||||
f=5;
|
||||
while(f--)
|
||||
cont++;
|
||||
/* Before f must be -1 and cont 30 */ f=0;
|
||||
|
||||
g=5;
|
||||
while(g--)
|
||||
cont++;
|
||||
/* Before g must be 18446744073709551615 and cont 35 */ g=0;
|
||||
|
||||
h=5;
|
||||
while(h--)
|
||||
cont++;
|
||||
/* Before h must be -1 and cont 40 */ h=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,91 +0,0 @@
|
|||
/**
|
||||
* @file 122.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses for loops.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int cont;
|
||||
|
||||
unsigned char a;
|
||||
signed char b;
|
||||
unsigned short int c;
|
||||
signed short int d;
|
||||
unsigned int e;
|
||||
signed int f;
|
||||
unsigned long long int g;
|
||||
signed long long int h;
|
||||
|
||||
cont=0;
|
||||
|
||||
for(a=0;a<5;a++)
|
||||
cont++;
|
||||
/* Before a must be 5 and cont 5 */ a=0;
|
||||
|
||||
for(b=0;b<5;b++)
|
||||
cont++;
|
||||
/* Before b must be 5 and cont 10 */ b=0;
|
||||
|
||||
for(c=0;c<5;c++)
|
||||
cont++;
|
||||
/* Before c must be 5 and cont 15 */ c=0;
|
||||
|
||||
for(d=0;d<5;d++)
|
||||
cont++;
|
||||
/* Before d must be 5 and cont 20 */ d=0;
|
||||
|
||||
for(e=0;e<5;e++)
|
||||
cont++;
|
||||
/* Before e must be 5 and cont 25 */ e=0;
|
||||
|
||||
for(f=0;f<5;f++)
|
||||
cont++;
|
||||
/* Before f must be 5 and cont 30 */ f=0;
|
||||
|
||||
for(g=0;g<5;g++)
|
||||
cont++;
|
||||
/* Before g must be 5 and cont 35 */ g=0;
|
||||
|
||||
for(h=0;h<5;h++)
|
||||
cont++;
|
||||
/* Before h must be 5 and cont 40 */ h=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,89 +0,0 @@
|
|||
/**
|
||||
* @file 123.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses a implemented unsigned multiplication
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char count;
|
||||
unsigned int C,A,Q,M;
|
||||
unsigned long long int result;
|
||||
|
||||
count=32; /* 32 bits * 32 bits = 64 bits */
|
||||
|
||||
/* Some variable */
|
||||
M=0x1314AB42;
|
||||
Q=0xF1B34517;
|
||||
A=0x00000000;
|
||||
C=0x00000000;
|
||||
|
||||
while(count!=0) {
|
||||
|
||||
/* if q0 = 1 add */
|
||||
if(Q & 0x00000001) {
|
||||
if(((unsigned long long int)A+
|
||||
(unsigned long long int)M) > 0xFFFFFFFF) /* Check if have carry */
|
||||
C=1;
|
||||
else
|
||||
C=0;
|
||||
A=A+M;
|
||||
}
|
||||
|
||||
/* Shift */
|
||||
Q=Q>>1;
|
||||
if(A & 0x00000001)
|
||||
Q=(Q | 0x80000000);
|
||||
A=A>>1;
|
||||
if(C & 0x00000001)
|
||||
A=(A | 0x80000000);
|
||||
C=C>>1;
|
||||
|
||||
/* Decrement counter */
|
||||
count--;
|
||||
|
||||
}
|
||||
|
||||
result=0;
|
||||
result=((((unsigned long long int)(A)) << 32) |
|
||||
((unsigned long long int)(Q)));
|
||||
/* Before result must be 1298111822488546542 */ result=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,104 +0,0 @@
|
|||
/**
|
||||
* @file 124.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses a implemented signed multiplication (Booth)
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char count;
|
||||
unsigned int A,Q,Qmenos,M,mask;
|
||||
signed long long int result;
|
||||
|
||||
count=32; /* 32 bits * 32 bits = 64 bits */
|
||||
|
||||
/* Some variable */
|
||||
M=0x82348243;
|
||||
Q=0x41378972;
|
||||
Qmenos=0x00000000;
|
||||
A=0x00000000;
|
||||
|
||||
while(count!=0) {
|
||||
|
||||
mask=(((Q<<1) & 0x00000002) | (Qmenos & 0x00000001));
|
||||
|
||||
switch(mask) {
|
||||
|
||||
case 0x0: /* q0=0 and qm=0 */
|
||||
case 0x3: /* qo=1 and qm=1 */
|
||||
/* Nothing */
|
||||
break;
|
||||
|
||||
case 0x2: /* q0=1 and qm=0 */
|
||||
A=A-M;
|
||||
break;
|
||||
|
||||
case 0x1: /* q0=0 and qm=1 */
|
||||
A=A+M;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
/* Shift */
|
||||
if(Q & 0x00000001)
|
||||
Qmenos=1;
|
||||
else
|
||||
Qmenos=0;
|
||||
|
||||
Q=Q>>1;
|
||||
|
||||
if(A & 0x00000001)
|
||||
Q=(Q | 0x80000000);
|
||||
else
|
||||
Q=(Q & 0x7FFFFFFF);
|
||||
|
||||
A=A>>1;
|
||||
if(A & 0x40000000)
|
||||
A=(A | 0x80000000);
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
result=0;
|
||||
result=((((unsigned long long int)(A)) << 32) |
|
||||
((unsigned long long int)(Q)));
|
||||
/* Before result must be -2309208815826051882 */ result=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,73 +0,0 @@
|
|||
/**
|
||||
* @file 125.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses a implemented simple strlen loop.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char *ac="ArchC - Architecture Description Language\n";
|
||||
unsigned char *lsc="Computer System Laboratory\n";
|
||||
unsigned char *ic="Institute of Computing - UNICAMP\n";
|
||||
unsigned char *p;
|
||||
unsigned int count;
|
||||
|
||||
p=ac;
|
||||
count=0;
|
||||
while(*p) { /* strlen */
|
||||
p++; count++;
|
||||
}
|
||||
/* Before count must be 42 */ count=0;
|
||||
|
||||
p=lsc;
|
||||
count=0;
|
||||
while(*p) { /* strlen */
|
||||
p++; count++;
|
||||
}
|
||||
/* Before count must be 27 */ count=0;
|
||||
|
||||
p=ic;
|
||||
count=0;
|
||||
while(*p) { /* strlen */
|
||||
p++; count++;
|
||||
}
|
||||
/* Before count must be 33 */ count=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,73 +0,0 @@
|
|||
/**
|
||||
* @file 126.loop.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses implemented simple fatorial loop.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int nu;
|
||||
unsigned long long int resultu;
|
||||
unsigned long long int iu;
|
||||
|
||||
signed long long int ns;
|
||||
signed long long int results;
|
||||
signed long long int is;
|
||||
|
||||
nu=25;
|
||||
resultu=1;
|
||||
iu=nu;
|
||||
while(iu>1) {
|
||||
resultu=resultu*iu;
|
||||
iu--;
|
||||
}
|
||||
/* Before must be 7034535277573963776 */ resultu=0;
|
||||
|
||||
ns=25;
|
||||
results=1;
|
||||
is=ns;
|
||||
while(is>1) {
|
||||
results=results*is;
|
||||
is--;
|
||||
}
|
||||
/* Before must be 7034535277573963776 */ results=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,75 +0,0 @@
|
|||
/**
|
||||
* @file 131.call.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses calls functions arg int, ret int.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
int tmp;
|
||||
|
||||
tmp=funcmenos(0);
|
||||
/* Before tmp must be -1 */ tmp=0;
|
||||
|
||||
tmp=funcmais(0);
|
||||
/* Before tmp must be 1 */ tmp=0;
|
||||
|
||||
tmp=funcmenos(-1);
|
||||
/* Before tmp must be -2 */ tmp=0;
|
||||
|
||||
tmp=funcmais(-1);
|
||||
/* Before tmp must be 0 */ tmp=0;
|
||||
|
||||
tmp=funcmenos(1);
|
||||
/* Before tmp must be 0 */ tmp=0;
|
||||
|
||||
tmp=funcmais(1);
|
||||
/* Before tmp must be 2 */ tmp=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
int funcmenos(int input) {
|
||||
return(input-1);
|
||||
}
|
||||
|
||||
int funcmais(int input) {
|
||||
return(input+1);
|
||||
}
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
/**
|
||||
* @file 132.call.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses indirect calls functions.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* Declarations */
|
||||
signed char funcA(signed char input);
|
||||
signed char funcB(signed char input);
|
||||
signed char funcC(signed char input);
|
||||
signed char funcD(signed char input);
|
||||
signed char funcE(signed char input);
|
||||
signed char funcF(signed char input);
|
||||
signed char funcG(signed char input);
|
||||
signed char funcH(signed char input);
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed char tmp=0;
|
||||
tmp=funcA(-1);
|
||||
/* Before tmp must be -1 */ tmp=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
unsigned long long int count=0;
|
||||
|
||||
signed char funcA(signed char input) {
|
||||
signed int a=-2;
|
||||
funcB(input);
|
||||
count++;
|
||||
a++;
|
||||
/* Before a must be -1 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcB(signed char input) {
|
||||
unsigned int b=0;
|
||||
funcC(input);
|
||||
count++;
|
||||
b++;
|
||||
/* Before b must be 1 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcC(signed char input) {
|
||||
signed short int c=-1;
|
||||
funcD(input);
|
||||
count++;
|
||||
c++;
|
||||
/* Before c must be 0 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcD(signed char input) {
|
||||
unsigned short int d=9;
|
||||
funcE(input);
|
||||
count++;
|
||||
d++;
|
||||
/* Before d must be 10 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcE(signed char input) {
|
||||
signed int e=-1;
|
||||
funcF(input);
|
||||
count++;
|
||||
e++;
|
||||
/* Before e must be 0 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcF(signed char input) {
|
||||
unsigned int f=14;
|
||||
funcG(input);
|
||||
count++;
|
||||
f++;
|
||||
/* Before f must be 15 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcG(signed char input) {
|
||||
signed long long int g=-2;
|
||||
funcH(input);
|
||||
count++;
|
||||
g++;
|
||||
/* Before g must be -1 */ return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
signed char funcH(signed char input) {
|
||||
unsigned long long int h=1;
|
||||
count++;
|
||||
h++;
|
||||
|
||||
/* Before h must be 2 */ return input;
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
/**
|
||||
* @file 133.call.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses recursive fatorial.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* Declarations */
|
||||
unsigned long long int ulifatorial(unsigned long long int n);
|
||||
signed long long int slifatorial(signed long long int n);
|
||||
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int ulin;
|
||||
signed long long int slin;
|
||||
|
||||
ulin=ulifatorial(25);
|
||||
/* Before ulin must be 7034535277573963776 */ ulin=0;
|
||||
slin=slifatorial(25);
|
||||
/* Before slin must be 7034535277573963776 */ slin=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
|
||||
unsigned long long int ulifatorial(unsigned long long int n) {
|
||||
if(n > 1)
|
||||
return(n*ulifatorial(n-1));
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
signed long long int slifatorial(signed long long int n) {
|
||||
if(n > 1)
|
||||
return(n*slifatorial(n-1));
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,76 +0,0 @@
|
|||
/**
|
||||
* @file 134.call.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:21 -0300
|
||||
* @brief It is a simple main function that uses recursive Fibonacci function.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* Declarations */
|
||||
unsigned long long int ulifibonacci(unsigned long long int n);
|
||||
signed long long int slifibonacci(signed long long int n);
|
||||
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned long long int ulin;
|
||||
signed long long int slin;
|
||||
|
||||
ulin=ulifibonacci(13);
|
||||
/* Before ulin must be */ ulin=0;
|
||||
slin=slifibonacci(13);
|
||||
/* Before ulin must be */ slin=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
unsigned long long int ulifibonacci(unsigned long long int n) {
|
||||
if(n < 3)
|
||||
return 1;
|
||||
else
|
||||
return(ulifibonacci(n-1)+
|
||||
ulifibonacci(n-2));
|
||||
}
|
||||
|
||||
signed long long int slifibonacci(signed long long int n) {
|
||||
if(n < 3)
|
||||
return 1;
|
||||
else
|
||||
return(slifibonacci(n-1)+
|
||||
slifibonacci(n-2));
|
||||
}
|
||||
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,162 +0,0 @@
|
|||
/**
|
||||
* @file 141.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses size three dot products.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
unsigned char uca[3];
|
||||
unsigned char ucb[3];
|
||||
unsigned char ucc;
|
||||
|
||||
signed char sca[3];
|
||||
signed char scb[3];
|
||||
signed char scc;
|
||||
|
||||
unsigned short int usia[3];
|
||||
unsigned short int usib[3];
|
||||
unsigned short int usic;
|
||||
|
||||
signed short int ssia[3];
|
||||
signed short int ssib[3];
|
||||
signed short int ssic;
|
||||
|
||||
unsigned int uia[3];
|
||||
unsigned int uib[3];
|
||||
unsigned int uic;
|
||||
|
||||
signed int sia[3];
|
||||
signed int sib[3];
|
||||
signed int sic;
|
||||
|
||||
unsigned long long int ulia[3];
|
||||
unsigned long long int ulib[3];
|
||||
unsigned long long int ulic;
|
||||
|
||||
signed long long int slia[3];
|
||||
signed long long int slib[3];
|
||||
signed long long int slic;
|
||||
|
||||
unsigned char count;
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
uca[count-1]=count;
|
||||
ucb[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
usia[count-1]=count;
|
||||
usib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
uia[count-1]=count;
|
||||
uib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
ulia[count-1]=count;
|
||||
ulib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
sca[count-1]=count;
|
||||
scb[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
ssia[count-1]=count;
|
||||
ssib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
sia[count-1]=count;
|
||||
sib[count-1]=count;
|
||||
}
|
||||
|
||||
for(count=1;count<=3;count++) {
|
||||
slia[count-1]=count;
|
||||
slib[count-1]=count;
|
||||
}
|
||||
|
||||
|
||||
ucc=0;
|
||||
for(count=0;count<3;count++)
|
||||
ucc=ucc+(uca[count]*ucb[count]);
|
||||
/* Before ucc must be 14 */ ucc=0;
|
||||
|
||||
scc=0;
|
||||
for(count=0;count<3;count++)
|
||||
scc=scc+(sca[count]*scb[count]);
|
||||
/* Before scc must be 14 */ scc=0;
|
||||
|
||||
usic=0;
|
||||
for(count=0;count<3;count++)
|
||||
usic=usic+(usia[count]*usib[count]);
|
||||
/* Before usic must be 14 */ usic=0;
|
||||
|
||||
ssic=0;
|
||||
for(count=0;count<3;count++)
|
||||
ssic=ssic+(ssia[count]*ssib[count]);
|
||||
/* Before ssic must be 14 */ ssic=0;
|
||||
|
||||
uic=0;
|
||||
for(count=0;count<3;count++)
|
||||
uic=uic+(uia[count]*uib[count]);
|
||||
/* Before uic must be 14 */ uic=0;
|
||||
|
||||
sic=0;
|
||||
for(count=0;count<3;count++)
|
||||
sic=sic+(sia[count]*sib[count]);
|
||||
/* Before sic must be 14 */ sic=0;
|
||||
|
||||
ulic=0;
|
||||
for(count=0;count<3;count++)
|
||||
ulic=ulic+(ulia[count]*ulib[count]);
|
||||
/* Before ulic must be 14 */ ulic=0;
|
||||
|
||||
slic=0;
|
||||
for(count=0;count<3;count++)
|
||||
slic=slic+(slia[count]*slib[count]);
|
||||
/* Before slic must be 14 */ slic=0;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,82 +0,0 @@
|
|||
/**
|
||||
* @file 142.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses a kind of square matrix multiplication.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int a[10][10];
|
||||
signed long long int b[10][10];
|
||||
signed long long int c[10][10];
|
||||
|
||||
unsigned char i,j,k;
|
||||
|
||||
unsigned char error=0;
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* A = I */
|
||||
for(j=0 ; j<10 ; j++) {
|
||||
if(i==j)
|
||||
a[i][j]=1;
|
||||
else
|
||||
a[i][j]=0;
|
||||
}
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* B = X */
|
||||
for(j=0 ; j<10 ; j++)
|
||||
b[i][j]=((signed long long int)i+(signed long long int)j);
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* C = 0 */
|
||||
for(j=0 ; j<10 ; j++)
|
||||
c[i][j]=0;
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* C = A . B */
|
||||
for(j=0 ; j<10 ; j++)
|
||||
for(k=0 ; k<10 ; k++)
|
||||
c[i][j]=c[i][j]+(a[i][k]*b[k][j]);
|
||||
|
||||
for(i=0 ; i<10 ; i++) /* B = C ? */
|
||||
for(j=0 ; j<10 ; j++)
|
||||
if(b[i][j] != c[i][j])
|
||||
error=1;
|
||||
|
||||
/* Before error must be 0 */ error=0;
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
|
@ -1,151 +0,0 @@
|
|||
/**
|
||||
* @file 143.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned char Bubble Sort.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
void scBubbleSort(signed char scarray[],int size);
|
||||
void ucBubbleSort(unsigned char ucarray[],int size);
|
||||
|
||||
int main() {
|
||||
|
||||
signed char scinput[21];
|
||||
unsigned char ucinput[21];
|
||||
|
||||
signed char i;
|
||||
unsigned char j;
|
||||
|
||||
int count=0,errorsc=0,erroruc=0;
|
||||
|
||||
scinput[0]=0xDF;
|
||||
scinput[1]=0x44;
|
||||
scinput[2]=0x12;
|
||||
scinput[3]=0x45;
|
||||
scinput[4]=0x80;
|
||||
scinput[5]=0xDD;
|
||||
scinput[6]=0x43;
|
||||
scinput[7]=0x67;
|
||||
scinput[8]=0x00;
|
||||
scinput[9]=0x23;
|
||||
scinput[10]=0x01;
|
||||
scinput[11]=0xF7;
|
||||
scinput[12]=0x45;
|
||||
scinput[13]=0x86;
|
||||
scinput[14]=0x96;
|
||||
scinput[15]=0x52;
|
||||
scinput[16]=0xFF;
|
||||
scinput[17]=0x56;
|
||||
scinput[18]=0x23;
|
||||
scinput[19]=0x10;
|
||||
scinput[20]=0x05;
|
||||
|
||||
ucinput[0]=0xDF;
|
||||
ucinput[1]=0x44;
|
||||
ucinput[2]=0x12;
|
||||
ucinput[3]=0x45;
|
||||
ucinput[4]=0x80;
|
||||
ucinput[5]=0xDD;
|
||||
ucinput[6]=0x43;
|
||||
ucinput[7]=0x67;
|
||||
ucinput[8]=0x00;
|
||||
ucinput[9]=0x23;
|
||||
ucinput[10]=0x01;
|
||||
ucinput[11]=0xF7;
|
||||
ucinput[12]=0x45;
|
||||
ucinput[13]=0x86;
|
||||
ucinput[14]=0x96;
|
||||
ucinput[15]=0x52;
|
||||
ucinput[16]=0xFF;
|
||||
ucinput[17]=0x56;
|
||||
ucinput[18]=0x23;
|
||||
ucinput[19]=0x10;
|
||||
ucinput[20]=0x05;
|
||||
|
||||
|
||||
/* signed sort */
|
||||
scBubbleSort(scinput,21);
|
||||
/* unsigned sort */
|
||||
ucBubbleSort(ucinput,21);
|
||||
|
||||
|
||||
/* Check */
|
||||
errorsc=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(scinput[count] > scinput[count+1])
|
||||
errorsc=1;
|
||||
|
||||
/* Check */
|
||||
erroruc=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(ucinput[count] > ucinput[count+1])
|
||||
erroruc=1;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
/* signed char bubble sort */
|
||||
void scBubbleSort(signed char scarray[],int size) {
|
||||
int i,j;
|
||||
signed char temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(scarray[j+1] < scarray[j]) {
|
||||
temp=scarray[j+1];
|
||||
scarray[j+1]=scarray[j];
|
||||
scarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* unsigned char bubble sort */
|
||||
void ucBubbleSort(unsigned char ucarray[],int size) {
|
||||
int i,j;
|
||||
unsigned char temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(ucarray[j+1] < ucarray[j]) {
|
||||
temp=ucarray[j+1];
|
||||
ucarray[j+1]=ucarray[j];
|
||||
ucarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,151 +0,0 @@
|
|||
/**
|
||||
* @file 144.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned short int Bubble Sort.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
void ssiBubbleSort(signed short int ssiarray[],int size);
|
||||
void usiBubbleSort(unsigned short int usiarray[],int size);
|
||||
|
||||
int main() {
|
||||
|
||||
signed short int ssiinput[21];
|
||||
unsigned short int usiinput[21];
|
||||
|
||||
signed char i;
|
||||
unsigned char j;
|
||||
|
||||
int count,errorssi,errorusi;
|
||||
|
||||
ssiinput[0]=0xF5DF;
|
||||
ssiinput[1]=0x2444;
|
||||
ssiinput[2]=0x5612;
|
||||
ssiinput[3]=0xF645;
|
||||
ssiinput[4]=0xFF80;
|
||||
ssiinput[5]=0x12DD;
|
||||
ssiinput[6]=0x4343;
|
||||
ssiinput[7]=0xF167;
|
||||
ssiinput[8]=0x0000;
|
||||
ssiinput[9]=0x0123;
|
||||
ssiinput[10]=0x3301;
|
||||
ssiinput[11]=0x12F7;
|
||||
ssiinput[12]=0x8745;
|
||||
ssiinput[13]=0x8286;
|
||||
ssiinput[14]=0x1296;
|
||||
ssiinput[15]=0x3452;
|
||||
ssiinput[16]=0xE3FF;
|
||||
ssiinput[17]=0x2456;
|
||||
ssiinput[18]=0x6723;
|
||||
ssiinput[19]=0x7510;
|
||||
ssiinput[20]=0x0005;
|
||||
|
||||
usiinput[0]=0xF5DF;
|
||||
usiinput[1]=0x2444;
|
||||
usiinput[2]=0x5612;
|
||||
usiinput[3]=0xF645;
|
||||
usiinput[4]=0xFF80;
|
||||
usiinput[5]=0x12DD;
|
||||
usiinput[6]=0x4343;
|
||||
usiinput[7]=0xF167;
|
||||
usiinput[8]=0x0000;
|
||||
usiinput[9]=0x0123;
|
||||
usiinput[10]=0x3301;
|
||||
usiinput[11]=0x12F7;
|
||||
usiinput[12]=0x8745;
|
||||
usiinput[13]=0x8286;
|
||||
usiinput[14]=0x1296;
|
||||
usiinput[15]=0x3452;
|
||||
usiinput[16]=0xE3FF;
|
||||
usiinput[17]=0x2456;
|
||||
usiinput[18]=0x6723;
|
||||
usiinput[19]=0x7510;
|
||||
usiinput[20]=0x0005;
|
||||
|
||||
|
||||
/* signed sort */
|
||||
ssiBubbleSort(ssiinput,21);
|
||||
/* unsigned sort */
|
||||
usiBubbleSort(usiinput,21);
|
||||
|
||||
|
||||
/* Check */
|
||||
errorssi=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(ssiinput[count] > ssiinput[count+1])
|
||||
errorssi=1;
|
||||
|
||||
/* Check */
|
||||
errorusi=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(usiinput[count] > usiinput[count+1])
|
||||
errorusi=1;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
/* signed short int bubble sort */
|
||||
void ssiBubbleSort(signed short int ssiarray[],int size) {
|
||||
int i,j;
|
||||
signed short int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(ssiarray[j+1] < ssiarray[j]) {
|
||||
temp=ssiarray[j+1];
|
||||
ssiarray[j+1]=ssiarray[j];
|
||||
ssiarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* unsigned short int bubble sort */
|
||||
void usiBubbleSort(unsigned short int usiarray[],int size) {
|
||||
int i,j;
|
||||
unsigned short int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(usiarray[j+1] < usiarray[j]) {
|
||||
temp=usiarray[j+1];
|
||||
usiarray[j+1]=usiarray[j];
|
||||
usiarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,151 +0,0 @@
|
|||
/**
|
||||
* @file 145.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned int Bubble Sort.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
void siBubbleSort(signed int siarray[],int size);
|
||||
void uiBubbleSort(unsigned int uiarray[],int size);
|
||||
|
||||
int main() {
|
||||
|
||||
signed int siinput[21];
|
||||
unsigned int uiinput[21];
|
||||
|
||||
signed char i;
|
||||
unsigned char j;
|
||||
|
||||
int count,errorsi,errorui;
|
||||
|
||||
siinput[0]=0xF234F5DF;
|
||||
siinput[1]=0x23512444;
|
||||
siinput[2]=0x34565612;
|
||||
siinput[3]=0x1234F645;
|
||||
siinput[4]=0x8901FF80;
|
||||
siinput[5]=0x789012DD;
|
||||
siinput[6]=0x23454343;
|
||||
siinput[7]=0x8965F167;
|
||||
siinput[8]=0x00000000;
|
||||
siinput[9]=0x45670123;
|
||||
siinput[10]=0x23453301;
|
||||
siinput[11]=0x543212F7;
|
||||
siinput[12]=0x76548745;
|
||||
siinput[13]=0x23458286;
|
||||
siinput[14]=0x87651296;
|
||||
siinput[15]=0xD3453452;
|
||||
siinput[16]=0xC432E3FF;
|
||||
siinput[17]=0x22222456;
|
||||
siinput[18]=0x12346723;
|
||||
siinput[19]=0xD4567510;
|
||||
siinput[20]=0x00000005;
|
||||
|
||||
uiinput[0]=0xF234F5DF;
|
||||
uiinput[1]=0x23512444;
|
||||
uiinput[2]=0x34565612;
|
||||
uiinput[3]=0x1234F645;
|
||||
uiinput[4]=0x8901FF80;
|
||||
uiinput[5]=0x789012DD;
|
||||
uiinput[6]=0x23454343;
|
||||
uiinput[7]=0x8965F167;
|
||||
uiinput[8]=0x00000000;
|
||||
uiinput[9]=0x45670123;
|
||||
uiinput[10]=0x23453301;
|
||||
uiinput[11]=0x543212F7;
|
||||
uiinput[12]=0x76548745;
|
||||
uiinput[13]=0x23458286;
|
||||
uiinput[14]=0x87651296;
|
||||
uiinput[15]=0xD3453452;
|
||||
uiinput[16]=0xC432E3FF;
|
||||
uiinput[17]=0x22222456;
|
||||
uiinput[18]=0x12346723;
|
||||
uiinput[19]=0xD4567510;
|
||||
uiinput[20]=0x00000005;
|
||||
|
||||
|
||||
/* signed sort */
|
||||
siBubbleSort(siinput,21);
|
||||
/* unsigned sort */
|
||||
uiBubbleSort(uiinput,21);
|
||||
|
||||
|
||||
/* Check */
|
||||
errorsi=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(siinput[count] > siinput[count+1])
|
||||
errorsi=1;
|
||||
|
||||
/* Check */
|
||||
errorui=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(uiinput[count] > uiinput[count+1])
|
||||
errorui=1;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
/* signed int bubble sort */
|
||||
void siBubbleSort(signed int siarray[],int size) {
|
||||
int i,j;
|
||||
signed int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(siarray[j+1] < siarray[j]) {
|
||||
temp=siarray[j+1];
|
||||
siarray[j+1]=siarray[j];
|
||||
siarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* unsigned int bubble sort */
|
||||
void uiBubbleSort(unsigned int uiarray[],int size) {
|
||||
int i,j;
|
||||
unsigned int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(uiarray[j+1] < uiarray[j]) {
|
||||
temp=uiarray[j+1];
|
||||
uiarray[j+1]=uiarray[j];
|
||||
uiarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,153 +0,0 @@
|
|||
/**
|
||||
* @file 146.array.c
|
||||
* @author The ArchC Team
|
||||
* http://www.archc.org/
|
||||
*
|
||||
* Computer Systems Laboratory (LSC)
|
||||
* IC-UNICAMP
|
||||
* http://www.lsc.ic.unicamp.br
|
||||
*
|
||||
* @version 1.0
|
||||
* @date Mon, 19 Jun 2006 15:33:22 -0300
|
||||
* @brief It is a simple main function that uses signed and unsigned long long int Bubble Sort.
|
||||
*
|
||||
* @attention Copyright (C) 2002-2006 --- The ArchC Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* It is a simple main function that uses signed and unsigned long long int Bubble Sort.*/
|
||||
|
||||
/* The file begin.h is included if compiler flag -DBEGINCODE is used */
|
||||
#ifdef BEGINCODE
|
||||
#include "begin.h"
|
||||
#endif
|
||||
|
||||
void sliBubbleSort(signed long long int siarray[],int size);
|
||||
void uliBubbleSort(unsigned long long int uiarray[],int size);
|
||||
|
||||
int main() {
|
||||
|
||||
signed long long int sliinput[21];
|
||||
unsigned long long int uliinput[21];
|
||||
|
||||
signed char i;
|
||||
unsigned char j;
|
||||
|
||||
int count,errorsli,erroruli;
|
||||
|
||||
sliinput[0]=0xF5032345F234F5DFLL;
|
||||
sliinput[1]=0xD3A4F62123512444LL;
|
||||
sliinput[2]=0x9876223434565612LL;
|
||||
sliinput[3]=0x000000001234F645LL;
|
||||
sliinput[4]=0x234567898901FF80LL;
|
||||
sliinput[5]=0x78905432789012DDLL;
|
||||
sliinput[6]=0x1234567823454343LL;
|
||||
sliinput[7]=0x890765238965F167LL;
|
||||
sliinput[8]=0x0000000000000000LL;
|
||||
sliinput[9]=0x4523457845670123LL;
|
||||
sliinput[10]=0x0987123423453301LL;
|
||||
sliinput[11]=0x56780987543212F7LL;
|
||||
sliinput[12]=0x8654123476548745LL;
|
||||
sliinput[13]=0x45E3213423458286LL;
|
||||
sliinput[14]=0xF234566887651296LL;
|
||||
sliinput[15]=0xD345674902953452LL;
|
||||
sliinput[16]=0x4523457845670123LL;
|
||||
sliinput[17]=0x2345678922222456LL;
|
||||
sliinput[18]=0x8889098612346723LL;
|
||||
sliinput[19]=0x12345433D4567510LL;
|
||||
sliinput[20]=0x0000000000000005LL;
|
||||
|
||||
uliinput[0]=0xF5032345F234F5DFULL;
|
||||
uliinput[1]=0xD3A4F62123512444ULL;
|
||||
uliinput[2]=0x9876223434565612ULL;
|
||||
uliinput[3]=0x000000001234F645ULL;
|
||||
uliinput[4]=0x234567898901FF80ULL;
|
||||
uliinput[5]=0x78905432789012DDULL;
|
||||
uliinput[6]=0x1234567823454343ULL;
|
||||
uliinput[7]=0x890765238965F167ULL;
|
||||
uliinput[8]=0x0000000000000000ULL;
|
||||
uliinput[9]=0x4523457845670123ULL;
|
||||
uliinput[10]=0x0987123423453301ULL;
|
||||
uliinput[11]=0x56780987543212F7ULL;
|
||||
uliinput[12]=0x8654123476548745ULL;
|
||||
uliinput[13]=0x45E3213423458286ULL;
|
||||
uliinput[14]=0xF234566887651296ULL;
|
||||
uliinput[15]=0xD345674902953452ULL;
|
||||
uliinput[16]=0x4523457845670123ULL;
|
||||
uliinput[17]=0x2345678922222456ULL;
|
||||
uliinput[18]=0x8889098612346723ULL;
|
||||
uliinput[19]=0x12345433D4567510ULL;
|
||||
uliinput[20]=0x0000000000000005ULL;
|
||||
|
||||
|
||||
/* signed sort */
|
||||
sliBubbleSort(sliinput,21);
|
||||
/* unsigned sort */
|
||||
uliBubbleSort(uliinput,21);
|
||||
|
||||
|
||||
/* Check */
|
||||
errorsli=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(sliinput[count] > sliinput[count+1])
|
||||
errorsli=1;
|
||||
|
||||
/* Check */
|
||||
erroruli=0;
|
||||
for(count=0 ; count < 20 ; count++)
|
||||
if(uliinput[count] > uliinput[count+1])
|
||||
erroruli=1;
|
||||
|
||||
|
||||
return 0;
|
||||
/* Return 0 only */
|
||||
}
|
||||
|
||||
/* The file end.h is included if compiler flag -DENDCODE is used */
|
||||
#ifdef ENDCODE
|
||||
#include "end.h"
|
||||
#endif
|
||||
|
||||
/* signed long long int bubble sort */
|
||||
void sliBubbleSort(signed long long int sliarray[],int size) {
|
||||
int i,j;
|
||||
signed long long int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(sliarray[j+1] < sliarray[j]) {
|
||||
temp=sliarray[j+1];
|
||||
sliarray[j+1]=sliarray[j];
|
||||
sliarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* unsigned long long int bubble sort */
|
||||
void uliBubbleSort(unsigned long long int uliarray[],int size) {
|
||||
int i,j;
|
||||
unsigned long long int temp;
|
||||
for(i=(size-1);i>=0;i--) {
|
||||
for(j=0;j<i;j++) {
|
||||
if(uliarray[j+1] < uliarray[j]) {
|
||||
temp=uliarray[j+1];
|
||||
uliarray[j+1]=uliarray[j];
|
||||
uliarray[j]=temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
|
||||
SUFFIX = .$(ARCH)
|
||||
ECHO = /bin/echo
|
||||
TESTS = $(patsubst %.c,%,$(wildcard *.c))
|
||||
TESTS_X86 = $(patsubst %.c,%.x86,$(wildcard *.c))
|
||||
|
||||
|
||||
# Use rules
|
||||
help:
|
||||
@$(ECHO) -e "\nRules:\n"
|
||||
@$(ECHO) -e "help: \tShow this help"
|
||||
@$(ECHO) -e "build: \tCompile programs"
|
||||
@$(ECHO) -e "run: \tRun the simulator with gdb commands"
|
||||
@$(ECHO) -e "check: \tCheck the simulator outputs with the host outputs"
|
||||
@$(ECHO) -e "clean: \tRemove generated files"
|
||||
@$(ECHO) -e "\nEdit and source the file 'acstone.env.sh' before of all\n"
|
||||
|
||||
build: $(TESTS) $(TESTS_X86)
|
||||
|
||||
$(TESTS_X86):
|
||||
gcc -g $(basename $@).c -o $@ -lm
|
||||
|
||||
include $(ARCH).mk
|
||||
|
||||
|
||||
# Clean executables and backup files
|
||||
clean:
|
||||
rm -f $(TESTS)
|
||||
rm -f *~
|
||||
rm -f *.cmd
|
||||
rm -f *.out
|
||||
rm -f *.$(ARCH)
|
||||
rm -f *.x86
|
||||
rm -f *.$(ARCH).stats
|
||||
|
||||
run:
|
||||
./bin/run_x86.sh
|
||||
./bin/run_simulator.sh &
|
||||
./bin/run_gdb.sh
|
||||
|
||||
check:
|
||||
./bin/check.sh
|
||||
|
||||
consolidate:
|
||||
./bin/consolidate.sh
|
||||
|
||||
.PHONY: build clean all
|
|
@ -1,124 +0,0 @@
|
|||
ACStone
|
||||
============
|
||||
|
||||
* For adding another architecture, follow riscv.mk convention and create the .mk file with $(TESTS) rule.
|
||||
|
||||
* Execute `make` to see the options
|
||||
|
||||
* Edit and source the file `acstone.env.sh`
|
||||
```bash
|
||||
source acstone.env.sh
|
||||
```
|
||||
|
||||
* Build the pieces of code
|
||||
```bash
|
||||
make build
|
||||
```
|
||||
|
||||
* Run the simulator using gdb commands
|
||||
```bash
|
||||
make run
|
||||
```
|
||||
|
||||
* Check the correctness using the x86 output
|
||||
```bash
|
||||
make check
|
||||
```
|
||||
* If you are using acsim with -scsv flag, run the following to generate consolidated statistics
|
||||
```bash
|
||||
make consolidate
|
||||
```
|
||||
|
||||
|
||||
Pieces of code
|
||||
---------------------
|
||||
|
||||
```
|
||||
000.main Simple main function that returns 0
|
||||
|
||||
011.const Uses signed char
|
||||
012.const Uses unsigned char
|
||||
013.const Uses signed short int
|
||||
014.const Uses unsigned short int
|
||||
015.const Uses int
|
||||
016.const Uses unsigned int
|
||||
017.const Uses signed long long int
|
||||
018.const Uses unsigned long long int
|
||||
|
||||
021.cast Uses cast signed char to signed short int
|
||||
022.cast Uses cast signed char to signed int
|
||||
023.cast Uses cast signed char to signed long long int
|
||||
024.cast Uses cast signed short int to signed int
|
||||
025.cast Uses cast signed short int to signed long long int
|
||||
026.cast Uses cast signed int to signed long long int
|
||||
027.cast Uses some unsigned casts
|
||||
|
||||
031.add Uses signed and unsigned char adds
|
||||
032.add Uses signed and unsigned short int adds
|
||||
033.add Uses signed and unsigned int adds
|
||||
034.add Uses signed and unsigned long long int adds
|
||||
|
||||
041.sub Uses signed and unsigned char subs
|
||||
042.sub Uses signed and unsigned short int subs
|
||||
043.sub Uses signed and unsigned int subs
|
||||
044.sub Uses signed and unsigned long long int adds
|
||||
|
||||
051.mul Uses signed char multiplication
|
||||
052.mul Uses unsigned char multiplication
|
||||
053.mul Uses signed short int multiplication
|
||||
054.mul Uses unsigned short int multiplication
|
||||
055.mul Uses signed int multiplication
|
||||
056.mul Uses unsigned int multiplication
|
||||
057.mul Uses various signed multiplication
|
||||
058.mul Uses various unsigned multiplication
|
||||
|
||||
061.div Uses signed char division
|
||||
062.div Uses unsigned char division
|
||||
063.div Uses signed short int division
|
||||
064.div Uses unsigned short int division
|
||||
065.div Uses signed int division
|
||||
066.div Uses unsigned int division
|
||||
067.div Uses signed long long int division
|
||||
068.div Uses unsigned long long int division
|
||||
|
||||
071.bool Uses char boolean operators
|
||||
072.bool Uses short int boolean operators
|
||||
073.bool Uses int boolean operators
|
||||
074.bool Uses long long int boolean operators
|
||||
075.bool Uses various boolean operators
|
||||
|
||||
081.shift Uses signed and unsigned char shifts
|
||||
082.shift Uses signed and unsigned short int shifts
|
||||
083.shift Uses signed and unsigned int shifts
|
||||
084.shift Uses signed and unsigned long long int shifts
|
||||
085.shift Uses shifts and some logic operators
|
||||
|
||||
111.if Uses signed char ifs
|
||||
112.if Uses unsigned char ifs
|
||||
113.if Uses signed short int ifs
|
||||
114.if Uses unsigned short int ifs
|
||||
115.if Uses signed int ifs
|
||||
116.if Uses unsigned int ifs
|
||||
117.if Uses signed long long int ifs
|
||||
118.if Uses unsigned long long int ifs
|
||||
119.if Uses various ifs
|
||||
|
||||
121.loop Uses while loops
|
||||
122.loop Uses for loops
|
||||
123.loop Uses implemented unsigned multiplication
|
||||
124.loop Uses implemented signed multiplication (Booth)
|
||||
125.loop Uses implemented simple strlen loop
|
||||
126.loop Uses implemented simple fatorial loop
|
||||
|
||||
131.call Uses calls functions arg int, ret int
|
||||
132.call Uses indirect calls functions
|
||||
133.call Uses recursive fatorial
|
||||
134.call Uses recursive Fibonacci function
|
||||
|
||||
141.array Uses size three dot products
|
||||
142.array Uses a kind of square matrix multiplication
|
||||
143.array Uses signed and unsigned char Bubble Sort
|
||||
144.array Uses signed and unsigned short int Bubble Sort
|
||||
145.array Uses signed and unsigned int Bubble Sort
|
||||
146.array Uses signed and unsigned long long int Bubble Sort
|
||||
```
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
export ARCH="mips"
|
||||
export CROSS_COMPILER="mips-newlib-elf-gcc"
|
||||
export GDB="gdb-multiarch"
|
||||
export SIMULATOR="/home/max/ArchC/processors/github/mips/mips.x --load="
|
||||
export GDBPORT="5000"
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
for I in *.x86.out ; do
|
||||
|
||||
TMP=`echo $I | cut -d '.' -f '1 2'`
|
||||
#diff --brief --report-identical-files ${TMP}.${ARCH}.out data/$TMP.data
|
||||
diff --brief --report-identical-files ${TMP}.${ARCH}.out ${TMP}.x86.out
|
||||
|
||||
done
|
|
@ -1,25 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
rm "$ARCH.stats"
|
||||
awk -F", " 'BEGIN { OFS = ";"} {print $1}' "000.main.$ARCH.stats" > "$ARCH.stats"
|
||||
|
||||
for I in `ls *.${ARCH}`; do
|
||||
echo "Processing:" "$I.stats"
|
||||
VAR=`awk -F", " 'BEGIN { OFS = ", "} FNR==NR{a[$1]=$0; next}{print a[$1],$2}' "$ARCH.stats" "$I.stats"`
|
||||
echo "$VAR" > "$ARCH.stats"
|
||||
done
|
||||
|
||||
VAR=`awk -F", " 'BEGIN { OFS = ", "} NR > 1 { sum=0; for(i = 2; i <= NF; i++) { sum+=$i; }; print $1, sum; }' "$ARCH.stats"`
|
||||
echo "$VAR" > "$ARCH.stats"
|
||||
|
||||
echo "UNTESTED INSTRUCTIONS:"
|
||||
VAR=`awk -F", " '{ if($2 == 0) print $1 }' "$ARCH.stats"`
|
||||
|
||||
echo "$VAR"
|
||||
|
||||
COUNT_TESTED=`awk '$2 > 0 { count++ } END { print count }' "$ARCH.stats"`
|
||||
COUNT_UNTESTED=`awk '$2 == 0 { count++ } END { print count }' "$ARCH.stats"`
|
||||
echo "COUNT_TESTED: $COUNT_TESTED"
|
||||
echo "COUNT_UNTESTED: $COUNT_UNTESTED"
|
||||
DIV=`bc <<< "scale=2; ($COUNT_TESTED / ($COUNT_UNTESTED+$COUNT_TESTED))*100"`
|
||||
echo "Coverage: $DIV%"
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# For each compiled program construct a gdb's
|
||||
# command file and call gdb
|
||||
|
||||
# Compute the number lines of inicial first commands file
|
||||
NLCFG=`cat gdb/firstcommands.gdb | wc -l`
|
||||
|
||||
#Make a loop for each file
|
||||
for I in `ls *.${ARCH}`; do
|
||||
|
||||
NAME=`echo ${I} | cut -f '1 2' -d '.'`
|
||||
NL=`cat gdb/${NAME}.gdb | wc -l`
|
||||
NLSHOW=`expr ${NL} - 2`
|
||||
|
||||
rm -f ${NAME}.cmd
|
||||
cat gdb/firstcommands.gdb > ${NAME}.cmd
|
||||
sed -i "s@\$GDBPORT@$GDBPORT@g" ${NAME}.cmd
|
||||
tail -n ${NLSHOW} gdb/${NAME}.gdb >> ${NAME}.cmd
|
||||
|
||||
echo "${GDB} ${I} --command=${NAME}.cmd -batch"
|
||||
${GDB} ${I} --command=${NAME}.cmd -batch | cut -s -f 2 -d '$' | cut -f 2 -d '=' > ${NAME}.${ARCH}.out
|
||||
|
||||
if [ -e ${ARCH}_lastrun_stats.csv ]
|
||||
then
|
||||
mv ${ARCH}_lastrun_stats.csv ${I}.stats
|
||||
fi
|
||||
|
||||
sleep 0.25
|
||||
|
||||
done
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Make a loop for each file
|
||||
for I in `ls *.${ARCH}`
|
||||
do
|
||||
|
||||
echo ${SIMULATOR}${I} --port=${GDBPORT}
|
||||
${SIMULATOR}${I} --port=${GDBPORT}
|
||||
|
||||
done
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
for I in `ls *.x86`
|
||||
do
|
||||
NAME=`echo ${I} | cut -f '1 2' -d '.'`
|
||||
# gdb ${I} --command=gdb/${NAME}.gdb > ${I}.out
|
||||
gdb ${I} --command=gdb/${NAME}.gdb | cut -s -f 2 -d '$' | cut -f 2 -d '=' > ${I}.out
|
||||
|
||||
done
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
c
|
||||
q
|
|
@ -1,20 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
n
|
||||
p c
|
||||
c
|
||||
q
|
|
@ -1,20 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
n
|
||||
p uc
|
||||
c
|
||||
q
|
|
@ -1,20 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
n
|
||||
p si
|
||||
c
|
||||
q
|
|
@ -1,20 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
n
|
||||
p usi
|
||||
c
|
||||
q
|
|
@ -1,20 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
n
|
||||
p i
|
||||
c
|
||||
q
|
|
@ -1,20 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
n
|
||||
p ui
|
||||
c
|
||||
q
|
|
@ -1,20 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
n
|
||||
p li
|
||||
c
|
||||
q
|
|
@ -1,20 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
n
|
||||
p uli
|
||||
c
|
||||
q
|
|
@ -1,20 +0,0 @@
|
|||
b main
|
||||
r
|
||||
n
|
||||
n
|
||||
n
|
||||
p si
|
||||
n
|
||||
n
|
||||
n
|
||||
p si
|
||||
n
|
||||
n
|
||||
n
|
||||
p si
|
||||
n
|
||||
n
|
||||
n
|
||||
p si
|
||||
c
|
||||
q
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue