  The aim of the paper is to extend the class of generalized Weyl algebras to a
larger class of rings (they are also called {\em generalized Weyl algebras})
that are determined by two ring endomorphisms rather than one as in the case of
`old' GWAs. A new class of rings, the {\em diskew polynomial rings}, is
introduced that is closely related to GWAs (they are GWAs under a mild
condition). The, so-called, ambiskew polynomial rings are a small subclass of
the class of diskew polynomial rings. Semisimplicity criteria are given for
generalized Weyl algebras and diskew polynomial rings.
