source: proto/s2k/trunk/framework/src/toolchain/b2k/lang/carrySet/CarrySetBuiltin2C.java @ 3817

Last change on this file since 3817 was 3817, checked in by ksherdy, 4 years ago

Moved carrySet from s2k to b2k.

File size: 1.3 KB
Line 
1package toolchain.b2k.lang.carrySet;
2
3import java.util.HashMap;
4import java.util.Map;
5
6
7public class CarrySetBuiltin2C extends CarrySetEncoder {
8       
9        private static Map<CarrySetBuiltin, String> carry2CCode;
10       
11    static {
12       
13        carry2CCode = new HashMap<CarrySetBuiltin, String>();
14        carry2CCode.put(CarrySetBuiltin.CARRYDECLARE, "CarryDeclare");             // Macros
15        carry2CCode.put(CarrySetBuiltin.LOCALCARRYCOMBINE,"LocalCarryCombine");
16        carry2CCode.put(CarrySetBuiltin.CARRYRANGE,"carryRange");                  // Members
17        carry2CCode.put(CarrySetBuiltin.GETCARRY,"getCarry");
18        carry2CCode.put(CarrySetBuiltin.SETCARRY,"setCarry");
19        carry2CCode.put(CarrySetBuiltin.PENDING64,"getPending64");
20        carry2CCode.put(CarrySetBuiltin.CARRYADJUST,"carryAdjust");
21        carry2CCode.put(CarrySetBuiltin.CARRYDEQUEUEENQUEUE,"carryDequeueEnqueue");
22        carry2CCode.put(CarrySetBuiltin.CARRYFLIP,"carryFlip");
23       
24        for(CarrySetBuiltin op : CarrySetBuiltin.values()) {
25                if(!carry2CCode.containsKey(op)) {
26                        throw new RuntimeException("CarrySet to C code mapping unimplemented :" + CarrySetBuiltin2CPP.class.getSimpleName());
27                }
28        }
29    }
30
31        public String getName(CarrySetBuiltin op) {
32                return carry2CCode.get(op);
33        }
34
35}
Note: See TracBrowser for help on using the repository browser.