AnyDSL / thorin

The Higher-Order Intermediate Representation
https://anydsl.github.io
GNU Lesser General Public License v3.0
151 stars 15 forks source link

Implemented inline assembly #53

Closed tillspeicher closed 7 years ago

leissa commented 7 years ago

Hi,

the patch looks nice :)

Some minor technical remarks:

To sum it up, the constructor should look like this:

Assembly(const Type* type, Defs input, std::string asm_template, ArrayRef<std::string> output_constraints, ArrayRef<std::string> input_constraints, ArrayRef<std::string> clobbers, Flags flags, const Location& loc)

Same story for the factory method + a second method which looks like this:

assembly(Types types, const Def* mem, Defs input, std::string asm_template, ArrayRef<std::string> output_constraints, ArrayRef<std::string> input_constraints, ArrayRef<std::string> clobbers, Flags flags, const Location& loc)
tillspeicher commented 7 years ago

I addressed all the issues, it should be ready to merge now.

leissa commented 7 years ago

I've also polished a bit and fixed some potential problems. Can you plz have a look at my chagnes that I didn't break anything? Note that I have removed the static method get_flags. Simply use, for instance: HasSideEffects | IsAlignStack. Maybe, you want to reuse in impala the same enum. So you don't have to convert stuff.

tillspeicher commented 7 years ago

I'm just updating Impala based on the changes you made. Using the Flags enum there would be nice, but then we need to include primop.h in ast.h which I guess we don't want. In this case we should move the enum somewhere else and include that. Is enums.h the right place for that?

leissa commented 7 years ago

Simply include primop.h. That's fine.